NationalSecurityAgency/ghidra · error · InvalidParameterException

Executable

Error message

Executable 

What it means

CompareExecutablesScript queries the BSim database for an executable by name; if exeResult.recordCount is 0 it throws InvalidParameterException indicating the named executable is not present. This is a user-input validation error: the executable name provided via askString does not match any record in the target BSim database.

Solutions

  1. Verify the executable name spelling and case against the BSim database contents (query exe info without a filter to list available executables).
  2. Confirm the correct BSim server URL was provided — the executable may exist in a different repository.
  3. Run GenerateSignatures/ingestion for the target executable first to populate the database.
  4. Check whether the database stores full paths vs. basenames and adjust the queried name accordingly.
Defensive patterns

Strategy: validation

Validate before calling

// Before throwing, query available executables to validate the name
QueryExeInfo check = new QueryExeInfo();
check.filterExeName = null; // list all
ResponseExe all = check.execute(database);
boolean exists = all.records.stream()
    .anyMatch(r -> r.getName().equals(execName));
if (!exists) {
    // prompt user to pick from available names
}

Try / catch

try {
    // run comparison
} catch (InvalidParameterException e) {
    if (e.getMessage().contains("is not present in database")) {
        // re-prompt user with a list of available executables
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Running CompareExecutablesScript, providing an execName (via askString) and a database URL; QueryExeInfo.execute(database) returns a ResponseExe with recordCount == 0. The name filter matched no executable records.

Common situations: Typo in the executable name; the executable was never ingested into this BSim database; the wrong BSim server/database URL was specified; the executable was ingested under a different name (full path vs. basename mismatch); case sensitivity in the name filter.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/d457e8a517a14df6. Report an issue: GitHub.

Appendix: source

Thrown at Ghidra/Features/BSim/ghidra_scripts/CompareExecutablesScript.java:70

	private ExecutableComparison exeCompare;

	@Override
	protected void run() throws Exception {
		String urlString = askString("Enter BSim database URL", "URL: ");
		String execName =
			askString("Enter name of executable to compare against database", "Name: ");
		URL url = BSimClientFactory.deriveBSimURL(urlString);
		try (FunctionDatabase database = BSimClientFactory.buildClient(url, true)) {
			QueryExeInfo exeInfo = new QueryExeInfo();
			exeInfo.filterExeName = execName;
			ResponseExe exeResult = exeInfo.execute(database);
			if (exeResult == null) {
				String message = database.getLastError() != null ? database.getLastError().message
						: "Unrecoverable error";
				throw new IOException(message);
			}
			else if (exeResult.recordCount == 0) {
				throw new InvalidParameterException(
					"Executable " + execName + " is not present in database");
			}
			else if (exeResult.recordCount > 1) {
				println("Multiple executables with the name - " + execName);
				ExecutableRecord exeRecord = exeResult.records.get(0);
				print("Using ");
				println(exeRecord.printRaw());
			}
			String baseMd5 = exeResult.records.get(0).getMd5();

			ScoreCaching cache = null;		// If null, self scores will not be cached

			// Scores can be cached in the local file system by using FileScoreCaching
			// cache = new FileScoreCaching("/tmp/test_scorecacher.txt");

			// Scores can be cached in a dedicated table within the database by using TableScoreCaching
			// TableScoreCaching is currently only supported for the PostgreSQL back-end.
			// cache = new TableScoreCaching(database);

View on GitHub (pinned to d5f144c24d)