Function at 0x5227e0
Capabilities:
Log keystrokes via polling

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
mov eax, dword [esi + 0x5860]
mov ecx, dword [esi + 0x585c]
imul eax, eax, 0xf0
mov eax, dword [eax + ecx + 0xc]
xor ebx, ebx
push edi
mov edi, dword [esp + 0x2c]
cmp edi, 2
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], eax
jne 0x522886
mov edx, dword [esi + 0x72c]
imul eax, eax, 0x98
test dword [edx + eax + 0x28], 0x100
je 0x52283a
mov dword [esp + 0x10], 1
cmp dword [esi + 0x5874], ebx
je 0x52284b
push esi
call fcn.00521f60
add esp, 4
cmp dword [esi + 0x5878], ebx
je 0x52285c
push esi
call fcn.00521f90
add esp, 4
push 0x10
call dword [sym.imp.USER32.dll_GetKeyState]
mov ebp, dword [esi + 0x5864]
and eax, 0x8000
cmp ebp, 4
jl 0x5228d0
cmp ebp, 7
jg 0x5228d0
mov dword [esp + 0x14], 1
jmp 0x52294c
cmp edi, 1
jne 0x52285c
mov ecx, dword [esi + 0x3434]
imul eax, eax, 0x170
mov eax, dword [ecx + eax + 0xc4]
cmp eax, ebx
mov dword [esp + 0x20], eax
jle 0x5228c0
mov edx, dword [esi + 0x72c]
imul eax, eax, 0x98
test dword [edx + eax + 0x28], 0x100
je 0x5228c0
mov dword [esp + 0x10], edi
cmp dword [esi + 0x5870], ebx
je 0x52285c
push esi
call fcn.00521ee0
jmp 0x522859
mov ecx, 1
cmp edi, ecx
jne 0x522931
test dword [esi + 0xa15c], 0x20000
jne 0x522948
cmp eax, ebx
jne 0x522948
mov edi, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x28], ebp
xor ecx, ecx
jmp 0x522900
mov edx, 1
cmp ecx, edx
jne 0x522a3e
cmp dword [esp + 0x14], 0
je 0x522f62
test ebp, ebp
jne 0x522a08
mov dword [esi + 0x5864], 2
neg edi
jmp 0x522c43
cmp edi, 2
jne 0x5228e9
test dword [esi + 0xa15c], 0x40000
je 0x5228e9
cmp dword [esp + 0x10], ebx
jne 0x5228e9
mov dword [esp + 0x14], ecx
mov eax, dword [esi + 0x5860]
mov ecx, dword [esi + 0x585c]
imul eax, eax, 0xf0
fld qword [ecx + eax + 0xe8]
add ecx, eax
mov eax, dword [ecx + 0x54]
sub eax, dword [ecx + 0x4c]
cdq
mov edi, eax
mov eax, dword [ecx + 0x58]
sub eax, dword [ecx + 0x50]
xor edi, edx
sub edi, edx
cdq
xor eax, edx
sub eax, edx
cmp ebp, ebx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x28], eax
je 0x5229ce
cmp ebp, 1
je 0x5229ce
fldz
mov edi, dword [esp + 0x34]
fucomp st(1)
fnstsw ax
test ah, 0x44
jp 0x5229ae
mov eax, dword [esp + 0x1c]
fstp st(0)
sub eax, eax
mov ebx, eax
jmp 0x5228f1
mov edx, dword [esp + 0x28]
add edx, edi
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
fmulp st(1)
call fcn.005ac350
sub eax, dword [esp + 0x1c]
mov ebx, eax
jmp 0x5228f1
fldz
mov ebx, dword [esp + 0x30]
fucomp st(1)
fnstsw ax
test ah, 0x44
jp 0x5229ec
mov eax, dword [esp + 0x28]
fstp st(0)
sub eax, eax
mov edi, eax
jmp 0x5228f1
add edi, ebx
mov dword [esp + 0x1c], edi
fild dword [esp + 0x1c]
fdivrp st(1)
call fcn.005ac350
sub eax, dword [esp + 0x28]
mov edi, eax
jmp 0x5228f1
cmp ebp, 2
jne 0x522a1b
mov dword [esi + 0x5864], 0
neg ebx
jmp 0x522a46
cmp ebp, edx
jne 0x522a2e
mov dword [esi + 0x5864], 3
jmp 0x522cb3
cmp ebp, 3
jne 0x522a3e
mov dword [esi + 0x5864], edx
jmp 0x522b44
test ebp, ebp
jne 0x522b38
mov eax, dword [esi + 0x5860]
mov ebp, dword [esi + 0x585c]
imul eax, eax, 0xf0
add dword [eax + ebp + 0x4c], ebx
lea eax, [eax + ebp + 0x4c]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x5c], ebx
lea eax, [eax + ebp + 0x5c]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x64], ebx
cmp dword [esp + 0x10], 0
lea eax, [eax + ebp + 0x64]
je 0x522b38
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x18], ebx
lea eax, [eax + ebp + 0x18]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x1c], edi
lea eax, [eax + ebp + 0x1c]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x5864]
lea eax, [eax + ebp + 6]
mov ebp, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ebp], edi
add eax, ebp
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x68], edi
lea eax, [eax + ebp + 0x68]
cmp dword [esi + 0x5864], edx
jne 0x522c3a
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x54], ebx
lea eax, [eax + ebp + 0x54]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x5c], ebx
lea eax, [eax + ebp + 0x5c]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x64], ebx
cmp dword [esp + 0x10], 0
lea eax, [eax + ebp + 0x64]
je 0x522c3a
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x20], ebx
lea eax, [eax + ebp + 0x20]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x24], edi
lea eax, [eax + ebp + 0x24]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x5864]
lea eax, [eax + ebp + 6]
mov ebp, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ebp], edi
add eax, ebp
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x68], edi
lea eax, [eax + ebp + 0x68]
cmp dword [esi + 0x5864], 2
jne 0x522caa
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x50], edi
lea eax, [eax + ebp + 0x50]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x5864]
lea eax, [eax + ebp + 6]
mov ebp, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ebp], edi
add eax, ebp
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x68], edi
lea eax, [eax + ebp + 0x68]
cmp dword [esi + 0x5864], 3
jne 0x522d1a
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x58], edi
lea eax, [eax + ebp + 0x58]
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
mov eax, dword [esi + 0x5864]
lea eax, [eax + ebp + 6]
mov ebp, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ebp], edi
add eax, ebp
mov eax, dword [esi + 0x5860]
mov ebp, eax
shl ebp, 4
sub ebp, eax
add ebp, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl ebp, 4
add dword [eax + ebp + 0x68], edi
lea eax, [eax + ebp + 0x68]
mov ebp, dword [esi + 0x5864]
cmp ebp, 4
je 0x522d50
cmp ebp, 5
je 0x522e20
cmp ebp, 6
je 0x522e5a
cmp ebp, 7
je 0x522e97
add ecx, edx
cmp ecx, 2
jl 0x522900
jmp 0x522f62
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
sub dword [ecx + edx + 0x4c], ebx
lea eax, [ecx + edx + 0x4c]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
lea eax, [ecx + edx + 0x50]
add dword [eax], edi
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x5864]
mov ecx, eax
shl ecx, 4
sub ecx, eax
lea eax, [ecx + edx + 6]
mov ecx, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ecx], edi
add eax, ecx
mov eax, dword [esi + 0x5860]
mov edx, eax
shl edx, 4
sub edx, eax
add edx, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl edx, 4
add dword [edx + eax + 0x68], edi
lea eax, [edx + eax + 0x68]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
add ecx, dword [esi + 0x5864]
shl ecx, 4
sub dword [ecx + edx + 0x5c], ebx
lea eax, [ecx + edx + 0x5c]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
add ecx, dword [esi + 0x5864]
shl ecx, 4
sub dword [ecx + edx + 0x64], ebx
lea eax, [ecx + edx + 0x64]
jmp 0x522f62
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
add dword [ecx + edx + 0x54], ebx
lea eax, [ecx + edx + 0x54]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
lea eax, [ecx + edx + 0x50]
jmp 0x522ecf
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
sub dword [ecx + edx + 0x4c], ebx
lea eax, [ecx + edx + 0x4c]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
lea eax, [ecx + edx + 0x58]
jmp 0x522d88
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
add dword [ecx + edx + 0x54], ebx
lea eax, [ecx + edx + 0x54]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
lea eax, [ecx + edx + 0x58]
add dword [eax], edi
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x5864]
mov ecx, eax
shl ecx, 4
sub ecx, eax
lea eax, [ecx + edx + 6]
mov ecx, dword [esi + 0x585c]
shl eax, 4
add dword [eax + ecx], edi
add eax, ecx
mov eax, dword [esi + 0x5860]
mov edx, eax
shl edx, 4
sub edx, eax
add edx, dword [esi + 0x5864]
mov eax, dword [esi + 0x585c]
shl edx, 4
add dword [edx + eax + 0x68], edi
lea eax, [edx + eax + 0x68]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
add ecx, dword [esi + 0x5864]
shl ecx, 4
add dword [ecx + edx + 0x5c], ebx
lea eax, [ecx + edx + 0x5c]
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
add ecx, dword [esi + 0x5864]
shl ecx, 4
add dword [ecx + edx + 0x64], ebx
lea eax, [ecx + edx + 0x64]
cmp dword [esp + 0x10], 0
mov eax, dword [esp + 0x28]
mov edi, dword [sym.imp.KERNEL32.dll_MulDiv]
mov dword [esi + 0x5864], eax
jne 0x522ff6
mov eax, dword [esi + 0x5860]
mov edx, dword [esi + 0x585c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
shl ecx, 4
mov ebp, dword [ecx + edx + 0x54]
mov ebx, dword [ecx + edx + 0x58]
sub ebx, dword [ecx + edx + 0x50]
sub ebp, dword [ecx + edx + 0x4c]
lea eax, [ecx + edx]
mov eax, dword [esi + 0x500]
push 0x5a0
push eax
push 0x78
mov dword [esp + 0x34], ebx
call edi
cmp ebp, eax
jge 0x522fcc
mov ecx, dword [esi + 0x500]
push 0x5a0
push ecx
push 0x78
call edi
mov ebp, eax
mov edx, dword [esi + 0x504]
push 0x5a0
push edx
push 0x78
call edi
cmp ebx, eax
jge 0x522ffa
mov eax, dword [esi + 0x504]
push 0x5a0
push eax
push 0x78
call edi
mov dword [esp + 0x28], eax
jmp 0x522ffa
mov ebp, dword [esp + 0x2c]
cmp dword [esp + 0x2c], 1
jne 0x5230e8
mov ecx, dword [esi + 0x500]
mov ebx, dword [esp + 0x18]
push ecx
imul ebx, ebx, 0x170
push 0x5a0
push ebp
call edi
mov edx, dword [esi + 0x3434]
mov ecx, dword [esp + 0x28]
mov dword [edx + ebx + 0xb4], eax
mov eax, dword [esi + 0x504]
push eax
push 0x5a0
push ecx
call edi
mov edx, dword [esi + 0x3434]
mov dword [edx + ebx + 0xb0], eax
mov eax, dword [esp + 0x20]
test eax, eax
jle 0x52309b
imul eax, eax, 0x98
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x500]
push eax
push 0x5a0
push ebp
call edi
mov ecx, dword [esi + 0x72c]
mov edx, dword [esp + 0x2c]
mov dword [edx + ecx + 0x10], eax
mov eax, dword [esi + 0x504]
mov ecx, dword [esp + 0x28]
push eax
push 0x5a0
push ecx
call edi
mov edx, dword [esi + 0x72c]
mov ecx, dword [esp + 0x2c]
mov dword [ecx + edx + 0x18], eax
mov edx, dword [esp + 0x28]
mov edi, dword [esp + 0x18]
push 1
push ebp
push edx
push edi
push esi
call fcn.004e13e0
push edi
push esi
call fcn.004ca4b0
mov eax, dword [esi + 0x3434]
add esp, 0x1c
cmp dword [eax + ebx + 0x88], 0xc
je 0x523163
push esi
call fcn.00521ee0
add esp, 4
pop edi
mov eax, 1
add dword [esi + 0x114], eax
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp dword [esp + 0x10], 0
jne 0x523154
mov ecx, dword [esi + 0x500]
mov ebx, dword [esp + 0x18]
push ecx
imul ebx, ebx, 0x98
push 0x5a0
push ebp
call edi
mov edx, dword [esi + 0x72c]
mov ecx, dword [esp + 0x28]
mov dword [ebx + edx + 0x10], eax
mov eax, dword [esi + 0x504]
push eax
push 0x5a0
push ecx
call edi
mov edx, dword [esi + 0x72c]
mov dword [ebx + edx + 0x18], eax
mov eax, dword [esi + 0x72c]
mov ecx, dword [eax + ebx + 0x18]
add eax, ebx
mov dword [eax + 0x1c], ecx
mov edx, dword [esi + 0x72c]
cmp dword [ebx + edx + 0x54], 0
lea eax, [ebx + edx]
jle 0x523154
mov ecx, dword [eax + 0x1c]
mov dword [eax + 0x18], ecx
push esi
call fcn.00521f60
push esi
call fcn.00521f90
add esp, 8
pop edi
mov eax, 1
add dword [esi + 0x114], eax
pop esi
pop ebp
pop ebx
add esp, 0x14
ret