flat assembler
Message board for the users of flat assembler.
Index
> Windows > Push offset in a DLL |
Author |
|
vid 23 Nov 2006, 18:06
local labels are defined as:
Code: label lenGot dword at [ebp-8] that means, if you try to just "push lenGot", it is as if you would write "push dword [ebp-8]". and this is not possible. you can do it this way: Code: lea eax, [lenGot] ;lea eax, [ebp-8] invoke Proc, 1, 2, eax, 3 or, FASM high-level call macros have feature that does this for you. it's pseudo-operator "addr". used like this: Code: invoke WriteFile,[fileHandle],addr entryText,[textLen],addr lenGot,0 |
|||
23 Nov 2006, 18:06 |
|
asmfan 23 Nov 2006, 20:09
i would suggest avoiding of using addr over other ways cuz it spoils edx and
Code: invoke SomeProc, [param1], edx, addr local1 will compile correctly but behave WRONG. _________________ Any offers? |
|||
23 Nov 2006, 20:09 |
|
DustWolf 23 Nov 2006, 20:22
vid wrote:
This still generates the same error. The long version is fine tho. |
|||
23 Nov 2006, 20:22 |
|
asmfan 23 Nov 2006, 20:27
By the way, include extended inc files - *x.inc or *xp.inc instead of win32*.inc to have support of "addr"
|
|||
23 Nov 2006, 20:27 |
|
DustWolf 23 Nov 2006, 23:25
I am having some further trouble here...
For example: Code: proc Plop uses esi edi ebx,mesage mov eax,[mesage] invoke MessageBox,0,eax,0,MB_OK ret endp With imports defined and all, when used like this: Code: invoke Plop,entryText invoke ExitProcess,0 entryText db 'Works!',0 Crashes. Why? |
|||
23 Nov 2006, 23:25 |
|
LocoDelAssembly 24 Nov 2006, 00:26
because you are issuing a "call dword ptr [Plop]" due to the use of invoke instead of stdcall
|
|||
24 Nov 2006, 00:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.