Function at 0x502160
Capabilities:
Log keystrokes via polling

Disassembly:
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0xe8c]
xor ebx, ebx
cmp eax, ebx
push edi
je 0x5024fa
cmp dword [0x6f3558], 3
mov edi, dword [0x21ebef8]
jne 0x5023b8
mov eax, dword [edi + 0x404]
mov ecx, dword [edi + 0x408]
shl eax, 8
mov al, byte [eax + edi + 6]
shl ecx, 8
cmp al, byte [ecx + edi + 6]
je 0x5021c8
test al, al
js 0x5021c8
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5021b2
sub eax, edx
mov byte [eax + esi + 0xec2], 0x31
jmp 0x5023b2
push 3
mov ecx, edi
call fcn.00438180
test al, al
je 0x5021f6
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5021e0
sub eax, edx
mov byte [eax + esi + 0xec2], 0x32
jmp 0x5023b2
push 4
mov ecx, edi
call fcn.00438180
test al, al
je 0x502226
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502210
sub eax, edx
mov byte [eax + esi + 0xec2], 0x33
jmp 0x5023b2
push 5
mov ecx, edi
call fcn.00438180
test al, al
je 0x502256
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502240
sub eax, edx
mov byte [eax + esi + 0xec2], 0x34
jmp 0x5023b2
push 6
mov ecx, edi
call fcn.00438180
test al, al
je 0x502286
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502270
sub eax, edx
mov byte [eax + esi + 0xec2], 0x35
jmp 0x5023b2
push 7
mov ecx, edi
call fcn.00438180
test al, al
je 0x5022b6
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5022a0
sub eax, edx
mov byte [eax + esi + 0xec2], 0x36
jmp 0x5023b2
push 8
mov ecx, edi
call fcn.00438180
test al, al
je 0x5022e6
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5022d0
sub eax, edx
mov byte [eax + esi + 0xec2], 0x37
jmp 0x5023b2
push 9
mov ecx, edi
call fcn.00438180
test al, al
je 0x502316
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502300
sub eax, edx
mov byte [eax + esi + 0xec2], 0x38
jmp 0x5023b2
push 0xa
mov ecx, edi
call fcn.00438180
test al, al
je 0x502346
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502330
sub eax, edx
mov byte [eax + esi + 0xec2], 0x39
jmp 0x5023b2
push 0xb
mov ecx, edi
call fcn.00438180
test al, al
je 0x502373
lea eax, [esi + 0xec2]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x502360
sub eax, edx
mov byte [eax + esi + 0xec2], 0x30
jmp 0x5023b2
push 0xe
mov ecx, edi
call fcn.00438180
test al, al
je 0x5023b8
lea eax, [esi + 0xec2]
mov ecx, eax
lea ebp, [ecx + 1]
jmp 0x502390
mov dl, byte [ecx]
inc ecx
cmp dl, bl
jne 0x502390
sub ecx, ebp
mov dword [esp + 0x14], ecx
je 0x5023b8
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5023a2
sub eax, edx
mov byte [eax + esi + 0xec1], bl
mov edi, dword [0x21ebef8]
mov eax, dword [0x21ebf00]
mov ebp, 1
cmp eax, ebp
jne 0x50247b
cmp dword [0x21ebf04], ebx
jne 0x50247b
mov eax, dword [esi + 0xef4]
mov ecx, dword [0x706454]
lea edx, [eax + 0x19]
cmp ecx, edx
jl 0x50245e
add eax, 0x88
cmp ecx, eax
jg 0x50245e
mov eax, dword [esi + 0xef8]
mov ecx, dword [0x706458]
lea edx, [eax + 0x23]
cmp ecx, edx
jl 0x50245e
add eax, 0x32
cmp ecx, eax
jg 0x50245e
push ebp
mov ecx, 0x21ec34c
call fcn.00521a50
mov ecx, 0x21ec34c
call fcn.00523c40
cmp dword [0x6f3558], 3
jne 0x502443
mov ecx, 0xc
xor eax, eax
lea edi, [esi + 0xec2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [esi + 0xe8c], ebp
pop edi
pop esi
mov dword [0x703c18], ebp
pop ebp
mov dword [0x84efa8], ebx
xor eax, eax
pop ebx
ret 4
mov dword [esi + 0xe8c], ebx
push ebx
mov ecx, 0x21ec34c
mov dword [0x703c18], ebx
call fcn.00521a50
mov edi, dword [0x21ebef8]
cmp dword [esi + 0xe8c], ebx
je 0x5024a3
mov eax, dword [edi + 0x404]
mov ecx, dword [edi + 0x408]
shl eax, 8
mov al, byte [eax + edi + 0x20]
shl ecx, 8
cmp al, byte [ecx + edi + 0x20]
je 0x5024f1
test al, al
jns 0x5024f1
push 0xd
call dword [sym.imp.user32.dll_GetAsyncKeyState]
mov ecx, 0x21ec34c
call fcn.00523c40
cmp dword [0x6f3558], 3
jne 0x5024da
lea eax, [esi + 0xec2]
lea edx, [esi + 0xe90]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
cmp cl, bl
jne 0x5024d0
mov dword [esi + 0xe8c], ebx
push ebx
mov ecx, 0x21ec34c
mov dword [0x703c18], ebx
call fcn.00521a50
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret 4
mov eax, dword [0x21ebf00]
mov ebp, 1
cmp eax, ebp
jne 0x50254a
cmp dword [0x21ebf04], ebx
jne 0x50254a
mov eax, dword [esi + 0xef4]
mov ecx, dword [0x706454]
lea edx, [eax + 0x19]
cmp ecx, edx
jl 0x50254a
add eax, 0x88
cmp ecx, eax
jg 0x50254a
mov eax, dword [esi + 0xef8]
mov ecx, dword [0x706458]
lea edx, [eax + 0x23]
cmp ecx, edx
jl 0x50254a
add eax, 0x32
cmp ecx, eax
jle 0x502414
mov eax, dword [esi + 0xef8]
mov ecx, dword [esi + 0xef4]
push eax
push ecx
lea ecx, [esi + 0x4e4]
call fcn.00516c20
test eax, eax
je 0x5025b3
cmp dword [0x6f3558], 3
jne 0x50258a
lea eax, [esi + 0xec2]
lea edx, [esi + 0xe90]
sub edx, eax
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
cmp cl, bl
jne 0x502580
lea edi, [esi + 0xe90]
push edi
call fcn.005b8a6f
add esp, 4
cmp edx, ebx
jl 0x5025d9
jg 0x5025a4
cmp eax, 0xffffffff
jbe 0x5025d9
push 0x1d4
push 0x11
call fcn.0041d9a0
add esp, 8
mov eax, dword [esi + 0xef8]
mov ecx, dword [esi + 0xef4]
push eax
push ecx
lea ecx, [esi + 0x9b8]
call fcn.00516c20
test eax, eax
je 0x5025f4
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
ret 4
push edi
call fcn.005b89e2
mov edx, dword [esp + 0x18]
add esp, 4
pop edi
pop esi
pop ebp
mov dword [edx], eax
mov eax, 2
pop ebx
ret 4
mov edx, dword [esi + 0xef8]
mov eax, dword [esi + 0xef4]
push edx
push eax
lea ecx, [esi + 0x10]
call fcn.00516c20
pop edi
neg eax
pop esi
sbb eax, eax
pop ebp
neg eax
pop ebx
ret 4