flat assembler
Message board for the users of flat assembler.
Index
> Windows > My program crashes |
Author |
|
system error 15 Apr 2016, 06:15
If u dont know whats your problem is, then let me show you the exit door.
|
|||
15 Apr 2016, 06:15 |
|
Hydrogen 15 Apr 2016, 06:30
system error wrote: If u dont know whats your problem is, then let me show you the exit door. Yikes! I know it's something simple, but I'm just not seeing it Here's my full code, but I've been debugging it to find the mistake. Code: format PE64 Console entry start include 'win64a.inc' section '.text' code readable executable start: mov eax,1 ;test invoke GetStdHandle, STD_INPUT_HANDLE mov [stdin], eax invoke GetStdHandle, STD_OUTPUT_HANDLE mov [stdout], eax invoke ReadConsole, [stdin],buff, 1024, addr count, 0 invoke WriteConsole, [stdout], addr buff, [count], addr count, 0 section '.data' data readable writeable buff rb 1024 count dd ? stdin dd ? stdout dd ? section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' include 'api\kernel32.inc' include 'api\user32.inc' |
|||
15 Apr 2016, 06:30 |
|
revolution 15 Apr 2016, 06:40
Code: invoke ExitProcess,0 |
|||
15 Apr 2016, 06:40 |
|
Hydrogen 15 Apr 2016, 06:48
revolution wrote:
thanks revolution! It works. But I guess I'm a little confused. I was using this example: Code: format PE Console entry start include 'win32ax.inc' ; section '.data' data readable writable section '.code' code readable executable proc start uses ebx local buff[1024]:BYTE local count:DWORD local stdin:DWORD local stdout:DWORD invoke GetStdHandle, STD_INPUT_HANDLE mov [stdin], eax invoke GetStdHandle, STD_OUTPUT_HANDLE mov [stdout], eax invoke ReadConsole, [stdin], addr buff, 1024, addr count, 0 invoke WriteConsole, [stdout], addr buff, [count], addr count, 0 ret endp section '.idata' import data readable library kernel32,'kernel32.dll' import kernel32,\ GetStdHandle,'GetStdHandle',\ ReadConsole,'ReadConsoleA',\ WriteConsole,'WriteConsoleA' from a previous post from here: http://board.flatassembler.net/topic.php?t=11964&view=next and I only adapted it to win64. It doesn't invoke Exitprocess, which is why I didn't use it. Can you explain why my code needs it but his does not? thanks again for your help |
|||
15 Apr 2016, 06:48 |
|
system error 15 Apr 2016, 06:53
Good, but before you listen to the lady above me, Read it again so you can save yourself from the agony of your next problem. Welcome to the dark world full of extremely suicidal people.
|
|||
15 Apr 2016, 06:53 |
|
revolution 15 Apr 2016, 07:05
Hydrogen wrote: from a previous post from here: http://board.flatassembler.net/topic.php?t=11964&view=next and I only adapted it to win64. It doesn't invoke Exitprocess, which is why I didn't use it. |
|||
15 Apr 2016, 07:05 |
|
system error 15 Apr 2016, 07:41
HAHA. I think your problem isn't with ret or invokeProcess. It's just that you can't hold the console window to see the output right? The prog exits abruptly? You're one of us now, so don't be shy. We been there too!
|
|||
15 Apr 2016, 07:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.