I am most likely making a very stupid mistake, but if you could point it out, I would greatly appreciate it.
I am moving the HANDLE to output and HANDLE to input into two different variables. When i use those variables as the handle parameter to ReadConsole and WriteConsole, it doesn't work. Here is my code:
Code:
.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
.data
hello db "Hello", 0
szbuffer db 64 dup (0), 0ah
.data?
writehandle dd ?
readhandle dd ?
.code
start:
invoke GetStdHandle, STD_INPUT_HANDLE
mov writehandle, eax
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov readhandle, eax
invoke ReadConsole, readhandle, offset szbuffer, sizeof szbuffer, ebx, NULL
invoke WriteConsole, writehandle, offset szbuffer, sizeof szbuffer, ebx, NULL
invoke MessageBox, NULL, offset szbuffer, offset hello, MB_OK
invoke ExitProcess, 0
end start
Thanks in advance.