{"record":{"id":"aa76df21e29b7ad1","repo":"NationalSecurityAgency/ghidra","slug":"must-specify-either-md5-or-name-option","errorCode":null,"errorMessage":"Must specify either --md5 or --name option","messagePattern":"Must specify either --md5 or --name option","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":736,"sourceCode":"\t\tString nameOption = optionValueMap.get(NAME_OPTION);\n\t\tString archOption = optionValueMap.get(ARCH_OPTION);\n\t\tString compOption = optionValueMap.get(COMPILER_OPTION);\n\n\t\tif (md5Option != null) {\n\t\t\tif (!isAllNull(nameOption, archOption, compOption)) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"The \" + NAME_OPTION + \", \" + ARCH_OPTION + \", \" + COMPILER_OPTION +\n\t\t\t\t\t\t\" options are not valid when \" + MD5_OPTION + \" option is specified.\");\n\t\t\t}\n\t\t\tspec.exemd5 = md5Option;\n\t\t}\n\t\telse if (nameOption != null) {\n\t\t\tspec.exename = nameOption;\n\t\t\tspec.arch = archOption;\n\t\t\tspec.execompname = compOption;\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\"Must specify either \" + MD5_OPTION + \" or \" + NAME_OPTION + \" option\");\n\t\t}\n\t}\n\n\tprivate void doListFunctions(List<String> params) throws IOException, LSHException {\n\n\t\tInteger maxFunc = parsePositiveIntegerOption(MAX_FUNC_OPTION);\n\n\t\tQueryName query = new QueryName();\n\t\tfillinSingleExeSpecifier(query.spec);\n\n\t\tif (maxFunc != null) {\n\t\t\tquery.maxfunc = maxFunc;\n\t\t}\n\t\tif (booleanOptions.contains(PRINT_SELF_SIGNIFICANCE_OPTION)) {\n\t\t\tquery.printselfsig = true;\n\t\t}\n\t\tif (booleanOptions.contains(CALL_GRAPH_OPTION)) {","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L718-L754","documentation":"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.","triggerScenarios":"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.","commonSituations":"Forgetting the identifier entirely; supplying only --arch/--compiler (which are qualifiers, not identifiers); assuming the tool lists all functions with no filter.","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)."],"exampleFix":"// before\nbsim listfuncs postgresql://myhost/BsimDB\n// after\nbsim listfuncs postgresql://myhost/BsimDB --name myexe","handlingStrategy":"validation","validationCode":"// At least one of --md5 or --name is required for exe-targeting commands\nString md5 = optionValueMap.get(\"--md5\");\nString name = optionValueMap.get(\"--name\");\nif (md5 == null && name == null) {\n    throw new IllegalArgumentException(\"Specify --md5 <hash> or --name <exe> to identify the executable\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply an exe identifier for listfuncs/delete/dumpsigs.","Validate that --arch/--compiler are only used alongside --name, not alone."],"tags":["cli","argument-validation","bsim","missing-option"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}