flat assembler
Message board for the users of flat assembler.
Index
> Windows > Local Buffer in Stack Memory |
| Author |
|
|
revolution 19 Oct 2025, 08:57
Core i7 wrote: I tried "local buff[32]:BYTE" as suggested in the help file, but it doesn't work, and fasm throws an error Have the included files used been modified from the reference files? Please show a a minimal sample showing all the "include"s referenced. |
|||
|
|
Core i7 19 Oct 2025, 09:05
Here is the code and the error:
Last edited by Core i7 on 21 Oct 2025, 02:45; edited 1 time in total |
||||||||||
|
||||||||||
|
revolution 19 Oct 2025, 09:12
Here is a minimal example that works with fasm 1.73.31
Code: format PE console include 'win32ax.inc' .code a_proc dd ? proc begin local buff[1024]:BYTE cinvoke a_proc,addr buff ret endp .end begin |
|||
|
|
Core i7 19 Oct 2025, 09:36
revolution, this design works,
but the buffer is allocated not on the stack (where the return address I need is located), but in the first section 0x00401000.
|
||||||||||
|
||||||||||
|
revolution 19 Oct 2025, 09:55
The example I posted allocated in the stack.
Code: 00000208 55 push ebp 00000209 89E5 mov ebp,esp 0000020B 81EC00040000 sub esp,0x400 00000211 8D9500FCFFFF lea edx,[ebp-0x400] ; <--- it's on the stack 00000217 52 push edx 00000218 FF1500104000 call [dword 0x401000] 0000021E 83C404 add esp,byte +0x4 00000221 C9 leave 00000222 C3 ret |
|||
|
|
Core i7 19 Oct 2025, 10:28
revolution sorry, your example works fine - thank you very much!
|
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.