lucasg/Dependencies · warning

[x] "Malformed" pe manifest for file {0:s} : {1:s}

Error message

[x] "Malformed" pe manifest for file {0:s} : {1:s}

What it means

Emitted by PEManifest.PrettyPrint() (Dependencies/Program.cs:140) when a PE has an embedded side-by-side manifest resource (Manifest.Length != 0) whose XML failed to parse at construction time. The constructor (Program.cs:107-123) wraps SxsManifest.ParseSxsManifest in try/catch(XmlException) and stores the failure string in the private Exception field; PrettyPrint then surfaces the raw manifest text plus that stored exception to stderr and returns early. It is a diagnostic warning, not a thrown exception, so the CLI keeps running.

Source

Thrown at Dependencies/Program.cs:140

                    Exception = e.ToString();
                }
            }
        }


        public void PrettyPrint()
        {
            Console.WriteLine("[-] Manifest for file : {0}", Application.Filepath);

            if (Manifest.Length == 0)
            {
                Console.WriteLine("[x] No embedded pe manifest for file {0:s}", Application.Filepath);
                return;
            }

            if (Exception.Length != 0)
            {
                Console.Error.WriteLine("[x] \"Malformed\" pe manifest for file {0:s} : {1:s}", Application.Filepath, Manifest);
                Console.Error.WriteLine("[x] Exception : {0:s}", Exception);
                return;
            }

            Console.WriteLine(XmlManifest);
        }

        public string Manifest;
        public XDocument XmlManifest;

        // stays private in order not end up in the json output
        private PE Application;
        private string Exception;
    }

    class PEImports : IPrettyPrintable
    {
        public PEImports(PE _Application)

View on GitHub (pinned to 1997a40000)

Solutions

  1. Read the raw Manifest text printed alongside this message to locate the XML defect (unclosed tag, stray BOM, invalid entity) and fix the manifest source in your build.
  2. Re-extract and validate the manifest independently with `mt.exe -inputresource:<file> -out:check.manifest` or Resource Hacker to confirm the resource is genuinely malformed.
  3. If the non-XML manifest is intentional, ignore the warning and ensure downstream consumers tolerate XmlManifest == null.
Defensive patterns

Strategy: validation

Validate before calling

// After constructing a PEManifest, check parse success before relying on the XML
var pm = new PEManifest(pe);
if (!string.IsNullOrEmpty(pm.Manifest) && pm.XmlManifest == null)
{
    // Manifest resource present but unparseable - handle gracefully
    Console.Error.WriteLine($"Skipping unparseable manifest for {pe.Filepath}");
    return;
}
// safe to use pm.XmlManifest here

Prevention

When it happens

Trigger: Running `Dependencies.exe -manifest <file>` (Main -> DumpManifest -> new PEManifest(pe) -> Printer -> PrettyPrint) against a PE whose RT_MANIFEST resource exists but is not well-formed XML.

Common situations: PEs built with a truncated or hand-edited manifest; manifests whose encoding is mangled by the constructor's UTF-8 round-trip (Program.cs:110); resources altered by packers/obfuscators or broken by older mt.exe toolchains.

Understand the failure class

Related errors


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