lucasg/Dependencies · warning

{0:s} is not a valid PE-COFF file

Error message

{0:s} is not a valid PE-COFF file

What it means

Shown by DependencyWindow.InitializeView (DependenciesGui/DependencyWindow.xaml.cs:564) after App.LoadBinary returns a PE that is null or has LoadSuccessful == false. The file existed (error 15 did not fire) but phlib rejected it as a non-PE/COFF image; a modal 'Invalid PE' MessageBox is shown and InitializeView aborts.

Source

Thrown at DependenciesGui/DependencyWindow.xaml.cs:564

        }

        public void InitializeView()
        {
            if (!NativeFile.Exists(this.Filename))
            {
                MessageBox.Show(
                    String.Format("{0:s} is not present on the disk", this.Filename),
                    "Invalid PE",
                    MessageBoxButton.OK
                );

                return;
            }

            this.Pe = (Application.Current as App).LoadBinary(this.Filename);
			if (this.Pe == null || !this.Pe.LoadSuccessful)
			{
                MessageBox.Show(
                    String.Format("{0:s} is not a valid PE-COFF file", this.Filename),
                    "Invalid PE",
                    MessageBoxButton.OK
                );

                return;
            }

            this.SymPrv = new PhSymbolProvider();
            this.RootFolder = Path.GetDirectoryName(this.Filename);
            this.SxsEntriesCache = SxsManifest.GetSxsEntries(this.Pe);
            this.ProcessedModulesCache = new ModulesCache();
            this.ApiSetmapCache = Phlib.GetApiSetSchema();
            this._SelectedModule = null;
            this._DisplayWarning = false;

            // TODO : Find a way to properly bind commands instead of using this hack
            this.ModulesList.Items.Clear();

View on GitHub (pinned to 1997a40000)

Solutions

  1. Verify the file is a real PE with dumpbin or another PE tool.
  2. Disable the binary cache (Options->Properties) and retry to rule out a stale cached PE.
  3. Use the matching x86/x64 Dependencies build for the target image.
Defensive patterns

Strategy: validation

Validate before calling

this.Pe = (Application.Current as App).LoadBinary(this.Filename);
if (this.Pe == null || !this.Pe.LoadSuccessful)
{
    MessageBox.Show($"{this.Filename} is not a valid PE-COFF file", "Invalid PE", MessageBoxButton.OK);
    return;
}

Prevention

When it happens

Trigger: Opening an existing file in DependenciesGui that is not a parseable PE: non-PE binary, truncated image, unsupported architecture, or a cache-miss returning a failed PE.

Common situations: Dropping a text file, linux ELF binary, or corrupted download onto the GUI; stale binary-cache entry; wrong-bitness Dependencies opening an incompatible image.

Related errors


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