import ghidra.app.script.GhidraScript; import ghidra.program.model.listing.Function; import ghidra.program.model.listing.FunctionIterator; import ghidra.util.task.TaskMonitor; import java.io.PrintWriter; public class ListFuns extends GhidraScript { @Override public void run() throws Exception { FunctionIterator it = currentProgram.getFunctionManager().getFunctions(true); PrintWriter pw = new PrintWriter(new java.io.BufferedWriter( new java.io.FileWriter("/home/m/re-tools/funs_range.txt"))); long lo = 0x180500000L, hi = 0x180530000L; while (it.hasNext()) { Function f = it.next(); long off = f.getEntryPoint().getOffset(); if (off >= lo && off <= hi) { int n = 0; try { n = (int)f.getBody().getNumAddresses(); } catch (Exception e) {} pw.println(Long.toHexString(off) + " " + n + " " + f.getName()); } } pw.close(); println("LISTFUNS_DONE"); } }