Function at 0x509b50
Capabilities:
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffee8
push ebx
push esi
push edi
mov ebx, edx
mov esi, eax
test byte [esi + 0x1c], 0x10
je 0x509b9e
xor edx, edx
mov eax, esi
call fcn.0059760c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x509b9e
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x2e0], 0
je 0x509b9e
mov ecx, ebx
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x2e0]
mov edx, esi
mov edi, dword [eax]
call dword [edi + 0x28]
test al, al
jne 0x509e10
mov eax, dword [ebx]
cmp eax, 0x100
jb 0x509be0
cmp eax, 0x109
ja 0x509be0
mov dl, 1
mov eax, esi
call fcn.0059760c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x509e07
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
mov edi, dword [eax]
call dword [edi + 0x13c]
test al, al
jne 0x509e10
jmp 0x509e07
mov eax, dword [ebx]
cmp eax, 0x200
jb 0x509df0
cmp eax, 0x20e
ja 0x509df0
test byte [esi + 0x60], 0x80
jne 0x509c12
sub eax, 0x203
je 0x509c0f
sub eax, 3
je 0x509c0f
sub eax, 3
jne 0x509c12
sub dword [ebx], 2
mov eax, dword [ebx]
add eax, 0xfffffe00
cmp eax, 7
ja case.0x509c22.516
jmp dword [eax*4 + 0x509c29]
mov ecx, ebx
mov eax, dword [0x68aaec]
mov eax, dword [eax]
mov edx, esi
call fcn.005a42d8
jmp 0x509e07
test byte [esi + 0x62], 8
je 0x509e07
mov eax, dword [0x509e18]
and eax, dword [esi + 0x64]
mov edx, dword [0x509e1c]
cmp edx, eax
jne 0x509e07
mov eax, dword [0x6905a4]
call fcn.005177c4
test al, al
jne 0x509e07
mov eax, dword [0x6905a4]
call fcn.00517734
mov byte [ebp - 0x15], 0
mov eax, dword [0x6905a4]
mov edi, dword [eax + 0x28]
test edi, edi
je 0x509d27
mov eax, esi
mov edx, dword [0x500730]
call fcn.00407dfc
test al, al
je 0x509cd5
mov eax, esi
call fcn.005114d0
mov edx, eax
mov eax, edi
mov ecx, esi
mov edi, dword [eax]
call dword [edi + 0x10c]
mov byte [ebp - 0x15], al
jmp 0x509d27
cmp dword [esi + 0x40], 0
je 0x509cf6
mov eax, dword [esi + 0x40]
call fcn.005114d0
mov edx, eax
mov eax, edi
mov ecx, esi
mov edi, dword [eax]
call dword [edi + 0x10c]
mov byte [ebp - 0x15], al
jmp 0x509d27
xor edx, edx
mov eax, esi
call fcn.0059760c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x509d27
mov eax, dword [ebp - 0x14]
call fcn.005114d0
mov edx, eax
mov eax, dword [0x6905a4]
mov eax, dword [eax + 0x28]
mov ecx, esi
mov edi, dword [eax]
call dword [edi + 0x10c]
mov byte [ebp - 0x15], al
cmp byte [ebp - 0x15], 0
je 0x509d45
mov dword [ebx + 0xc], 1
mov eax, dword [0x68aaec]
mov eax, dword [eax]
call fcn.005a4440
jmp 0x509e07
mov eax, dword [0x6905a4]
cmp dword [eax + 0x28], 0
je 0x509e07
xor edx, edx
mov eax, dword [0x6905a4]
call fcn.00517898
jmp 0x509e07
cmp byte [esi + 0x6f], 1
jne 0x509d7b
mov eax, esi
mov si, 0xffed
call fcn.00407e80
jmp 0x509e10
or dword [esi + 0x64], 1
jmp 0x509e07
and dword [esi + 0x64], 0xfffffffe
jmp 0x509e07
mov eax, dword [0x6905a4]
cmp byte [eax + 0x20], 0
je 0x509e07
mov eax, dword [0x6905a4]
cmp dword [eax + 0x1c], 0
je 0x509e07
mov eax, dword [ebx]
mov edx, dword [0x6905a4]
cmp eax, dword [edx + 0x1c]
jne 0x509e07
lea eax, [ebp - 0x115]
push eax
call sub.user32.dll_GetKeyboardState
mov eax, dword [ebx]
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x115]
call fcn.00597508
mov word [ebp - 0xc], ax
movzx eax, word [ebx + 4]
mov word [ebp - 0xa], ax
mov eax, dword [ebx + 8]
call fcn.0040f29c
mov dword [ebp - 8], eax
lea edx, [ebp - 0x10]
mov eax, esi
mov si, 0xffc8
call fcn.00407e80
jmp 0x509e10
cmp eax, 0xb00b
jne 0x509e07
mov edx, dword [ebx + 8]
push edx
mov ecx, dword [ebx + 4]
mov edx, eax
mov eax, esi
call fcn.005081d0
mov edx, ebx
mov eax, esi
mov ecx, dword [eax]
call dword [ecx - 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret