import ghidra.app.script.GhidraScript; import ghidra.program.model.address.Address; import ghidra.program.model.listing.Instruction; import ghidra.program.model.listing.Listing; import ghidra.program.model.mem.Memory; public class MemCheck extends GhidraScript { @Override protected void run() throws Exception { String[] args = getScriptArgs(); Memory mem = currentProgram.getMemory(); println("min=" + mem.getMinAddress() + " max=" + mem.getMaxAddress()); for (String arg : args) { Address a = toAddr(arg.trim()); boolean c = mem.contains(a); println(arg + " contains=" + c); if (c) { byte[] b = new byte[16]; int n = mem.getBytes(a, b); StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) sb.append(String.format("%02x ", b[i])); println(" bytes: " + sb); } } } }