Recently I decided to master fasm for windows x32 (I wrote it under MSDOS before). Trying to figure out the WinAPI ReadConsoleA function. Input asks, but writes nothing to the buffer.
format PE console entry start include 'win32ax.inc' section '.text' code readable executable start: invoke AllocConsole invoke GetStdHandle, STD_OUTPUT_HANDLE mov [stdout], eax invoke GetStdHandle, STD_INPUT_HANDLE mov [stdin], eax invoke ReadConsole, [stdin], input, 8, 0, 0 invoke WriteConsole, [stdout], input, in_len, 0, 0 invoke SleepProcess, 2000 invoke ExitProcess, 0 section '.data' data readable writable stdout dd ? stdin dd ? input db 8 dup (?), 0 in_len dd ? section '.idata' import data readable writable library kernel32, 'kernel32.dll' import kernel32, \ AllocConsole, 'AllocConsole', \ GetStdHandle, 'GetStdHandle', \ SleepProcess, 'Sleep', \ ExitProcess, 'ExitProcess', \ WriteConsole, 'WriteConsoleA', \ ReadConsole, 'ReadConsoleA' 