Win32 API to tell whether a given binary (EXE or DLL) is x86, x64, or ia64

后端 未结 3 796
花落未央
花落未央 2020-12-17 01:31

I am trying to find a programmatic way to tell if a binary is x86, x64, or ia64.

Platform: Windows. Language: c/c++.

Background: Before trying to load a thir

3条回答
  •  醉梦人生
    2020-12-17 02:19

    You can check the PE header yourself to read the IMAGE_FILE_MACHINE field. Here's a C# implementation that shouldn't be too hard to adapt to C++.

提交回复
热议问题