Programmatically determine if a native .exe is 32-bit or 64-bit

I need to know if a given .exe is 32-bit or 64-bit before starting it. IsWow64Process is useless here, since there is no process yet. Is there any other API that will give me this information?

+6
c ++ windows 32bit-64bit wow64
source share
3 answers

If you really want to do this only for the EXE and not for the DLL, just use GetBinaryType .

Determines whether the file is an executable file (.exe), and if so, which subsystem launches the executable file.

+11
source share

This post will help you.

Is C # related, but it will give you this idea.

+5
source share

This information is available in one of the PE File file format headers (the format used for exe and dll). The information in these headers can either be retrieved programmatically (they have a given offset) or more securely requested through the Win32 API.

Ok, Liviu got the right signpost for you.

+1
source share

All Articles