Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically determine if native .exe is 32-bit or 64-bit

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

like image 497
JSBձոգչ Avatar asked Nov 03 '10 17:11

JSBձոգչ


2 Answers

If you really only want to do this for EXEs and not DLLs, just use GetBinaryType.

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

like image 129
Steve Townsend Avatar answered Oct 07 '22 16:10

Steve Townsend


This post will surely help you.

Is C# related but it will give you the idea.

like image 34
Liviu Mandras Avatar answered Oct 07 '22 18:10

Liviu Mandras