flat assembler
Message board for the users of flat assembler.
Index
> Main > The right way to declare two dimensional array :/ |
Author |
|
revolution 11 Jul 2016, 09:02
Show your code.
|
|||
11 Jul 2016, 09:02 |
|
Szustarol 11 Jul 2016, 09:21
Code: format PE console entry start include 'include/win32a.inc' section '.text' code executable start: stlp: push 200 call [Sleep] add esp, 0x04 call CHECKFORCHAR push EAX push intbuff call [printf] add esp, 0x08 push space push strbuff call [printf] add esp, 0x08 jmp stlp koniec: push 0 call [ExitProcess] CHECKFORCHAR: push ebp call [_kbhit] cmp EAX, 0 je nopress call [_getch] cmp EAX, 0xE0 jne nopress call [_getch] nopress: pop ebp ret FILLAREA: push ebp mov ebx, areatodraw[0x50] mov ebx, 0x8A pop ebp ret section '.data' data readable writeable intbuff db '%d', 0 strbuff db '%s', 0 space db ' ', 0 areatodraw db 25 dup(80 dup(0x00)) section '.idata' data readable import library kernel32, 'kernel32.dll', msvcrt, 'msvcrt.dll' import kernel32, ExitProcess, 'ExitProcess', Sleep, 'Sleep', GetModuleHandle,'GetModuleHandleA' import msvcrt, scanf, 'scanf', printf, 'printf', _kbhit, '_kbhit', _getch, '_getch' i get the "Extra characters on line" error when array element is moved to ebx Also another question does the windows Sleep function remove its parameter from stack automatically? I noticed if i add 0x04 to esp after calling sleep after some time program crashes when it reaches bottom of the stack, when i dont do this program runs just fine |
|||
11 Jul 2016, 09:21 |
|
revolution 11 Jul 2016, 10:27
"areatodraw" is just a pointer. You can access bytes by simple addition:
Code: mov ebx, areatodraw + 0x50 ;offset 0x50 bytes Szustarol wrote: Also another question does the windows Sleep function remove its parameter from stack automatically? I noticed if i add 0x04 to esp after calling sleep after some time program crashes when it reaches bottom of the stack, when i dont do this program runs just fine |
|||
11 Jul 2016, 10:27 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.