forked from tsuki/openroller
26 lines
966 B
Java
26 lines
966 B
Java
// GhidraScript: list functions whose symbol name contains a substring.
|
|
// Usage: FindFunctions.java DrawMark
|
|
|
|
import ghidra.app.script.GhidraScript;
|
|
import ghidra.program.model.listing.Function;
|
|
import ghidra.program.model.listing.FunctionIterator;
|
|
|
|
public class FindFunctions extends GhidraScript {
|
|
@Override
|
|
public void run() throws Exception {
|
|
String[] args = getScriptArgs();
|
|
if (args == null || args.length == 0) {
|
|
printerr("FindFunctions: needs a case-sensitive name substring");
|
|
return;
|
|
}
|
|
String needle = args[0];
|
|
FunctionIterator functions = currentProgram.getFunctionManager().getFunctions(true);
|
|
while (functions.hasNext() && !monitor.isCancelled()) {
|
|
Function function = functions.next();
|
|
if (function.getName(true).contains(needle)) {
|
|
println(function.getEntryPoint() + " " + function.getName(true));
|
|
}
|
|
}
|
|
}
|
|
}
|