Function at 0x50159c
Capabilities:
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffde0
push ebx
push esi
xor ecx, ecx
mov dword [ebp - 0x220], ecx
mov dword [ebp - 0x21c], ecx
mov dword [ebp - 0x218], ecx
mov dword [ebp - 0x210], ecx
mov dword [ebp - 0x20c], ecx
mov ebx, edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x501851
push dword fs:[eax]
mov dword fs:[eax], esp
cmp ebx, 1
jl 0x5015ff
lea edx, [ebp - 0x20c]
mov eax, dword [ebp - 4]
call fcn.00501158
mov eax, dword [ebp - 0x20c]
mov edx, ebx
call fcn.004aa060
cmp al, 1
jne 0x5015ff
dec ebx
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 4]
call fcn.0050150c
test al, al
je 0x5017b0
cmp dword [ebp - 8], 0
jge 0x50161d
xor eax, eax
mov dword [ebp - 8], eax
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.00501cf8
mov dword [ebp - 8], eax
mov ebx, dword [ebp - 8]
inc ebx
lea edx, [ebp - 0x210]
mov eax, dword [ebp - 4]
call fcn.00501158
mov eax, dword [ebp - 0x210]
mov dword [ebp - 0x214], eax
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x501658
sub eax, 4
mov eax, dword [eax]
cmp ebx, eax
jge 0x50168c
lea edx, [ebp - 0x218]
mov eax, dword [ebp - 4]
call fcn.00501158
mov eax, dword [ebp - 0x218]
movzx eax, word [eax + ebx*2 - 2]
cmp ax, 0xd800
jb 0x501681
cmp ax, 0xdfff
jbe 0x501685
xor eax, eax
jmp 0x501687
mov al, 1
test al, al
je 0x50168c
inc ebx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2a8]
cmp eax, dword [ebp - 8]
jg 0x5016a0
mov dword [ebp - 8], eax
mov ebx, dword [ebp - 8]
mov ecx, ebx
mov edx, ebx
mov eax, dword [ebp - 4]
call fcn.00501578
cmp ebx, dword [ebp - 8]
je 0x5017a2
lea eax, [ebp - 0x108]
push eax
call sub.USER32.DLL_GetKeyboardState
mov edx, 0x100
lea eax, [ebp - 0x208]
mov byte [eax], 0
inc eax
dec edx
jne 0x5016cc
mov byte [ebp - 0x1f8], 0x81
mov eax, dword [ebp - 4]
mov si, 0xffc7
call fcn.004bfa18
and eax, 0x7f
movzx eax, word [eax*2 + 0x7dfe9c]
mov byte [ebp + eax - 0x208], 0x81
lea eax, [ebp - 0x208]
push eax
call sub.USER32.DLL_SetKeyboardState
mov eax, dword [ebp - 4]
mov byte [eax + 0x2bc], 1
xor eax, eax
push ebp
push 0x50178f
push dword fs:[eax]
mov dword fs:[eax], esp
push 1
mov eax, dword [ebp - 4]
mov si, 0xffc7
call fcn.004bfa18
and eax, 0x7f
movzx eax, word [eax*2 + 0x7dfe9c]
push eax
push 0x100
mov eax, dword [ebp - 4]
call fcn.0054f634
push eax
call sub.USER32.DLL_SendMessageW
push 1
mov eax, dword [ebp - 4]
mov si, 0xffc7
call fcn.004bfa18
and eax, 0x7f
movzx eax, word [eax*2 + 0x7dfe9c]
push eax
push 0x101
mov eax, dword [ebp - 4]
call fcn.0054f634
push eax
call sub.USER32.DLL_SendMessageW
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x501796
mov eax, dword [ebp - 4]
mov byte [eax + 0x2bc], 0
ret
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 8]
mov dword [eax + 0x2b0], edx
jmp 0x501823
cmp dword [ebp - 8], 0
jge 0x5017bb
xor eax, eax
mov dword [ebp - 8], eax
lea edx, [ebp - 0x21c]
mov eax, dword [ebp - 4]
call fcn.00501158
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x214], eax
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x5017e4
sub eax, 4
mov eax, dword [eax]
cmp eax, dword [ebp - 8]
jg 0x501815
lea edx, [ebp - 0x220]
mov eax, dword [ebp - 4]
call fcn.00501158
mov eax, dword [ebp - 0x220]
mov dword [ebp - 0x214], eax
mov eax, dword [ebp - 0x214]
test eax, eax
je 0x501812
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 4]
call fcn.00501578
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x501858
lea eax, [ebp - 0x220]
mov edx, 3
call fcn.004c12c4
lea eax, [ebp - 0x210]
mov edx, 2
call fcn.004c12c4
ret