Function at 0x412960
Capabilities:
Get keyboard layout
Log keystrokes via polling

Disassembly:
sub esp, 0x15c
push ebx
push ebp
mov bl, dl
mov dword [esp + 0x18], edx
push esi
mov esi, dword [esp + 0x16c]
movzx eax, bl
or ax, si
push edi
mov edi, ecx
je 0x412f7b
mov eax, dword [esp + 0x17c]
mov ecx, 0xffc3d44d
test eax, eax
cmovne ecx, eax
mov dword [esp + 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x4ec1c8]
sete bh
cmp dword [0x4ee0e8], 0
je 0x4129bb
mov byte [esp + 0x16], 1
test bh, bh
je 0x4129c0
mov byte [esp + 0x16], 0
cmp dword [0x4ee0e8], 1
je 0x4129cd
test bh, bh
je 0x4129d5
mov byte [esp + 0x178], 0
test bl, bl
jne 0x4129ef
mov ecx, esi
call fcn.00416650
mov edx, dword [esp + 0x170]
mov bl, al
mov byte [esp + 0x20], bl
jmp 0x412a0e
mov edx, dword [esp + 0x170]
test dx, dx
jne 0x412a0e
xor dl, dl
mov cl, bl
call fcn.00416230
movzx edx, ax
mov dword [esp + 0x170], edx
mov eax, edx
mov byte [esp + 0x2c], dl
xor ecx, ecx
shr eax, 8
test al, al
setne cl
cmp dword [0x4ee0e8], 2
mov dword [esp + 0x30], ecx
jne case.default.0x412a38
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x412a38
jmp dword [eax*4 + 0x412f88]
mov bl, 0x11
jmp 0x412a49
mov bl, 0x10
jmp 0x412a49
mov bl, 0x12
mov byte [esp + 0x20], bl
mov ebp, dword [esp + 0x174]
test ebp, ebp
je 0x412b84
push 0
mov cl, bl
call fcn.00415630
add esp, 4
test al, al
je 0x412b20
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardState]
test edi, edi
jne 0x412a89
movzx eax, bl
or byte [esp + eax + 0x38], 0x80
jmp 0x412a96
cmp edi, 1
jne 0x412a96
movzx eax, bl
and byte [esp + eax + 0x38], 0x7f
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x412aa3
jmp dword [eax*4 + 0x412fa0]
test byte [esp + 0xda], 0x80
jne 0x412ac5
test byte [esp + 0xdb], 0x80
jne 0x412ac5
and byte [esp + 0x49], 0x7f
jmp case.default.0x412aa3
or byte [esp + 0x49], 0x80
jmp case.default.0x412aa3
test byte [esp + 0xd8], 0x80
jne 0x412ae7
test byte [esp + 0xd9], 0x80
jne 0x412ae7
and byte [esp + 0x48], 0x7f
jmp case.default.0x412aa3
or byte [esp + 0x48], 0x80
jmp case.default.0x412aa3
test byte [esp + 0xdc], 0x80
jne 0x412b09
test byte [esp + 0xdd], 0x80
jne 0x412b09
and byte [esp + 0x4a], 0x7f
jmp case.default.0x412aa3
or byte [esp + 0x4a], 0x80
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_SetKeyboardState]
mov edx, dword [esp + 0x170]
movzx esi, dx
shl esi, 0x10
cmp edi, 1
je 0x412b41
mov eax, esi
or eax, 1
push eax
movzx eax, bl
push eax
push 0x100
push ebp
call dword [sym.imp.USER32.dll_PostMessageA]
cmp byte [esp + 0x178], 0
je 0x412b60
cmp edi, 2
jne 0x412b60
mov ecx, dword [0x4e88cc]
mov ecx, dword [ecx + 0x64]
call fcn.004148f0
jmp 0x412b68
test edi, edi
je 0x412f3f
or esi, 0xc0000001
movzx eax, bl
push esi
push eax
push 0x101
push ebp
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x412f3f
cmp byte [0x4eb7ce], 0
mov dword [0x4ee070], edi
mov byte [0x4ee074], bl
je 0x412bc8
cmp bl, 0x12
je 0x412ba8
cmp bl, 0xa4
je 0x412ba8
cmp bl, 0xa5
jne 0x412bc8
test bh, bh
jne 0x412bc8
push 0
mov byte [esp + 0x1f], 1
call dword [sym.imp.USER32.dll_BlockInput]
mov edx, dword [esp + 0x170]
mov byte [0x4eb7ce], bh
jmp 0x412bcd
mov byte [esp + 0x1b], 0
test bh, bh
lea ebp, [esp + 0x34]
mov eax, 0x4ee0cc
cmove ebp, eax
mov al, byte [esp + 0x16]
cmp bl, 0xa5
jne 0x412cb6
test al, al
jne 0x412cb6
cmp dword [0x4eb75c], 0
je 0x412cb6
mov byte [esp + 0x19], 1
mov byte [esp + 0x17], 1
test bh, bh
jne 0x412c17
mov esi, dword [0x4ee0c8]
mov dword [esp + 0x28], esi
jmp 0x412c7a
call dword [sym.imp.USER32.dll_GetForegroundWindow]
xor esi, esi
test eax, eax
je 0x412c61
push esi
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov esi, eax
mov dword [esp + 0x138], 0x30
lea eax, [esp + 0x138]
push eax
push esi
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x412c61
mov eax, dword [esp + 0x144]
test eax, eax
je 0x412c61
push 0
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov esi, eax
xor edx, edx
mov ecx, esi
mov dword [esp + 0x28], esi
call fcn.00415900
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x412c8f
mov cl, byte [esp + 0x15]
mov byte [esp + 0x17], 0
mov byte [esp + 0x18], cl
jmp 0x412d00
push 0xa2
mov byte [esp + 0x1c], 0xa2
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
shr eax, 0xf
and eax, 0xffffff01
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x1c]
mov dword [0x4ec0a0], eax
jmp 0x412d08
mov byte [esp + 0x19], 0
mov byte [esp + 0x17], 0
test al, al
je 0x412cf0
push 0
mov cl, bl
call fcn.00415630
mov cl, byte [esp + 0x19]
mov ch, al
mov esi, dword [esp + 0x30]
add esp, 4
mov byte [esp + 0x1a], al
mov al, byte [esp + 0x15]
mov dword [esp + 0x28], esi
mov byte [esp + 0x18], cl
mov dword [esp + 0x24], eax
jmp 0x412d15
mov al, byte [esp + 0x15]
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x28], esi
mov byte [esp + 0x18], al
mov al, byte [esp + 0x15]
mov dword [esp + 0x24], eax
mov edx, dword [esp + 0x170]
xor ch, ch
mov byte [esp + 0x1a], ch
test bh, bh
jne 0x412d38
mov eax, dword [0x4ee0e8]
cmp eax, 2
je 0x412d38
cmp dword [0x4eb75c], 0
je 0x412d31
cmp eax, 1
jne 0x412d38
mov byte [esp + 0x15], 1
jmp 0x412d3d
mov byte [esp + 0x15], 0
mov bh, byte [esp + 0x16]
cmp edi, 1
je 0x412e14
test bh, bh
je 0x412d68
push dword [esp + 0x1c]
mov cl, ch
push dword [esp + 0x34]
push edx
mov dl, bl
call fcn.00414300
add esp, 0xc
jmp 0x412df7
cmp byte [esp + 0x19], 0
je 0x412d82
mov eax, dword [0x4ec09c]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4ec09c], eax
push dword [esp + 0x1c]
push dword [esp + 0x34]
push dword [esp + 0x34]
push dword [esp + 0x2c]
call dword [sym.imp.USER32.dll_keybd_event]
cmp byte [esp + 0x17], 0
mov dword [0x4ec09c], 0
je 0x412df7
cmp dword [0x4ec0a0], 0
mov byte [esp + 0x17], 0
je 0x412dc8
mov dword [0x4ec0a0], 0
mov edx, 4
jmp 0x412ded
cmp byte [esp + 0x24], 0
jne 0x412df7
movzx eax, byte [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
and ax, cx
movzx edx, ax
neg edx
sbb edx, edx
add edx, 4
mov ecx, esi
call fcn.00415900
mov dword [ebp], eax
cmp byte [esp + 0x15], 0
mov esi, dword [esp + 0x170]
je 0x412e1b
push esi
mov dl, bl
xor cl, cl
call fcn.00414af0
add esp, 4
jmp 0x412e1b
mov esi, dword [esp + 0x170]
cmp byte [esp + 0x178], 0
je 0x412e4b
cmp edi, 2
jne 0x412e4b
mov eax, dword [0x4e88cc]
cmp dword [0x4ee0e8], edi
jne 0x412e41
mov ecx, dword [eax + 0x68]
call fcn.004148f0
jmp 0x412e53
mov ecx, dword [eax + 0x64]
call fcn.004148f0
jmp 0x412e53
test edi, edi
je 0x412f29
mov ecx, dword [esp + 0x30]
or ecx, 2
test bh, bh
je 0x412e77
push dword [esp + 0x1c]
mov dl, bl
push ecx
mov cl, byte [esp + 0x22]
push esi
call fcn.00414300
add esp, 0xc
jmp 0x412efe
cmp byte [esp + 0x19], 0
je 0x412e91
mov eax, dword [0x4ec098]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4ec098], eax
push dword [esp + 0x1c]
push ecx
push dword [esp + 0x34]
push dword [esp + 0x2c]
call dword [sym.imp.USER32.dll_keybd_event]
cmp byte [esp + 0x17], 0
mov dword [0x4ec098], 0
je 0x412efe
cmp dword [0x4ec0a0], 0
je 0x412ecf
mov dword [0x4ec0a0], 0
mov edx, 4
jmp 0x412ef2
cmp byte [esp + 0x24], 0
je 0x412efe
movzx eax, byte [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
bt ax, 0xf
mov edx, 0
setb dl
add edx, 3
mov ecx, dword [esp + 0x28]
call fcn.00415900
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x412f15
mov eax, 0x138
cmp si, ax
jne 0x412f15
and byte [0x4ee0dc], 0xfe
cmp byte [esp + 0x15], 0
je 0x412f29
push esi
mov dl, bl
mov cl, 1
call fcn.00414af0
add esp, 4
cmp byte [esp + 0x1b], 0
je 0x412f3f
push 1
call dword [sym.imp.USER32.dll_BlockInput]
mov byte [0x4eb7ce], 1
cmp byte [esp + 0x178], 0
je 0x412f7b
cmp dword [0x4ee0e8], 2
mov eax, dword [0x4e88cc]
jne 0x412f69
mov ecx, dword [eax + 0x60]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.004148f0
mov ecx, dword [eax + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.004148f0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret