Function at 0x4130d0
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]
mov ebp, ecx
movzx eax, bl
or ax, si
mov dword [esp + 0x20], ebp
push edi
je 0x413792
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 [0x4ea308]
sete bh
cmp dword [0x4ec700], 0
je 0x41312f
mov byte [esp + 0x16], 1
test bh, bh
je 0x413134
mov byte [esp + 0x16], 0
cmp dword [0x4ec700], 1
je 0x413141
test bh, bh
je 0x413149
mov byte [esp + 0x178], 0
test bl, bl
jne 0x413163
mov ecx, esi
call fcn.00416c90
mov edx, dword [esp + 0x170]
mov bl, al
mov byte [esp + 0x20], bl
jmp 0x413182
mov edx, dword [esp + 0x170]
test dx, dx
jne 0x413182
xor dl, dl
mov cl, bl
call fcn.00416870
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 [0x4ec700], 2
mov dword [esp + 0x30], ecx
jne case.default.0x4131ac
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x4131ac
jmp dword [eax*4 + 0x4137a0]
mov bl, 0x11
jmp 0x4131bd
mov bl, 0x10
jmp 0x4131bd
mov bl, 0x12
mov byte [esp + 0x20], bl
mov edi, dword [esp + 0x174]
test edi, edi
je 0x4132fa
push 0
mov cl, bl
call fcn.00415b60
add esp, 4
test al, al
je 0x413294
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardState]
test ebp, ebp
jne 0x4131fd
movzx eax, bl
or byte [esp + eax + 0x38], 0x80
jmp 0x41320a
cmp ebp, 1
jne 0x41320a
movzx eax, bl
and byte [esp + eax + 0x38], 0x7f
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x413217
jmp dword [eax*4 + 0x4137b8]
test byte [esp + 0xda], 0x80
jne 0x413239
test byte [esp + 0xdb], 0x80
jne 0x413239
and byte [esp + 0x49], 0x7f
jmp case.default.0x413217
or byte [esp + 0x49], 0x80
jmp case.default.0x413217
test byte [esp + 0xd8], 0x80
jne 0x41325b
test byte [esp + 0xd9], 0x80
jne 0x41325b
and byte [esp + 0x48], 0x7f
jmp case.default.0x413217
or byte [esp + 0x48], 0x80
jmp case.default.0x413217
test byte [esp + 0xdc], 0x80
jne 0x41327d
test byte [esp + 0xdd], 0x80
jne 0x41327d
and byte [esp + 0x4a], 0x7f
jmp case.default.0x413217
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 ebp, 1
mov ebp, dword [sym.imp.USER32.dll_PostMessageW]
je 0x4132b7
mov eax, esi
or eax, 1
push eax
movzx eax, bl
push eax
push 0x100
push edi
call ebp
cmp byte [esp + 0x178], 0
mov eax, dword [esp + 0x24]
je 0x4132da
cmp eax, 2
jne 0x4132da
mov ecx, dword [0x4e7024]
mov ecx, dword [ecx + 0x64]
call fcn.00414e00
jmp 0x4132e2
test eax, eax
je 0x413756
or esi, 0xc0000001
movzx eax, bl
push esi
push eax
push 0x101
push edi
call ebp
jmp 0x413756
cmp byte [0x4e9882], 0
mov dword [0x4ec688], ebp
mov byte [0x4ec68c], bl
je 0x41333e
cmp bl, 0x12
je 0x41331e
cmp bl, 0xa4
je 0x41331e
cmp bl, 0xa5
jne 0x41333e
test bh, bh
jne 0x41333e
push 0
mov byte [esp + 0x1f], 1
call dword [sym.imp.USER32.dll_BlockInput]
mov edx, dword [esp + 0x170]
mov byte [0x4e9882], bh
jmp 0x413343
mov byte [esp + 0x1b], 0
test bh, bh
lea esi, [esp + 0x34]
mov eax, 0x4ec6e4
cmove esi, eax
mov al, byte [esp + 0x16]
mov dword [esp + 0x24], esi
cmp bl, 0xa5
jne 0x413428
test al, al
jne 0x413428
cmp dword [0x4e9814], 0
je 0x413428
mov byte [esp + 0x19], 1
mov byte [esp + 0x17], 1
test bh, bh
jne 0x41338d
mov edi, dword [0x4ec6e0]
jmp 0x4133ed
call dword [sym.imp.USER32.dll_GetForegroundWindow]
xor esi, esi
test eax, eax
je 0x4133d5
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push eax
call edi
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 0x4133d5
mov eax, dword [esp + 0x144]
test eax, eax
je 0x4133d5
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edi, eax
xor edx, edx
mov ecx, edi
call fcn.00415e90
mov esi, dword [esp + 0x24]
mov dword [esi], eax
cmp dword [esi], 0
je 0x413401
mov cl, byte [esp + 0x15]
mov byte [esp + 0x17], 0
mov byte [esp + 0x18], cl
jmp 0x41346a
push 0xa2
mov byte [esp + 0x1c], 0xa2
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
shr eax, 0xf
and eax, 0xffffff01
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
mov dword [0x4ea1e0], eax
jmp 0x413472
mov byte [esp + 0x19], 0
mov byte [esp + 0x17], 0
test al, al
je 0x41345e
push 0
mov cl, bl
call fcn.00415b60
mov cl, byte [esp + 0x19]
mov ch, al
mov edi, dword [esp + 0x30]
add esp, 4
mov byte [esp + 0x1a], al
mov al, byte [esp + 0x15]
mov byte [esp + 0x18], cl
mov dword [esp + 0x28], eax
jmp 0x41347f
mov al, byte [esp + 0x15]
mov edi, dword [esp + 0x2c]
mov byte [esp + 0x18], al
mov al, byte [esp + 0x15]
mov dword [esp + 0x28], eax
mov edx, dword [esp + 0x170]
xor ch, ch
mov byte [esp + 0x1a], ch
test bh, bh
jne 0x4134a2
mov eax, dword [0x4ec700]
cmp eax, 2
je 0x4134a2
cmp dword [0x4e9814], 0
je 0x41349b
cmp eax, 1
jne 0x4134a2
mov byte [esp + 0x15], 1
jmp 0x4134a7
mov byte [esp + 0x15], 0
mov bh, byte [esp + 0x16]
cmp ebp, 1
je 0x4135cd
test bh, bh
je 0x4134d2
push dword [esp + 0x1c]
mov cl, ch
push dword [esp + 0x34]
push edx
mov dl, bl
call fcn.00414810
add esp, 0xc
jmp 0x4135b0
cmp byte [esp + 0x19], 0
je 0x4134eb
mov eax, dword [0x4ea1dc]
cmp dword [esi], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4ea1dc], 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 [0x4ea1dc], 0
je 0x4135b0
cmp dword [0x4ea1e0], 0
mov byte [esp + 0x17], 0
je 0x413582
mov dword [0x4ea1e0], 0
xor ecx, ecx
mov eax, dword [ecx*8 + 0x4ec690]
test eax, eax
je 0x413545
cmp eax, edi
je 0x413569
inc ecx
cmp ecx, 0xa
jl 0x413530
cmp ecx, 0xa
mov eax, 9
cmovl eax, ecx
mov dword [eax*8 + 0x4ec690], edi
mov dword [eax*8 + 0x4ec694], 4
mov eax, 4
jmp 0x4135ae
mov eax, dword [ecx*8 + 0x4ec694]
test eax, eax
jne 0x4135ae
mov eax, 4
mov dword [ecx*8 + 0x4ec694], eax
jmp 0x4135ae
cmp byte [esp + 0x28], 0
jne 0x4135b0
movzx eax, byte [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
and ax, cx
mov ecx, edi
movzx edx, ax
neg edx
sbb edx, edx
add edx, 4
call fcn.00415e90
mov dword [esi], eax
cmp byte [esp + 0x15], 0
mov esi, dword [esp + 0x170]
je 0x4135d4
push esi
mov dl, bl
xor cl, cl
call fcn.00415000
add esp, 4
jmp 0x4135d4
mov esi, dword [esp + 0x170]
cmp byte [esp + 0x178], 0
je 0x413604
cmp ebp, 2
jne 0x413604
mov eax, dword [0x4e7024]
cmp dword [0x4ec700], ebp
jne 0x4135fa
mov ecx, dword [eax + 0x68]
call fcn.00414e00
jmp 0x41360c
mov ecx, dword [eax + 0x64]
call fcn.00414e00
jmp 0x41360c
test ebp, ebp
je 0x413740
mov ecx, dword [esp + 0x30]
or ecx, 2
test bh, bh
je 0x413634
push dword [esp + 0x1c]
mov dl, bl
push ecx
mov cl, byte [esp + 0x22]
push esi
call fcn.00414810
mov ebp, dword [esp + 0x30]
add esp, 0xc
jmp 0x413715
cmp byte [esp + 0x19], 0
mov ebp, dword [esp + 0x24]
je 0x413652
mov eax, dword [0x4ea1d8]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4ea1d8], 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 [0x4ea1d8], 0
je 0x413715
cmp dword [0x4ea1e0], 0
je 0x4136e8
mov dword [0x4ea1e0], 0
xor eax, eax
nop
mov ecx, dword [eax*8 + 0x4ec690]
test ecx, ecx
je 0x4136a5
cmp ecx, edi
je 0x4136cc
inc eax
cmp eax, 0xa
jl 0x413690
cmp eax, 0xa
mov ecx, 9
cmovl ecx, eax
mov dword [ecx*8 + 0x4ec690], edi
mov dword [ecx*8 + 0x4ec694], 4
mov ecx, 4
mov dword [ebp], ecx
jmp 0x413715
mov ecx, dword [eax*8 + 0x4ec694]
test ecx, ecx
jne 0x4136c7
mov ecx, 4
mov dword [eax*8 + 0x4ec694], ecx
mov dword [ebp], ecx
jmp 0x413715
cmp byte [esp + 0x28], 0
je 0x413715
movzx eax, byte [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
bt ax, 0xf
mov edx, 0
mov ecx, edi
setb dl
add edx, 3
call fcn.00415e90
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x41372c
mov eax, 0x138
cmp si, ax
jne 0x41372c
and byte [0x4ec6f4], 0xfe
cmp byte [esp + 0x15], 0
je 0x413740
push esi
mov dl, bl
mov cl, 1
call fcn.00415000
add esp, 4
cmp byte [esp + 0x1b], 0
je 0x413756
push 1
call dword [sym.imp.USER32.dll_BlockInput]
mov byte [0x4e9882], 1
cmp byte [esp + 0x178], 0
je 0x413792
cmp dword [0x4ec700], 2
mov eax, dword [0x4e7024]
jne 0x413780
mov ecx, dword [eax + 0x60]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.00414e00
mov ecx, dword [eax + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.00414e00
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret