flat assembler
Message board for the users of flat assembler.

Index > Windows > GetFileVersionInfoSize crashing?

Author
Thread Post new topic Reply to topic
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
Please help.. what am I doing wrong here?

Code:
format PE GUI 4.0
include 'J:\fasmw16727\INCLUDE\win32ax.inc'
library version,'VERSION.DLL'
import version,GetFileVersionInfoSize,'GetFileVersionInfoSizeA'
section '.text' code readable executable
text:
invoke GetFileVersionInfoSize,somedll,thingy
invoke ExitProcess,0
section '.data' data readable writeable
somedll db "kernel32.dll",0
thingy dd ?
.end text    


I found many examples on Google of how to use this function, but no matter what I do it crashes.. and I can't just directly copy and paste anything I find because it's not FASM syntax..

Sad


P.S. why did I have to manually do the library and import thing for it even though I included win32ax.inc?
Post 31 Dec 2008, 23:51
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17669
Location: In your JS exploiting you and your system
revolution
The fasm package does not come with the version library equates and imports. You should probably consider building your own .idata section and not use the win32ax include.
Post 01 Jan 2009, 00:35
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3045
Location: vpcmipstrm
bitRAKE
Code:
format PE GUI 4.0

include 'Win32ax.inc'

section '.text' code readable executable

        entry $
     invoke GetFileVersionInfoSize,somedll,thingy
        retn

section '.data' data readable writeable

   thingy  dd ?
        somedll db "kernel32.dll",0

data import
    library VERSION,'VERSION.DLL'

 import  VERSION,\
          GetFileVersionInfoSize,'GetFileVersionInfoSizeA'
end data    
There are tools on the board to build the import section automatically.
Post 01 Jan 2009, 00:36
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
Thanks guys! Very Happy
Post 01 Jan 2009, 00:40
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.