Initial public source release
Split reusable rendering and format support into vectorail-core and vectorail-gc.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// GhidraScript: rename functions from address/name pairs.
|
||||
// Usage: RenameFunctions.java 0x00100000 FunctionName 0x00100100 OtherName
|
||||
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Function;
|
||||
import ghidra.program.model.symbol.SourceType;
|
||||
|
||||
public class RenameFunctions extends GhidraScript {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
String[] args = getScriptArgs();
|
||||
if (args == null || args.length == 0 || (args.length & 1) != 0) {
|
||||
printerr("RenameFunctions: needs address/name pairs");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < args.length; i += 2) {
|
||||
Address address = toAddr(Long.decode(args[i]));
|
||||
Function function = getFunctionAt(address);
|
||||
if (function == null) {
|
||||
printerr("no function at " + address);
|
||||
continue;
|
||||
}
|
||||
function.setName(args[i + 1], SourceType.USER_DEFINED);
|
||||
println(address + " " + function.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user