flat assembler
Message board for the users of flat assembler.

Index > Windows > Error in fasm?

Author
Thread Post new topic Reply to topic
Postal



Joined: 28 May 2006
Posts: 12
Location: Russia
Postal 06 Jun 2006, 10:54
In MASM after this Win procedure:
invoke wsprintf a,b,c

=====================================
add esp, x ; x = number of parameters * 4bytes
; x = 0Ch
=====================================

if use "call wsprintf" then "add esp, x" is not ADDED!!

In fasm "add esp, x" is not added in any case!!

Please check this!!!
Post 06 Jun 2006, 10:54
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM 06 Jun 2006, 11:13
You use, 'cinvoke wsprintf,a,b,c'
This is because wsprintf uses the C calling convention instead of the STDCALL calling convention.
(P.S. This question has been asked about 4+ times now. Oh well.)
Post 06 Jun 2006, 11:13
View user's profile Send private message Reply with quote
Postal



Joined: 28 May 2006
Posts: 12
Location: Russia
Postal 06 Jun 2006, 12:12
So, where I can get the list about of usage all windows-procedures? (invoke or cinvoke)?
Post 06 Jun 2006, 12:12
View user's profile Send private message Reply with quote
white_wight



Joined: 03 Feb 2006
Posts: 24
white_wight 06 Jun 2006, 12:30
Just look at 'include\macro\proc32.inc', and at http://flatassembler.net/docs.php?article=win32
Post 06 Jun 2006, 12:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 06 Jun 2006, 14:41
Quote:
So, where I can get the list about of usage all windows-procedures? (invoke or cinvoke)?
wsprintf is the only Win32 function that uses C calling convention. Check the FASM main page for documentation and download the windows help files. The "Win32 Programmer's Reference" has all the gory details about input/output arguments, structures, etc.
Post 06 Jun 2006, 14:41
View user's profile Send private message Visit poster's website Reply with quote
Postal



Joined: 28 May 2006
Posts: 12
Location: Russia
Postal 06 Jun 2006, 17:10
I assumed, that "invoke" should know as to process any function.
It is strange, as it is made in MASM.



Thanks.
Post 06 Jun 2006, 17:10
View user's profile Send private message Reply with quote
Quantum



Joined: 24 Jun 2005
Posts: 122
Quantum 06 Jun 2006, 18:16
invoke in masm32 doesn't correcly fix unaligned (8-bit or 16-bit) parameters before pushing them into the stack. That's one of the many reasons I hate macros and never use 'em in my code.
Post 06 Jun 2006, 18:16
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.