Function at 0x412a10
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 0x41302b
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 [0x4cb1e0]
sete bh
cmp dword [0x4cd100], 0
je 0x412a6b
mov byte [esp + 0x16], 1
test bh, bh
je 0x412a70
mov byte [esp + 0x16], 0
cmp dword [0x4cd100], 1
je 0x412a7d
test bh, bh
je 0x412a85
mov byte [esp + 0x178], 0
test bl, bl
jne 0x412a9f
mov ecx, esi
call fcn.00416710
mov edx, dword [esp + 0x170]
mov bl, al
mov byte [esp + 0x20], bl
jmp 0x412abe
mov edx, dword [esp + 0x170]
test dx, dx
jne 0x412abe
xor dl, dl
mov cl, bl
call fcn.004162f0
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 [0x4cd100], 2
mov dword [esp + 0x30], ecx
jne case.default.0x412ae8
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x412ae8
jmp dword [eax*4 + 0x413038]
mov bl, 0x11
jmp 0x412af9
mov bl, 0x10
jmp 0x412af9
mov bl, 0x12
mov byte [esp + 0x20], bl
mov ebp, dword [esp + 0x174]
test ebp, ebp
je 0x412c34
push 0
mov cl, bl
call fcn.004156f0
add esp, 4
test al, al
je 0x412bd0
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardState]
test edi, edi
jne 0x412b39
movzx eax, bl
or byte [esp + eax + 0x38], 0x80
jmp 0x412b46
cmp edi, 1
jne 0x412b46
movzx eax, bl
and byte [esp + eax + 0x38], 0x7f
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x412b53
jmp dword [eax*4 + 0x413050]
test byte [esp + 0xda], 0x80
jne 0x412b75
test byte [esp + 0xdb], 0x80
jne 0x412b75
and byte [esp + 0x49], 0x7f
jmp case.default.0x412b53
or byte [esp + 0x49], 0x80
jmp case.default.0x412b53
test byte [esp + 0xd8], 0x80
jne 0x412b97
test byte [esp + 0xd9], 0x80
jne 0x412b97
and byte [esp + 0x48], 0x7f
jmp case.default.0x412b53
or byte [esp + 0x48], 0x80
jmp case.default.0x412b53
test byte [esp + 0xdc], 0x80
jne 0x412bb9
test byte [esp + 0xdd], 0x80
jne 0x412bb9
and byte [esp + 0x4a], 0x7f
jmp case.default.0x412b53
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 0x412bf1
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 0x412c10
cmp edi, 2
jne 0x412c10
mov ecx, dword [0x4c8024]
mov ecx, dword [ecx + 0x64]
call fcn.004149b0
jmp 0x412c18
test edi, edi
je 0x412fef
or esi, 0xc0000001
movzx eax, bl
push esi
push eax
push 0x101
push ebp
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x412fef
cmp byte [0x4ca7e6], 0
mov dword [0x4cd088], edi
mov byte [0x4cd08c], bl
je 0x412c78
cmp bl, 0x12
je 0x412c58
cmp bl, 0xa4
je 0x412c58
cmp bl, 0xa5
jne 0x412c78
test bh, bh
jne 0x412c78
push 0
mov byte [esp + 0x1f], 1
call dword [sym.imp.USER32.dll_BlockInput]
mov edx, dword [esp + 0x170]
mov byte [0x4ca7e6], bh
jmp 0x412c7d
mov byte [esp + 0x1b], 0
test bh, bh
lea ebp, [esp + 0x34]
mov eax, 0x4cd0e4
cmove ebp, eax
mov al, byte [esp + 0x16]
cmp bl, 0xa5
jne 0x412d66
test al, al
jne 0x412d66
cmp dword [0x4ca774], 0
je 0x412d66
mov byte [esp + 0x19], 1
mov byte [esp + 0x17], 1
test bh, bh
jne 0x412cc7
mov esi, dword [0x4cd0e0]
mov dword [esp + 0x28], esi
jmp 0x412d2a
call dword [sym.imp.USER32.dll_GetForegroundWindow]
xor esi, esi
test eax, eax
je 0x412d11
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 0x412d11
mov eax, dword [esp + 0x144]
test eax, eax
je 0x412d11
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.004159c0
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x412d3f
mov cl, byte [esp + 0x15]
mov byte [esp + 0x17], 0
mov byte [esp + 0x18], cl
jmp 0x412db0
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 [0x4cb0b8], eax
jmp 0x412db8
mov byte [esp + 0x19], 0
mov byte [esp + 0x17], 0
test al, al
je 0x412da0
push 0
mov cl, bl
call fcn.004156f0
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 0x412dc5
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 0x412de8
mov eax, dword [0x4cd100]
cmp eax, 2
je 0x412de8
cmp dword [0x4ca774], 0
je 0x412de1
cmp eax, 1
jne 0x412de8
mov byte [esp + 0x15], 1
jmp 0x412ded
mov byte [esp + 0x15], 0
mov bh, byte [esp + 0x16]
cmp edi, 1
je 0x412ec4
test bh, bh
je 0x412e18
push dword [esp + 0x1c]
mov cl, ch
push dword [esp + 0x34]
push edx
mov dl, bl
call fcn.004143c0
add esp, 0xc
jmp 0x412ea7
cmp byte [esp + 0x19], 0
je 0x412e32
mov eax, dword [0x4cb0b4]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4cb0b4], 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 [0x4cb0b4], 0
je 0x412ea7
cmp dword [0x4cb0b8], 0
mov byte [esp + 0x17], 0
je 0x412e78
mov dword [0x4cb0b8], 0
mov edx, 4
jmp 0x412e9d
cmp byte [esp + 0x24], 0
jne 0x412ea7
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.004159c0
mov dword [ebp], eax
cmp byte [esp + 0x15], 0
mov esi, dword [esp + 0x170]
je 0x412ecb
push esi
mov dl, bl
xor cl, cl
call fcn.00414bb0
add esp, 4
jmp 0x412ecb
mov esi, dword [esp + 0x170]
cmp byte [esp + 0x178], 0
je 0x412efb
cmp edi, 2
jne 0x412efb
mov eax, dword [0x4c8024]
cmp dword [0x4cd100], edi
jne 0x412ef1
mov ecx, dword [eax + 0x68]
call fcn.004149b0
jmp 0x412f03
mov ecx, dword [eax + 0x64]
call fcn.004149b0
jmp 0x412f03
test edi, edi
je 0x412fd9
mov ecx, dword [esp + 0x30]
or ecx, 2
test bh, bh
je 0x412f27
push dword [esp + 0x1c]
mov dl, bl
push ecx
mov cl, byte [esp + 0x22]
push esi
call fcn.004143c0
add esp, 0xc
jmp 0x412fae
cmp byte [esp + 0x19], 0
je 0x412f41
mov eax, dword [0x4cb0b0]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4cb0b0], 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 [0x4cb0b0], 0
je 0x412fae
cmp dword [0x4cb0b8], 0
je 0x412f7f
mov dword [0x4cb0b8], 0
mov edx, 4
jmp 0x412fa2
cmp byte [esp + 0x24], 0
je 0x412fae
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.004159c0
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x412fc5
mov eax, 0x138
cmp si, ax
jne 0x412fc5
and byte [0x4cd0f4], 0xfe
cmp byte [esp + 0x15], 0
je 0x412fd9
push esi
mov dl, bl
mov cl, 1
call fcn.00414bb0
add esp, 4
cmp byte [esp + 0x1b], 0
je 0x412fef
push 1
call dword [sym.imp.USER32.dll_BlockInput]
mov byte [0x4ca7e6], 1
cmp byte [esp + 0x178], 0
je 0x41302b
cmp dword [0x4cd100], 2
mov eax, dword [0x4c8024]
jne 0x413019
mov ecx, dword [eax + 0x60]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.004149b0
mov ecx, dword [eax + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.004149b0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret