dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMAGE_OPTIONAL_HEADER incorrect

DysfunctionaI opened this issue · comments

IMAGE_OPTIONAL_HEADER

The layout difference between 32 and 64 bit images can't be fixed with UIntPtr. 64bit images don't have the BaseOfData field, and possibly other things that make the "sequential" layout invalid.

https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-image-only
(see the table: Offset/Size/Header part/Description)

Thank you for the report. Have you tried https://www.nuget.org/packages/microsoft.windows.cswin32 to see if it suits your needs?