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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
movzx eax, byte [ebp + 0xc]
sub esp, 0x11c
push ebx
mov ebx, dword [ebp + 0x10]
or ax, bx
push esi
push edi
je 0x40f4d7
cmp dword [ebp + 0x1c], 0
jne 0x40eeec
mov dword [ebp + 0x1c], 0xffc3d44d
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x4a9108]
mov eax, dword [0x4abb78]
sete byte [esp + 0x11]
test eax, eax
je 0x40ef12
cmp byte [esp + 0x11], 0
mov byte [esp + 0x12], 1
je 0x40ef17
mov byte [esp + 0x12], 0
cmp eax, 1
je 0x40ef23
cmp byte [esp + 0x11], 0
je 0x40ef27
mov byte [ebp + 0x18], 0
cmp byte [ebp + 0xc], 0
jne 0x40ef39
mov ecx, ebx
call fcn.004123b0
mov byte [ebp + 0xc], al
jmp 0x40ef52
test bx, bx
jne 0x40ef52
mov ecx, dword [ebp + 0xc]
push ecx
xor bl, bl
call fcn.00412130
movzx ebx, ax
add esp, 4
mov dword [ebp + 0x10], ebx
mov edx, ebx
xor eax, eax
shr edx, 8
test dl, dl
setne al
cmp dword [0x4abb78], 2
mov dword [esp + 0x1c], eax
jne case.default.0x40ef79
movzx eax, byte [ebp + 0xc]
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x40ef79
jmp dword [eax*4 + 0x40f4e0]
mov byte [ebp + 0xc], 0x11
jmp case.default.0x40ef79
mov byte [ebp + 0xc], 0x10
jmp case.default.0x40ef79
mov byte [ebp + 0xc], 0x12
cmp dword [ebp + 0x14], 0
mov al, byte [ebp + 0xc]
je 0x40f0c5
xor ecx, ecx
mov edx, ebx
call fcn.00411610
mov ebx, dword [ebp + 8]
test al, al
je 0x40f05b
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.USER32.dll_GetKeyboardState]
mov cl, 0x80
mov dl, 0x7f
test ebx, ebx
jne 0x40efd2
movzx eax, byte [ebp + 0xc]
or byte [esp + eax + 0x28], cl
lea eax, [esp + eax + 0x28]
jmp 0x40efe3
cmp ebx, 1
jne 0x40efe3
movzx eax, byte [ebp + 0xc]
and byte [esp + eax + 0x28], dl
lea eax, [esp + eax + 0x28]
movzx eax, byte [ebp + 0xc]
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x40eff1
jmp dword [eax*4 + 0x40f4f8]
test byte [esp + 0xca], cl
jne 0x40f010
test byte [esp + 0xcb], cl
jne 0x40f010
and byte [esp + 0x39], dl
jmp case.default.0x40eff1
or byte [esp + 0x39], cl
jmp case.default.0x40eff1
test byte [esp + 0xc8], cl
jne 0x40f02e
test byte [esp + 0xc9], cl
jne 0x40f02e
and byte [esp + 0x38], dl
jmp case.default.0x40eff1
or byte [esp + 0x38], cl
jmp case.default.0x40eff1
test byte [esp + 0xcc], cl
jne 0x40f04c
test byte [esp + 0xcd], cl
jne 0x40f04c
and byte [esp + 0x3a], dl
jmp case.default.0x40eff1
or byte [esp + 0x3a], cl
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.USER32.dll_SetKeyboardState]
movzx esi, word [ebp + 0x10]
mov edi, dword [sym.imp.USER32.dll_PostMessageA]
shl esi, 0x10
cmp ebx, 1
je 0x40f083
movzx ecx, byte [ebp + 0xc]
mov edx, dword [ebp + 0x14]
mov eax, esi
or eax, 1
push eax
push ecx
push 0x100
push edx
call edi
cmp byte [ebp + 0x18], 0
je 0x40f0a1
cmp ebx, 2
jne 0x40f0a1
mov eax, dword [0x4a6920]
mov ecx, dword [eax + 0x64]
push ecx
call fcn.00410970
add esp, 4
jmp 0x40f0a9
test ebx, ebx
je 0x40f49e
movzx edx, byte [ebp + 0xc]
mov eax, dword [ebp + 0x14]
or esi, 0xc0000001
push esi
push edx
push 0x101
push eax
call edi
jmp 0x40f49e
cmp byte [0x4aab28], 0
mov ecx, dword [ebp + 8]
mov dword [0x4a9160], ecx
mov byte [0x4abb03], al
je 0x40f122
cmp al, 0x12
je 0x40f0e8
cmp al, 0xa4
je 0x40f0e8
cmp al, 0xa5
jne 0x40f122
cmp byte [esp + 0x11], 0
jne 0x40f122
test byte [0x4ad304], 1
mov byte [esp + 0x16], 1
jne 0x40f153
or dword [0x4ad304], 1
push str.BlockInput
push str.user32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4ad300], eax
jmp 0x40f158
cmp byte [esp + 0x11], 0
mov byte [esp + 0x16], 0
lea esi, [esp + 0x24]
jne 0x40f137
mov esi, 0x4a9158
mov dword [esp + 0x18], esi
cmp al, 0xa5
jne 0x40f16c
cmp byte [esp + 0x12], 0
jne 0x40f16c
cmp dword [0x4aa350], 0
je 0x40f16c
mov al, 1
jmp 0x40f16e
mov eax, dword [0x4ad300]
test eax, eax
je 0x40f160
push 0
call eax
mov al, byte [ebp + 0xc]
mov byte [0x4aab28], 0
jmp 0x40f132
xor al, al
mov byte [esp + 0x14], al
mov byte [esp + 0x13], al
test al, al
je 0x40f1e6
cmp byte [esp + 0x11], 0
jne 0x40f189
mov edi, dword [0x4a915c]
jmp 0x40f1b6
call dword [sym.imp.USER32.dll_GetForegroundWindow]
test eax, eax
je 0x40f19e
push 0
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x40f1a0
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edi, eax
push edi
xor eax, eax
call fcn.00411970
add esp, 4
mov dword [esi], eax
cmp dword [esi], 0
je 0x40f1c2
mov byte [esp + 0x13], 0
jmp 0x40f1ea
push 0xa2
mov byte [esp + 0x19], 0xa2
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov edx, dword [ebp + 0x1c]
mov dword [0x4aa344], edx
shr eax, 0xf
and al, 1
mov byte [esp + 0x17], al
jmp 0x40f1ea
mov edi, dword [esp + 0x24]
cmp byte [esp + 0x12], 0
je 0x40f203
mov al, byte [ebp + 0xc]
xor ecx, ecx
mov edx, ebx
call fcn.00411610
mov byte [esp + 0x20], al
jmp 0x40f208
mov byte [esp + 0x20], 0
cmp byte [esp + 0x11], 0
jne 0x40f22e
mov eax, dword [0x4abb78]
cmp eax, 2
je 0x40f22e
cmp dword [0x4aa350], 0
je 0x40f227
cmp eax, 1
jne 0x40f22e
mov byte [esp + 0x11], 1
jmp 0x40f233
mov byte [esp + 0x11], 0
cmp dword [ebp + 8], 1
mov esi, dword [sym.imp.USER32.dll_keybd_event]
mov ebx, dword [esp + 0x20]
je 0x40f322
cmp byte [esp + 0x12], 0
je 0x40f26d
mov eax, dword [ebp + 0x1c]
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push ecx
push edx
push eax
push ebx
call fcn.00410450
add esp, 0x14
jmp 0x40f309
cmp byte [esp + 0x14], 0
je 0x40f286
mov ecx, dword [esp + 0x18]
cmp dword [ecx], 3
jne 0x40f286
mov edx, dword [ebp + 0x1c]
mov dword [0x4aa348], edx
mov eax, dword [ebp + 0x1c]
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push ecx
push edx
push eax
call esi
cmp byte [esp + 0x13], 0
mov dword [0x4aa348], 0
je 0x40f309
cmp dword [0x4aa344], 0
mov byte [esp + 0x13], 0
je 0x40f2d5
push edi
mov eax, 4
mov dword [0x4aa344], 0
call fcn.00411970
mov ecx, dword [esp + 0x1c]
mov dword [ecx], eax
jmp 0x40f306
cmp byte [esp + 0x17], 0
jne 0x40f309
movzx edx, byte [esp + 0x15]
push edx
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
and ax, cx
movzx eax, ax
neg eax
sbb eax, eax
add eax, 4
push edi
call fcn.00411970
mov edx, dword [esp + 0x1c]
mov dword [edx], eax
add esp, 4
cmp byte [esp + 0x11], 0
je 0x40f322
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push eax
push ecx
xor dl, dl
call fcn.00410b40
add esp, 8
cmp byte [ebp + 0x18], 0
je 0x40f361
mov eax, 2
cmp dword [ebp + 8], eax
jne 0x40f361
cmp dword [0x4abb78], eax
jne 0x40f34e
mov edx, dword [0x4a6920]
mov eax, dword [edx + 0x68]
push eax
call fcn.00410970
add esp, 4
jmp 0x40f36b
mov eax, dword [0x4a6920]
mov eax, dword [eax + 0x64]
push eax
call fcn.00410970
add esp, 4
jmp 0x40f36b
cmp dword [ebp + 8], 0
je 0x40f455
or dword [esp + 0x1c], 2
cmp byte [esp + 0x12], 0
je 0x40f399
mov ecx, dword [ebp + 0x1c]
mov edx, dword [esp + 0x1c]
mov eax, dword [ebp + 0x10]
push ecx
mov ecx, dword [ebp + 0xc]
push edx
push eax
push ecx
push ebx
call fcn.00410450
mov ebx, dword [ebp + 0x10]
add esp, 0x14
jmp 0x40f425
cmp byte [esp + 0x14], 0
je 0x40f3b1
mov edx, dword [esp + 0x18]
cmp dword [edx], 3
jne 0x40f3b1
mov eax, dword [ebp + 0x1c]
mov dword [0x4aa34c], eax
mov ecx, dword [ebp + 0x1c]
mov edx, dword [esp + 0x1c]
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
push ecx
push edx
push ebx
push eax
call esi
xor eax, eax
mov dword [0x4aa34c], eax
cmp byte [esp + 0x13], al
je 0x40f425
cmp dword [0x4aa344], eax
je 0x40f3f1
mov dword [0x4aa344], eax
push edi
mov eax, 4
call fcn.00411970
mov ecx, dword [esp + 0x1c]
mov dword [ecx], eax
jmp 0x40f422
cmp byte [esp + 0x17], al
je 0x40f425
movzx edx, byte [esp + 0x15]
push edx
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
test cx, ax
mov eax, 0
setne al
push edi
add eax, 3
call fcn.00411970
mov edx, dword [esp + 0x1c]
mov dword [edx], eax
add esp, 4
mov eax, dword [esp + 0x18]
cmp dword [eax], 0
je 0x40f43f
mov ecx, 0x138
cmp bx, cx
jne 0x40f43f
and byte [0x4a913d], 0xfe
cmp byte [esp + 0x11], 0
je 0x40f455
mov edx, dword [ebp + 0xc]
push ebx
push edx
mov dl, 1
call fcn.00410b40
add esp, 8
cmp byte [esp + 0x16], 0
je 0x40f49e
test byte [0x4ad304], 1
jne 0x40f48a
or dword [0x4ad304], 1
push str.BlockInput
push str.user32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4ad300], eax
jmp 0x40f48f
mov eax, dword [0x4ad300]
test eax, eax
je 0x40f497
push 1
call eax
mov byte [0x4aab28], 1
cmp byte [ebp + 0x18], 0
je 0x40f4d7
cmp dword [0x4abb78], 2
jne 0x40f4c5
mov eax, dword [0x4a6920]
mov eax, dword [eax + 0x60]
push eax
call fcn.00410970
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x4a6920]
mov eax, dword [ecx + 0x5c]
push eax
call fcn.00410970
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret