I have a need to work with Windows executables which are made for x86, x64, and IA64. I'd like to programmatically figure out the platform by examining the files themselves.
My target language is PowerShell but a C# example will do. Failing either of those, if you know the logic required that would be great.
If you have Visual Studio installed you can use dumpbin.exe
. There's also the Get-PEHeader
cmdlet in the PowerShell Community Extensions that can be used to test for executable images.
Dumpbin will report DLLs as machine (x86)
or machine (x64)
Get-PEHeader will report DLLs as either PE32
or PE32+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With