You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DirectWriteForwarder.dll is an assembly of WPF(.NET Core 6). When I load and write the assembly, the application crashed and "BadImageFormatException: No string associated with token." occured .
Create a WPF application using .NET Core 6.
publish the application with 'self-contained'.
Run the following code to edit the file of DirectWriteForwarder.dll in the published directory:
string filename = @"E:\temp\publish\DirectWriteForwarder.dll";
using MemoryStream ms = new MemoryStream();
using (var mod = ModuleDefMD.Load(filename))
{
if(mod.IsILOnly)
{
mod.Write(ms);
}
else
{
mod.NativeWrite(ms);
}
}
ms.Position = 0;
File.WriteAllBytes(filename, ms.ToArray());
Try to launch the WPF executable file, and it cannot starts properly.
Check Windows Event Viewer, the following log can been seen.
Thanks.
The text was updated successfully, but these errors were encountered:
DirectWriteForwarder.dll is an assembly of WPF(.NET Core 6). When I load and write the assembly, the application crashed and "BadImageFormatException: No string associated with token." occured .
Thanks.
The text was updated successfully, but these errors were encountered: