Function at 0x512c70
Capabilities:
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [ebp + 8]
push ebx
add eax, 0xfffffff7
push esi
cmp eax, 0x88
push edi
mov esi, ecx
ja case.0x512c94.20
xor ecx, ecx
mov cl, byte [eax + 0x5132c4]
jmp dword [ecx*4 + 0x513294]
mov eax, dword [esi + 0x18]
test eax, eax
jne case.0x512c94.20
push 0x8c
mov ecx, esi
call fcn.00506ef0
test eax, eax
je case.0x512c94.20
mov edx, dword [eax]
push 0
push 0
push 0
push 0x9d
push 6
push 0
mov ecx, eax
call dword [edx + 0x90]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 0xc]
test eax, eax
je case.0x512c94.20
mov eax, dword [esi + 0x388]
test eax, eax
je 0x512cfa
mov byte [0x839ef0], 0
mov ecx, dword [esi + 0x1c8]
test ecx, ecx
je 0x512d16
mov eax, dword [esi + 0x1b0]
mov edx, dword [ecx + 0x68]
cmp eax, edx
je 0x512d25
cmp eax, dword [ecx + 0x6c]
je 0x512d25
mov eax, dword [esi + 0x20]
mov edx, dword [eax]
cmp edx, eax
je 0x512d47
cmp dword [edx + 8], 1
jne 0x512d47
mov al, byte [esi + 0x2c]
test al, al
je 0x512d47
mov al, byte [esi + 0x2e]
test al, al
je 0x512d47
mov byte [esi + 0x2c], 0
call fcn.004a70c0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.00513b50
test al, al
jne case.0x512c94.20
mov eax, dword [esi + 0x20]
mov ecx, dword [eax]
cmp ecx, eax
je 0x512d64
mov edi, dword [ecx + 8]
jmp 0x512d67
or edi, 0xffffffff
push edi
mov ecx, 0x7d67b0
call fcn.00506ef0
test eax, eax
je case.0x512d89.43
lea ecx, [edi - 0x29]
cmp ecx, 0x89
ja case.0x512d89.43
xor edx, edx
mov dl, byte [ecx + 0x51335c]
jmp dword [edx*4 + 0x513350]
mov edx, dword [eax]
push 0
push 0
push 0
push 0x8b
push 6
push 0
mov ecx, eax
call dword [edx + 0x90]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [eax]
push 0
push 0
push 0
push 0x7b
push 6
push 0
mov ecx, eax
call dword [edx + 0x90]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
push edi
mov ecx, esi
call fcn.005137a0
cmp edi, 0xffffffff
je 0x512e1d
push edi
mov ecx, esi
call fcn.00507160
test al, al
je 0x512e1d
push 0x10
mov ecx, esi
call fcn.00506ef0
test eax, eax
jne case.0x512c94.20
mov ecx, dword [0x80fe54]
push 0
push 0
push 0
mov eax, dword [ecx]
push 0x28
call dword [eax + 0x18]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 0x1b4]
test eax, eax
jne 0x512ee1
mov eax, dword [0x83a878]
test eax, eax
jne 0x512ee1
mov eax, dword [0x80fe50]
test eax, eax
je 0x512ee1
push 0x10
mov ecx, esi
call fcn.00506ef0
test eax, eax
jne 0x512ee1
mov ecx, 0x80fe50
call fcn.00530b80
test eax, eax
je 0x512e8f
push 0x9b
mov ecx, esi
call fcn.00507160
test al, al
jne case.0x512c94.20
push 0x9b
mov ecx, esi
call fcn.0050a1e0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
push str.message
push 0
push 0
push 1
push 2
push 0x11
call fcn.0057ed70
add esp, 4
mov ecx, esi
push eax
call fcn.005069d0
cmp eax, 0x7d
jne case.0x512c94.20
call fcn.00419190
mov ecx, eax
call fcn.00418890
mov ecx, dword [0x80fe54]
push 0
push 0
push 0
mov edx, dword [ecx]
push 2
call dword [edx + 0x18]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov dword [esi + 0x3f8], 0x7e
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
push 0x11
call edi
xor ecx, ecx
mov cl, ah
test cl, cl
jne case.0x512c94.20
mov eax, dword [esi + 0x18]
test eax, eax
jne 0x512f47
push 0x8c
mov ecx, esi
call fcn.00506ef0
test eax, eax
je 0x512f47
mov edx, dword [eax]
push 0
push 0
push 0
push 0x82
push 6
push 0
mov ecx, eax
call dword [edx + 0x90]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 0x1b0]
test eax, eax
je 0x51312f
push 0x10
call edi
test ax, ax
mov eax, dword [esi + 0x1b0]
je 0x513067
test eax, eax
je 0x513028
mov ecx, dword [eax + 4]
push eax
call fcn.004fb250
test eax, eax
jne 0x513028
mov eax, dword [esi + 0x1b0]
test eax, eax
je 0x513001
mov eax, dword [eax + 4]
mov ecx, dword [eax + 0xc]
lea edi, [eax + 8]
lea eax, [ebp - 4]
mov dword [ebp + 0xc], ecx
push eax
mov ecx, edi
call fcn.00514780
mov eax, dword [eax]
lea ecx, [ebp + 8]
lea edx, [ebp + 0xc]
push ecx
push edx
mov dword [ebp + 8], eax
call fcn.00517d20
add esp, 8
test al, al
jne 0x513001
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
mov ebx, dword [ecx + 8]
mov ecx, ebx
mov edx, dword [ebx]
call dword [edx + 0x1c]
test al, al
jne 0x513015
lea eax, [ebp - 8]
push 0
push eax
lea ecx, [ebp + 0xc]
call fcn.00514bd0
lea ecx, [ebp - 4]
push ecx
mov ecx, edi
call fcn.00514780
mov eax, dword [eax]
lea edx, [ebp + 8]
mov dword [ebp + 8], eax
lea eax, [ebp + 0xc]
push edx
push eax
call fcn.00517d20
add esp, 8
test al, al
je 0x512fbb
push 0
mov ecx, esi
call fcn.00505cb0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
push ebx
mov ecx, esi
call fcn.00505cb0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 0x1b0]
test eax, eax
je case.0x512c94.20
mov ecx, dword [eax + 4]
push eax
call fcn.004fb250
mov edi, eax
test edi, edi
je 0x513001
mov edx, dword [edi]
mov ecx, edi
call dword [edx + 0x1c]
test al, al
je case.0x512c94.20
mov ecx, dword [esi + 0x1b0]
test ecx, ecx
je 0x513117
jmp 0x513112
test eax, eax
je 0x5130d8
mov ecx, dword [eax + 4]
push eax
call fcn.004fb1e0
test eax, eax
jne 0x5130d8
mov eax, dword [esi + 0x1b0]
test eax, eax
je 0x513001
mov eax, dword [eax + 4]
mov dword [ebp + 0xc], eax
mov eax, dword [eax + 0xc]
mov edi, dword [eax]
cmp edi, eax
je 0x513001
mov ebx, dword [edi + 8]
mov ecx, ebx
mov eax, dword [ebx]
call dword [eax + 0x1c]
test al, al
jne 0x5130c5
mov ecx, dword [ebp + 0xc]
mov edi, dword [edi]
cmp edi, dword [ecx + 0xc]
jne 0x513099
push 0
mov ecx, esi
call fcn.00505cb0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
push ebx
mov ecx, esi
call fcn.00505cb0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [esi + 0x1b0]
test eax, eax
je case.0x512c94.20
mov ecx, dword [eax + 4]
push eax
call fcn.004fb1e0
mov edi, eax
test edi, edi
je 0x513001
mov edx, dword [edi]
mov ecx, edi
call dword [edx + 0x1c]
test al, al
je case.0x512c94.20
mov ecx, dword [esi + 0x1b0]
test ecx, ecx
je 0x513117
mov eax, dword [ecx]
call dword [eax + 0x60]
mov dword [esi + 0x1b0], edi
mov edx, dword [edi]
mov ecx, edi
call dword [edx + 0x5c]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.005059b0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 0xc]
test eax, eax
je case.0x512c94.20
mov ecx, esi
call fcn.005062a0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x7d6978]
test ecx, ecx
je case.0x512c94.20
mov eax, dword [0x7d6960]
mov edx, dword [ecx + 0x68]
cmp eax, edx
je 0x513181
cmp eax, dword [ecx + 0x6c]
jne case.0x512c94.20
mov al, byte [0x7d67dc]
test al, al
je case.0x512c94.20
mov eax, dword [esi + 0x17c]
mov ecx, dword [eax]
cmp ecx, eax
mov dword [ebp + 0xc], ecx
je case.0x512c94.20
mov ecx, dword [ecx + 8]
mov eax, dword [ecx]
call dword [eax + 0x10]
test al, al
je 0x5131c7
mov ecx, dword [ebp + 0xc]
push 0
push 0
push 0
mov ecx, dword [ecx + 8]
push 0
push 3
push 0
mov edx, dword [ecx]
call dword [edx + 0x90]
lea eax, [ebp + 8]
push 0
push eax
lea ecx, [ebp + 0xc]
call fcn.00514850
mov eax, dword [esi + 0x17c]
mov ecx, dword [ebp + 0xc]
cmp ecx, eax
jne 0x5131a1
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [0x7d6978]
test ecx, ecx
je case.0x512c94.20
mov eax, dword [0x7d6960]
mov edx, dword [ecx + 0x68]
cmp eax, edx
je 0x51320c
cmp eax, dword [ecx + 0x6c]
jne case.0x512c94.20
mov al, byte [0x7d67dc]
test al, al
je case.0x512c94.20
mov ecx, esi
call fcn.00506100
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.00505ee0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.00505ff0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.00505dc0
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, esi
call fcn.00505e50
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 0xc]
test eax, eax
je case.0x512c94.20
mov ecx, dword [0x80fe54]
push 0
push 0
push 0
mov edx, dword [ecx]
push 0x44
call dword [edx + 0x18]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ebx, dword [ecx + eax*4]
mov edi, dword [ecx + eax*4 - 4]
mov ebx, dword [ebx + 0x10]
cmp ebx, dword [edi + 0x10]
jle 0x53354a
dec eax
mov edi, dword [ecx + eax*4]
mov dword [ecx + esi*4], edi
mov esi, eax
lea eax, [eax + eax + 2]
cmp eax, edx
jl 0x53353a
cmp eax, edx
jne 0x533568
mov edx, dword [ecx + eax*4 - 4]
mov dword [ecx + esi*4], edx
lea esi, [eax - 1]
lea eax, [esi - 1]
cdq
sub eax, edx
mov edx, dword [ebp + 0xc]
sar eax, 1
cmp edx, esi
jge 0x53359f
mov edi, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
mov ebx, dword [edx + 0x10]
cmp ebx, dword [edi + 0x10]
jle 0x533597
mov dword [ecx + esi*4], edx
mov esi, eax
dec eax
cdq
sub eax, edx
mov edx, dword [ebp + 0xc]
sar eax, 1
cmp edx, esi
jl 0x53357a
mov dword [ecx + esi*4], edi
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [ebp + 0x14]
pop edi
mov dword [ecx + esi*4], eax
pop esi
pop ebx
pop ebp
ret