Skip to content
DKorablin edited this page Jan 2, 2024 · 2 revisions

PEReader assembly was created to read data from PE/PE+ and COFF images. Also you can read C++ .obj files because they have similar structure. And it can read all CLI (COM+) directory with all MetaData tables and other streams.

Also it has few separate loaders for PE files. From file system, from memory by HMODULE handle (Win32 API LoadLibrary function) or some specific debugging modules.

Primary goal was to create assembly for WinForms application PE Image Info plugin. Originally its combined with help of reflection to achieve the goal of searching in other PE files.

Why do I need reference to System.Text.Encoding.CodePages assembly?

After migration from .NET Framework to .NET, Microsoft removed CP-1252 text encoding from BCL. Therefore, to work correctly with certain lines from the PE file, you need to add a link to the assembly and add encoding registration in the provider:

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

Otherwise there will be an error: No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method