Skip to content

Instantly share code, notes, and snippets.

@henryfung3a27
henryfung3a27 / mem_init_block.py
Created November 18, 2019 03:50
A Ghidra script to initialise a block of uninitialised memory and set bytes to the block
# Initialise a block of memory by splitting the block of memory of interest, set
# them to initialised and set bytes to them
#@author Henry Fung
#@category CustomScript
#TODO Add User Code Here
def mySplit(start, end, value=""):
mem = currentProgram.getMemory()
aStart = currentAddress.getAddress(start)
aEnd = currentAddress.getAddress(hex(int(end, base=16) + 1)[2:])