We help IT Professionals succeed at work.

Identify .Exe is 32 bit or 64 bit

ramesh_hyd_ap
on
785 Views
Last Modified: 2013-11-20
Hi,
     
      Any API or function which would say that a .exe file is either 64bit or 32 bit.
      I don't want to load the .exe in to the memory and then find out 32 or 64 bit.

Thanks in Advance,
Ramesh.
Comment
Watch Question

R & D Engineering Manager
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi,
     I think there should be a more better approach because if in the future if Microsoft changes these strings, my validation will fail.

Thanks,
Ramesh.

Commented:
maybe this works:

check "magic" field in the PE header, and if its value is 0x020b, the file is a 64bit executable.

Author

Commented:
Hi karfi,
 
I don't much about PE header, can u please be more detail.

Thanks,
Ramesh.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.