Last active
April 11, 2021 03:49
-
-
Save febnug/d0fcab97a76a0d682aa6be3732cce448 to your computer and use it in GitHub Desktop.
x86 dirty hack to get syscall table address, https://github.com/ultral/linux-keylogger/blob/master/keylogger.c#L40-L59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; TODO: belum di test, mungkin broken (?) | |
global _start | |
section .text | |
_start: | |
mov ecx, 0xc0000082 | |
rdmsr | |
mov edx, 32 | |
mov ecx, edx | |
sal edx, cl | |
or eax, edx | |
.loop_init: | |
mov ecx, eax | |
add ecx, 500 | |
jmp .loop_body | |
.loop: | |
add eax, 1 | |
cmp ecx, eax | |
je .fail | |
.loop_body: | |
cmp byte [eax], 0xff | |
jne .loop | |
cmp byte [eax+1], 0x14 | |
jne .loop | |
cmp byte [eax+2], 0xc5 | |
jne .loop | |
.success: | |
mov ecx, 0xffffffff | |
mov eax, dword [eax+3] | |
or eax, ecx | |
ret | |
.fail: | |
xor eax, eax | |
ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment