pinvoke
pinvoke copied to clipboard
IMAGE_OPTIONAL_HEADER incorrect
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?