Jump to content
Sign in to follow this  
madasraka

64 or 32 ?

Recommended Posts

madasraka

I have a file in @scriptdir

File is 64bit executable (will not work on 32bit OS)

Is there a way for autoit to tell if this executable 64 or 32bit ?

By the way

Attached script returning all possible file properties is no help.

Get file property number.au3

Edited by madasraka

Share this post


Link to post
Share on other sites
Ascend4nt

Check this post where KaFu uses GetBinaryType

Share this post


Link to post
Share on other sites
trancexx

Of course.

Keyword is IMAGE_OPTIONAL_HEADER structure. Yo can do it manually or thru ImageNtHeader function (in that case IMAGE_NT_HEADERS structure plays, but that's just three different structures joined together IMAGE_NT_SIGNATURE+IMAGE_FILE_HEADER+IMAGE_OPTIONAL_HEADER).

edit:

But making it simple as the above post kills all the fun.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
madasraka

Oh cool

Thanks guys !

I now have to change few codes because if this discovery.

:mellow::P:party:

Share this post


Link to post
Share on other sites
madasraka

Ok i looked both at your links and search advices and found

Based on my level of autoit (programing) knowledge i could not put any of those two together.

1 of found examples involved executing an executable=BAD IDEA

Anoter example provided function involving DLL (i learned DLL files return different values in different OS 32 and 64 bit so this is no use too)

As for keyword "IMAGE_OPTIONAL_HEADER" ?

Well i git lost even more now :mellow:

Maybe there is a simpler way to lets say:

Hex Read the file and finding traces of 64bit code ?

Then if that matches then $Var = "X64" ?

I dont know guys this seems way to complicated for me at this point.

Previously i would just rely on:

$var = '32'

If fileexist ('filename64.exe') = 1 Then assign ('var','64')

but this is to eazy and that file is not 100% guarantied to be there.

Share this post


Link to post
Share on other sites
trancexx

What possible thing could distract you? You were linked to the easiest possible solution.

What are you talking about? What links were you following? :mellow:


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
madasraka

http://www.autoitscript.com/forum/index.php?showtopic=114516&view=findpost&p=800855

Then i searched for IMAGE_OPTIONAL_HEADER

Share this post


Link to post
Share on other sites
madasraka

Sorry i wasn't sure how to use it :mellow:

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×