Files
reverse-engineering-anything/tests/conformance/ghidra/ReaSelectedProjectSeeds.java
T
morluto 1a0e2c77f2 fix(ghidra): qualify selected project call coverage (#8391)
* fix(ghidra): qualify selected project call coverage

* test(ghidra): retain verifier MCP cleanup ownership

* test(ghidra): document trusted verifier compiler selection

* test(ghidra): document owned verifier exit marker

* test(ghidra): remove ineffective scan directives

* fix(ghidra): supervise project coverage verification

* fix(ghidra): supervise verifier compiler process
2026-11-08 08:57:05 +08:00

27 lines
1.4 KiB
Java

import ghidra.app.script.GhidraScript;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSet;
import ghidra.program.model.listing.Function;
import ghidra.program.model.symbol.SourceType;
import ghidra.program.model.symbol.Symbol;
import java.util.List;
// Create addressable entries without decoding their instructions or analyzing calls.
public class ReaSelectedProjectSeeds extends GhidraScript {
@Override public void run() throws Exception {
for (String name : List.of("rea_project_leaf", "rea_project_caller", "rea_project_other")) {
List<Symbol> symbols = getSymbols(name, null);
if (symbols.isEmpty()) symbols = getSymbols("_" + name, null);
if (symbols.size() != 1) throw new IllegalStateException("Expected one symbol for " + name);
Address entry = symbols.get(0).getAddress();
Function function = getFunctionAt(entry);
if (function == null)
function = currentProgram.getFunctionManager().createFunction(
symbols.get(0).getName(), entry, new AddressSet(entry, entry), SourceType.USER_DEFINED);
if (currentProgram.getListing().getInstructions(function.getBody(), true).hasNext())
throw new IllegalStateException("Expected an unanalyzed function: " + name);
println("REA_PROJECT_SEED " + name + " " + entry);
}
}
}