<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Salt Sato</title>
    <description>The latest articles on DEV Community by Salt Sato (@feathbow).</description>
    <link>https://dev.to/feathbow</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3989853%2F5385c74e-6539-463e-ac2d-4fd5ab68d5c8.png</url>
      <title>DEV Community: Salt Sato</title>
      <link>https://dev.to/feathbow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/feathbow"/>
    <language>en</language>
    <item>
      <title>A DLL wouldn't load on my Mac, so I built pefix</title>
      <dc:creator>Salt Sato</dc:creator>
      <pubDate>Wed, 17 Jun 2026 22:45:57 +0000</pubDate>
      <link>https://dev.to/feathbow/a-dll-wouldnt-load-on-my-mac-so-i-built-pefix-33g1</link>
      <guid>https://dev.to/feathbow/a-dll-wouldnt-load-on-my-mac-so-i-built-pefix-33g1</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I opened the PE header, flipped the bits that pin it to a platform back to AnyCPU, and it loaded. That became &lt;code&gt;pefix fix&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;So pefix grew into a static loadability preflight over a whole folder. It reads each assembly's metadata (no &lt;code&gt;Assembly.Load&lt;/code&gt;) 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.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; pefix
pefix scan ./publish &lt;span class="nt"&gt;--profile&lt;/span&gt; publish-dir &lt;span class="nt"&gt;--fail-on-issue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or as a GitHub Action (pulls the native binary, no SDK):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;FeathBow/pefix@v1.0.2&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./publish&lt;/span&gt;
    &lt;span class="na"&gt;profile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;publish-dir&lt;/span&gt;
    &lt;span class="na"&gt;fail-on-issue&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;MIT, single Native-AOT binary.&lt;br&gt;
Repo: &lt;a href="https://github.com/FeathBow/pefix" rel="noopener noreferrer"&gt;https://github.com/FeathBow/pefix&lt;/a&gt;&lt;br&gt;
NuGet: &lt;a href="https://www.nuget.org/packages/pefix" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/pefix&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>dotnet</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
