{"record":{"id":"69b4fe19ae10a9d8","repo":"lucasg/Dependencies","slug":"x-command-0-s-needs-to-have-a-pe-file-argume","errorCode":null,"errorMessage":"[x] Command {0:s} needs to have a PE <FILE> argument","messagePattern":"\\[x\\] Command (.+?) needs to have a PE <FILE> argument","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Dependencies/Program.cs","lineNumber":866,"sourceCode":"                            { \"modules\", \"dump <FILE> resolved modules\", v => command = DumpModules },\n\t\t\t\t\t\t};\n\n\t\t\tList<string> eps = opts.Parse(args);\n\n\t\t\tif (early_exit)\n\t\t\t\treturn;\n\n\t\t\tif ((show_help) || (args.Length == 0) || (command == null))\n\t\t\t{\n\t\t\t\tDumpUsage();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tBinaryCache.InitializeBinaryCache(use_bin_cache);\n\n\t\t\tif (eps.Count == 0)\n            {\n                Console.Error.WriteLine(\"[x] Command {0:s} needs to have a PE <FILE> argument\", command.Method.Name);\n                Console.Error.WriteLine(\"\");\n\n                DumpUsage();\n                return;\n            }\n\n\t\t\tString FileName = eps[0];\n            if (!NativeFile.Exists(FileName))\n            {\n                Console.Error.WriteLine(\"[x] Could not find file {0:s} on disk\", FileName);\n                return;\n            }\n\n\t\t\tDebug.WriteLine(\"[-] Loading file {0:s} \", FileName);\n\t\t\tPE Pe = new PE(FileName);\n            if (!Pe.Load())\n            {\n                Console.Error.WriteLine(\"[x] Could not load file {0:s} as a PE\", FileName);","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/lucasg/Dependencies/blob/1997a40000b77bd3326cbc33672a7b9f78bb23f3/Dependencies/Program.cs#L848-L884","documentation":"Printed by Main (Program.cs:866) after option parsing when the positional-argument list `eps` is empty but a file-requiring command (imports/exports/manifest/sxsentries/apisetsdll/assemblyrefs/modulerefs/chain/modules) was selected. It names the offending command method and then dumps full usage. Non-fatal usage error: the process returns without loading anything.","triggerScenarios":"Running a file-requiring command without a trailing <FILE>, e.g. `Dependencies.exe -imports` or `Dependencies.exe -chain`.","commonSituations":"Forgotten file argument; quoting mistake that made the shell swallow the path; copy-pasting a partial command line.","solutions":["Append the target PE path to the command, e.g. `Dependencies.exe -imports C:\\Windows\\System32\\notepad.exe`.","Quote paths containing spaces: `Dependencies.exe -manifest \"C:\\Program Files\\app\\app.exe\"`.","Run `Dependencies.exe -h` to confirm which commands require a <FILE>."],"exampleFix":"// before (fails):  Dependencies.exe -exports\n// after (works):   Dependencies.exe -exports C:\\Windows\\System32\\kernel32.dll","handlingStrategy":"validation","validationCode":"// Replicate Main's guard: ensure a positional file argument is present.\nList<string> positional = opts.Parse(args);\nif (command != null && positional.Count == 0)\n{\n    Console.Error.WriteLine($\"[x] Command {command.Method.Name} needs to have a PE <FILE> argument\");\n    Program.DumpUsage();\n    return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an absolute, quoted path as the final argument for file-requiring commands.","Validate arg count in wrapper scripts before shelling out to Dependencies.exe."],"tags":["cli","argument-error","usage"],"backgroundTag":null,"analyzedSha":"1997a40000b77bd3326cbc33672a7b9f78bb23f3","analyzedAt":"2026-08-13T18:14:41.696Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}