I was modding a Unity game on my Mac. The mod shipped as a .NET DLL and wouldn't load: the IL was plain managed code, but the assembly header was stamped for Windows x64, so the runtime refused it.
I opened the PE header, flipped the bits that pin it to a platform back to AnyCPU, and it loaded. That became pefix fix.
The header turned out to be the easy case. The failures that actually bite are about the folder around the DLL: a dependency that never got copied, two copies of one assembly at different versions, a method a plugin calls that the shipped library no longer has. None of it shows up until something loads the assembly at runtime.
So pefix grew into a static loadability preflight over a whole folder. It reads each assembly's metadata (no Assembly.Load) and resolves every reference, type, member, field and interface against what's present. It only reports what it can prove statically, so it won't fail a build on a false alarm, which is what makes it usable as a hard CI gate.
dotnet tool install -g pefix
pefix scan ./publish --profile publish-dir --fail-on-issue
Or as a GitHub Action (pulls the native binary, no SDK):
- uses: FeathBow/pefix@v1.0.2
with:
path: ./publish
profile: publish-dir
fail-on-issue: true
A passing scan means no static issue was found, not that load will succeed at runtime. It catches what's provable and stays quiet otherwise.
MIT, single Native-AOT binary.
Repo: https://github.com/FeathBow/pefix
NuGet: https://www.nuget.org/packages/pefix
For further actions, you may consider blocking this person and/or reporting abuse
