NationalSecurityAgency/ghidra · error · IllegalArgumentException
Must specify either --md5 or --name option
Error message
Must specify either --md5 or --name option
What it means
Thrown by fillinSingleExeSpecifier() when neither --md5 nor --name is supplied to listfuncs, delete, or dumpsigs. At least one executable identifier is required to know which exe's functions/records to operate on. --arch and --compiler alone are insufficient because they refine a name, not identify an exe independently.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java:736
String nameOption = optionValueMap.get(NAME_OPTION);
String archOption = optionValueMap.get(ARCH_OPTION);
String compOption = optionValueMap.get(COMPILER_OPTION);
if (md5Option != null) {
if (!isAllNull(nameOption, archOption, compOption)) {
throw new IllegalArgumentException(
"The " + NAME_OPTION + ", " + ARCH_OPTION + ", " + COMPILER_OPTION +
" options are not valid when " + MD5_OPTION + " option is specified.");
}
spec.exemd5 = md5Option;
}
else if (nameOption != null) {
spec.exename = nameOption;
spec.arch = archOption;
spec.execompname = compOption;
}
else {
throw new IllegalArgumentException(
"Must specify either " + MD5_OPTION + " or " + NAME_OPTION + " option");
}
}
private void doListFunctions(List<String> params) throws IOException, LSHException {
Integer maxFunc = parsePositiveIntegerOption(MAX_FUNC_OPTION);
QueryName query = new QueryName();
fillinSingleExeSpecifier(query.spec);
if (maxFunc != null) {
query.maxfunc = maxFunc;
}
if (booleanOptions.contains(PRINT_SELF_SIGNIFICANCE_OPTION)) {
query.printselfsig = true;
}
if (booleanOptions.contains(CALL_GRAPH_OPTION)) {View on GitHub (pinned to d5f144c24d)
Solutions
- Add --md5 <hash> OR --name <exe_name> to the command.
- If using --name, you may also add --arch <languageID> and --compiler <cspecID> for precision.
- Review usage at line 1044 (listfuncs) or 1045 (dumpsigs) or 1043 (delete).
Example fix
// before bsim listfuncs postgresql://myhost/BsimDB // after bsim listfuncs postgresql://myhost/BsimDB --name myexe
Defensive patterns
Strategy: validation
Validate before calling
// At least one of --md5 or --name is required for exe-targeting commands
String md5 = optionValueMap.get("--md5");
String name = optionValueMap.get("--name");
if (md5 == null && name == null) {
throw new IllegalArgumentException("Specify --md5 <hash> or --name <exe> to identify the executable");
} Prevention
- Always supply an exe identifier for listfuncs/delete/dumpsigs.
- Validate that --arch/--compiler are only used alongside --name, not alone.
When it happens
Trigger: Running listfuncs/delete/dumpsigs with neither --md5 nor --name. md5Option is null and nameOption is null at line 722/730, falling through to the else at line 735.
Common situations: Forgetting the identifier entirely; supplying only --arch/--compiler (which are qualifiers, not identifiers); assuming the tool lists all functions with no filter.
Related errors
- Must specify either --bsim or --config option
- Missing one or more metadata options: --name, --owner, --des
- Unknown command: {}
- Unsupported command: {}
- Unsupported option use: {}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/aa76df21e29b7ad1.
Report an issue: GitHub.