Skip to content

Instantly share code, notes, and snippets.

@jmpews
Last active January 4, 2022 16:11
Show Gist options
  • Save jmpews/52660210a6aa442662c331ddc58d809e to your computer and use it in GitHub Desktop.
Save jmpews/52660210a6aa442662c331ddc58d809e to your computer and use it in GitHub Desktop.
ida python script
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