Last active
January 4, 2022 16:11
-
-
Save jmpews/52660210a6aa442662c331ddc58d809e to your computer and use it in GitHub Desktop.
ida python script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
def memory_dump(ea, size, file): | |
data = idc.get_bytes(ea, size, use_dbg = 0) | |
with open(file, "wb") as fp: | |
fp.write(data) | |
print("memory dump success!") | |
# memdump(0x1E140, 25978, "C:/Users/vm/Desktop/ios_sandbox_kext/dump.bin") | |
def print_hex_format(ea, size): | |
hexstr = binascii.hexlify(get_bytes(ea, size, use_dbg = 0)) | |
print(hexstr) | |
def print_c_format(ea, size): | |
mem_bytes = get_bytes(ea, size, use_dbg = 0) | |
hexstr = " ".join("{:02x}".format(ord(byte)) for byte in mem_bytes) | |
print(hexstr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment