30 lines
1019 B
Java
30 lines
1019 B
Java
// Seed NE entry points that Ghidra 12.1's automatic analysis leaves undefined.
|
|
// @category TDKPIN
|
|
|
|
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 SeedMissingEntrypoints extends GhidraScript {
|
|
@Override
|
|
public void run() throws Exception {
|
|
seed("1000:eaB1", "exported_ordinal_10");
|
|
seed("1000:fd85", "ne_program_entry");
|
|
analyzeAll(currentProgram);
|
|
}
|
|
|
|
private void seed(String text, String name) throws Exception {
|
|
Address address = toAddr(text);
|
|
disassemble(address);
|
|
Function function = getFunctionAt(address);
|
|
if (function == null) {
|
|
function = createFunction(address, name);
|
|
}
|
|
if (function != null && !name.equals(function.getName())) {
|
|
function.setName(name, SourceType.USER_DEFINED);
|
|
}
|
|
println("Seeded " + name + " at " + address);
|
|
}
|
|
}
|