lucasg/Dependencies · error

[x] Command {0:s} needs to have a PE <FILE> argument

Error message

[x] Command {0:s} needs to have a PE <FILE> argument

What it means

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.

Source

Thrown at Dependencies/Program.cs:866

                            { "modules", "dump <FILE> resolved modules", v => command = DumpModules },
						};

			List<string> eps = opts.Parse(args);

			if (early_exit)
				return;

			if ((show_help) || (args.Length == 0) || (command == null))
			{
				DumpUsage();
				return;
			}

			BinaryCache.InitializeBinaryCache(use_bin_cache);

			if (eps.Count == 0)
            {
                Console.Error.WriteLine("[x] Command {0:s} needs to have a PE <FILE> argument", command.Method.Name);
                Console.Error.WriteLine("");

                DumpUsage();
                return;
            }

			String FileName = eps[0];
            if (!NativeFile.Exists(FileName))
            {
                Console.Error.WriteLine("[x] Could not find file {0:s} on disk", FileName);
                return;
            }

			Debug.WriteLine("[-] Loading file {0:s} ", FileName);
			PE Pe = new PE(FileName);
            if (!Pe.Load())
            {
                Console.Error.WriteLine("[x] Could not load file {0:s} as a PE", FileName);

View on GitHub (pinned to 1997a40000)

Solutions

  1. Append the target PE path to the command, e.g. `Dependencies.exe -imports C:\Windows\System32\notepad.exe`.
  2. Quote paths containing spaces: `Dependencies.exe -manifest "C:\Program Files\app\app.exe"`.
  3. Run `Dependencies.exe -h` to confirm which commands require a <FILE>.

Example fix

// before (fails):  Dependencies.exe -exports
// after (works):   Dependencies.exe -exports C:\Windows\System32\kernel32.dll
Defensive patterns

Strategy: validation

Validate before calling

// Replicate Main's guard: ensure a positional file argument is present.
List<string> positional = opts.Parse(args);
if (command != null && positional.Count == 0)
{
    Console.Error.WriteLine($"[x] Command {command.Method.Name} needs to have a PE <FILE> argument");
    Program.DumpUsage();
    return;
}

Prevention

When it happens

Trigger: Running a file-requiring command without a trailing <FILE>, e.g. `Dependencies.exe -imports` or `Dependencies.exe -chain`.

Common situations: Forgotten file argument; quoting mistake that made the shell swallow the path; copy-pasting a partial command line.

Related errors


AI-assisted analysis of lucasg/Dependencies@1997a40000 (2026-08-13). Data as JSON: /api/errors/69b4fe19ae10a9d8. Report an issue: GitHub.