-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnthunk.java
More file actions
23 lines (22 loc) · 890 Bytes
/
Unthunk.java
File metadata and controls
23 lines (22 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@category 3DS
import ghidra.app.script.GhidraScript;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.FunctionIterator;
import ghidra.program.model.listing.FunctionManager;
import ghidra.program.model.symbol.SourceType;
import ghidra.program.model.symbol.Symbol;
public class Unthunk extends GhidraScript {
@Override
protected void run() throws Exception {
FunctionManager fman = currentProgram.getFunctionManager();
FunctionIterator iter = fman.getFunctions(true);
while (iter.hasNext()) {
Function f = iter.next();
if (f.isThunk() && !f.getName().contains(
f.getSymbol().getAddress().toString())) {
Symbol sym = f.getSymbol();
sym.setName(sym.getName() + "_" + sym.getAddress().toString(), SourceType.DEFAULT);
}
}
}
}