flat assembler
Message board for the users of flat assembler.
Index
> Windows > Why the return value of Api-Function doesnt work? |
Author |
|
LocoDelAssembly 22 Nov 2006, 15:43
Because you didn't define it
add a "v_test dd ?" at .data section [edit] BTW, MessageBox doesn't return a pointer to a string so I think that your second call to MessageBox will not work (unless I'm missing something)[/edit] |
|||
22 Nov 2006, 15:43 |
|
ronnie 22 Nov 2006, 16:47
yes , thats the point now : which api-function can convert numbers to strings?
|
|||
22 Nov 2006, 16:47 |
|
vid 22 Nov 2006, 17:46
wsprintf
|
|||
22 Nov 2006, 17:46 |
|
LocoDelAssembly 22 Nov 2006, 17:47
Code: push [v_test] push fmt push buffer call [wsprintf] add esp, 12 ; Because wsprintf uses cdecl calling convention . . . fmt db "%d" buffer rb 12 (The last part should go in data section) Not tested but the point is you can use wsprintf (or doing you own IntToStr) |
|||
22 Nov 2006, 17:47 |
|
ronnie 22 Nov 2006, 22:07
extrn '__imp__ExitProcess@4' as ExitProcess:dword
for ExitProcess and for wsprintf ?? |
|||
22 Nov 2006, 22:07 |
|
LocoDelAssembly 23 Nov 2006, 02:21
I never use COFF format so I don't know, try with just '__imp__wsprintf' or '__imp__wsprintf@' or '__imp__wsprintf@8', I think that one of these should work
|
|||
23 Nov 2006, 02:21 |
|
vid 23 Nov 2006, 03:30
just look into appropriate .lib file. It should be kernel32.lib or user32.lib, my quess
|
|||
23 Nov 2006, 03:30 |
|
madmatt 23 Nov 2006, 06:32
ronnie: you can import the crtdll.dll just like the kernel32.dll, which contain the various printf functions that you need to print integers and floats
|
|||
23 Nov 2006, 06:32 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.