flat assembler
Message board for the users of flat assembler.
Index
> Windows > Getting key presses in windows & x64 debugging options |
Author |
|
Tomasz Grysztar 11 Jul 2018, 15:36
nullbyte wrote: Sorry for what is probably a moronic n00b question, but I'm having trouble with windows character input. I'd like to register key presses, but the following doesnt work. Do I need to use the Microsoft API instead (as w/ WriteConsole?) nullbyte wrote: Second, what debuggers do you use in 64 bit Windows land? My favorites (OllyDbg/Immunity) seem to only support 32 bit PEs. |
|||
11 Jul 2018, 15:36 |
|
nullbyte 12 Jul 2018, 10:30
Thank you Tomasz! I'll check out FDBG.
In case anyone is wondering the same thing: Seems like for console this works: ReadConsoleInput(): https://docs.microsoft.com/en-us/windows/console/readconsoleinput This Stackoverflow provides an example https://stackoverflow.com/questions/15993882/detecting-key-events and w/ a bit of modification Code: .while invoke ReadConsoleInput, [inhandle], input, 1, count ; read input cmp [input.event.VirtScanCode], 51h ; check if our scan code is Q je .exit ; if it is jump invoke WriteConsole,[outhandle],input.event.char,1,numwritten,0 ; print character .endw .exit: invoke WriteConsole,[outhandle],"You pressed Q",14,numwritten,0 invoke Sleep, 1000 invoke ExitProcess, 0 For a window, this seems like the way to go: https://docs.microsoft.com/en-us/windows/desktop/inputdev/wm-keydown |
|||
12 Jul 2018, 10:30 |
|
revolution 12 Jul 2018, 10:34
You can also encode the characters directly:
Code: cmp [input.event.VirtScanCode], 'Q' ;<--- use the Q character in the code for better readability. |
|||
12 Jul 2018, 10:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.