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

Disassembly:
sub esp, 0x118
push ebx
mov bl, byte [esp + 0x124]
push esi
mov esi, dword [esp + 0x124]
movzx eax, bl
push edi
mov edi, dword [esp + 0x130]
or ax, di
je 0x40f3d3
cmp dword [esp + 0x13c], 0
jne 0x40ed6f
mov dword [esp + 0x13c], 0xffc3d44d
call dword [sym.imp.KERNEL32.DLL_GetCurrentThreadId]
cmp eax, dword [0x4c0d38]
mov ecx, dword [0x4c38b0]
sete al
mov byte [esp + 0xd], al
test ecx, ecx
je 0x40ed95
mov byte [esp + 0xe], 1
test al, al
je 0x40ed9a
mov byte [esp + 0xe], 0
cmp ecx, 1
je 0x40eda3
test al, al
je 0x40edab
mov byte [esp + 0x138], 0
test bl, bl
jne 0x40edbf
mov ecx, edi
call fcn.00412230
mov byte [esp + 0x12c], al
jmp 0x40ede0
test di, di
jne 0x40ede0
mov ecx, dword [esp + 0x12c]
push ecx
xor bl, bl
call fcn.00411fb0
movzx edi, ax
add esp, 4
mov dword [esp + 0x130], edi
mov edx, edi
xor eax, eax
shr edx, 8
test dl, dl
setne al
cmp dword [0x4c38b0], 2
mov dword [esp + 0x14], eax
jne case.default.0x40ee0b
movzx eax, byte [esp + 0x12c]
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x40ee0b
jmp dword [eax*4 + 0x40f3e0]
mov byte [esp + 0x12c], 0x11
jmp case.default.0x40ee0b
mov byte [esp + 0x12c], 0x10
jmp case.default.0x40ee0b
mov byte [esp + 0x12c], 0x12
mov ebx, dword [esp + 0x134]
mov al, byte [esp + 0x12c]
push ebp
test ebx, ebx
je 0x40ef78
xor ecx, ecx
mov edx, edi
call fcn.00411500
test al, al
je 0x40ef0c
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.USER32.dll_GetKeyboardState]
mov cl, 0x80
mov dl, 0x7f
test esi, esi
jne 0x40ee7b
movzx eax, byte [esp + 0x130]
or byte [esp + eax + 0x28], cl
lea eax, [esp + eax + 0x28]
jmp 0x40ee90
cmp esi, 1
jne 0x40ee90
movzx eax, byte [esp + 0x130]
and byte [esp + eax + 0x28], dl
lea eax, [esp + eax + 0x28]
movzx eax, byte [esp + 0x130]
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x40eea2
jmp dword [eax*4 + 0x40f3f8]
test byte [esp + 0xca], cl
jne 0x40eec1
test byte [esp + 0xcb], cl
jne 0x40eec1
and byte [esp + 0x39], dl
jmp case.default.0x40eea2
or byte [esp + 0x39], cl
jmp case.default.0x40eea2
test byte [esp + 0xc8], cl
jne 0x40eedf
test byte [esp + 0xc9], cl
jne 0x40eedf
and byte [esp + 0x38], dl
jmp case.default.0x40eea2
or byte [esp + 0x38], cl
jmp case.default.0x40eea2
test byte [esp + 0xcc], cl
jne 0x40eefd
test byte [esp + 0xcd], cl
jne 0x40eefd
and byte [esp + 0x3a], dl
jmp case.default.0x40eea2
or byte [esp + 0x3a], cl
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.USER32.dll_SetKeyboardState]
mov ebp, dword [sym.imp.USER32.dll_PostMessageW]
movzx edi, di
shl edi, 0x10
cmp esi, 1
je 0x40ef34
movzx ecx, byte [esp + 0x130]
mov eax, edi
or eax, 1
push eax
push ecx
push 0x100
push ebx
call ebp
cmp byte [esp + 0x13c], 0
je 0x40ef53
cmp esi, 2
jne 0x40ef53
mov edx, dword [0x4be40c]
mov esi, dword [edx + 0x64]
call fcn.00410850
jmp 0x40ef5b
test esi, esi
je 0x40f399
movzx eax, byte [esp + 0x130]
or edi, 0xc0000001
push edi
push eax
push 0x101
push ebx
call ebp
jmp 0x40f399
cmp byte [0x4c264b], 0
mov dword [0x4c0d90], esi
mov byte [0x4c2896], al
je 0x40efdc
cmp al, 0x12
je 0x40ef98
cmp al, 0xa4
je 0x40ef98
cmp al, 0xa5
jne 0x40efdc
cmp byte [esp + 0x11], 0
jne 0x40efdc
test byte [0x4c56a0], 1
mov byte [esp + 0x16], 1
jne 0x40f00d
or dword [0x4c56a0], 1
push str.BlockInput
push str.user32
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov ecx, eax
mov al, byte [esp + 0x130]
mov dword [0x4c569c], ecx
jmp 0x40f013
cmp byte [esp + 0x11], 0
mov byte [esp + 0x16], 0
lea esi, [esp + 0x24]
jne 0x40eff1
mov esi, 0x4c0d88
mov dword [esp + 0x20], esi
cmp al, 0xa5
jne 0x40f02b
cmp byte [esp + 0x12], 0
jne 0x40f02b
cmp dword [0x4c1f78], 0
je 0x40f02b
mov al, 1
jmp 0x40f02d
mov ecx, dword [0x4c569c]
test ecx, ecx
je 0x40f022
push 0
call ecx
mov al, byte [esp + 0x130]
mov byte [0x4c264b], 0
jmp 0x40efec
xor al, al
mov byte [esp + 0x14], al
mov byte [esp + 0x13], al
test al, al
je 0x40f0a9
cmp byte [esp + 0x11], 0
jne 0x40f048
mov ebp, dword [0x4c0d8c]
jmp 0x40f075
call dword [sym.imp.USER32.dll_GetForegroundWindow]
test eax, eax
je 0x40f05d
push 0
push eax
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x40f05f
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
push ebp
xor eax, eax
call fcn.004118d0
add esp, 4
mov dword [esi], eax
cmp dword [esi], 0
je 0x40f081
mov byte [esp + 0x13], 0
jmp 0x40f0ad
push 0xa2
mov byte [esp + 0x19], 0xa2
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, dword [esp + 0x140]
mov dword [0x4c1f6c], ecx
shr eax, 0xf
and al, 1
mov byte [esp + 0x17], al
jmp 0x40f0ad
mov ebp, dword [esp + 0x24]
cmp byte [esp + 0x12], 0
je 0x40f0cf
mov edx, dword [esp + 0x134]
mov al, byte [esp + 0x130]
xor ecx, ecx
call fcn.00411500
mov byte [esp + 0x1c], al
jmp 0x40f0d4
mov byte [esp + 0x1c], 0
cmp byte [esp + 0x11], 0
jne 0x40f0fa
mov eax, dword [0x4c38b0]
cmp eax, 2
je 0x40f0fa
cmp dword [0x4c1f78], 0
je 0x40f0f3
cmp eax, 1
jne 0x40f0fa
mov byte [esp + 0x11], 1
jmp 0x40f0ff
mov byte [esp + 0x11], 0
cmp dword [esp + 0x12c], 1
mov edi, dword [sym.imp.USER32.dll_keybd_event]
mov ebx, dword [esp + 0x1c]
je 0x40f201
cmp byte [esp + 0x12], 0
je 0x40f149
mov edx, dword [esp + 0x140]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x134]
push edx
mov edx, dword [esp + 0x134]
push eax
push ecx
push edx
push ebx
call fcn.00410330
add esp, 0x14
jmp 0x40f1e0
cmp byte [esp + 0x14], 0
je 0x40f161
cmp dword [esi], 3
jne 0x40f161
mov eax, dword [esp + 0x140]
mov dword [0x4c1f70], eax
mov ecx, dword [esp + 0x140]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x134]
push ecx
mov ecx, dword [esp + 0x134]
push edx
push eax
push ecx
call edi
cmp byte [esp + 0x13], 0
mov dword [0x4c1f70], 0
je 0x40f1e0
cmp dword [0x4c1f6c], 0
mov byte [esp + 0x13], 0
je 0x40f1b0
mov dword [0x4c1f6c], 0
mov eax, 4
jmp 0x40f1d5
cmp byte [esp + 0x17], 0
jne 0x40f1e0
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 ebp
call fcn.004118d0
mov dword [esi], eax
add esp, 4
cmp byte [esp + 0x11], 0
je 0x40f201
mov edx, dword [esp + 0x134]
mov eax, dword [esp + 0x130]
push edx
push eax
xor dl, dl
call fcn.00410a10
add esp, 8
cmp byte [esp + 0x13c], 0
je 0x40f249
mov eax, 2
cmp dword [esp + 0x12c], eax
jne 0x40f249
cmp dword [0x4c38b0], eax
jne 0x40f235
mov ecx, dword [0x4be40c]
mov esi, dword [ecx + 0x68]
call fcn.00410850
mov esi, dword [esp + 0x20]
jmp 0x40f257
mov edx, dword [0x4be40c]
mov esi, dword [edx + 0x64]
call fcn.00410850
mov esi, dword [esp + 0x20]
jmp 0x40f257
cmp dword [esp + 0x12c], 0
je 0x40f34e
or dword [esp + 0x18], 2
cmp byte [esp + 0x12], 0
je 0x40f295
mov eax, dword [esp + 0x140]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x134]
push eax
mov eax, dword [esp + 0x134]
push ecx
push edx
push eax
push ebx
call fcn.00410330
mov ebx, dword [esp + 0x148]
add esp, 0x14
jmp 0x40f31e
cmp byte [esp + 0x14], 0
je 0x40f2ae
cmp dword [esi], 3
jne 0x40f2ae
mov ecx, dword [esp + 0x140]
mov dword [0x4c1f74], ecx
mov edx, dword [esp + 0x140]
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x134]
mov ecx, dword [esp + 0x130]
push edx
push eax
push ebx
push ecx
call edi
xor eax, eax
mov dword [0x4c1f74], eax
cmp byte [esp + 0x13], al
je 0x40f31e
cmp dword [0x4c1f6c], eax
je 0x40f2ee
mov dword [0x4c1f6c], eax
mov eax, 4
jmp 0x40f313
cmp byte [esp + 0x17], al
je 0x40f31e
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
add eax, 3
push ebp
call fcn.004118d0
mov dword [esi], eax
add esp, 4
cmp dword [esi], 0
je 0x40f334
mov edx, 0x138
cmp bx, dx
jne 0x40f334
and byte [0x4c0d6f], 0xfe
cmp byte [esp + 0x11], 0
je 0x40f34e
mov eax, dword [esp + 0x130]
push ebx
push eax
mov dl, 1
call fcn.00410a10
add esp, 8
cmp byte [esp + 0x16], 0
je 0x40f399
test byte [0x4c56a0], 1
jne 0x40f381
or dword [0x4c56a0], 1
push str.BlockInput
push str.user32
call dword [sym.imp.KERNEL32.DLL_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov dword [0x4c569c], eax
cmp dword [0x4c569c], 0
je 0x40f392
push 1
call dword [0x4c569c]
mov byte [0x4c264b], 1
cmp byte [esp + 0x13c], 0
pop ebp
je 0x40f3d3
cmp dword [0x4c38b0], 2
jne 0x40f3c5
mov ecx, dword [0x4be40c]
mov esi, dword [ecx + 0x60]
call fcn.00410850
pop edi
pop esi
pop ebx
add esp, 0x118
ret
mov edx, dword [0x4be40c]
mov esi, dword [edx + 0x5c]
call fcn.00410850
pop edi
pop esi
pop ebx
add esp, 0x118
ret