Function at 0x411080
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 0x411745
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 [0x4dcedc]
sete bh
cmp dword [0x4dea20], 0
je 0x4110df
mov byte [esp + 0x16], 1
test bh, bh
je 0x4110e4
mov byte [esp + 0x16], 0
cmp dword [0x4dea20], 1
je 0x4110f1
test bh, bh
je 0x4110f9
mov byte [esp + 0x178], 0
test bl, bl
jne 0x411113
mov ecx, esi
call fcn.00414b50
mov edx, dword [esp + 0x170]
mov bl, al
mov byte [esp + 0x20], bl
jmp 0x411132
mov edx, dword [esp + 0x170]
test dx, dx
jne 0x411132
xor dl, dl
mov cl, bl
call fcn.00414720
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 [0x4dea20], 2
mov dword [esp + 0x30], ecx
jne case.default.0x41115c
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x41115c
jmp dword [eax*4 + 0x411750]
mov bl, 0x11
jmp 0x41116d
mov bl, 0x10
jmp 0x41116d
mov bl, 0x12
mov byte [esp + 0x20], bl
mov edi, dword [esp + 0x174]
test edi, edi
je 0x4112aa
push 0
mov cl, bl
call fcn.00413a30
add esp, 4
test al, al
je 0x411244
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardState]
test ebp, ebp
jne 0x4111ad
movzx eax, bl
or byte [esp + eax + 0x38], 0x80
jmp 0x4111ba
cmp ebp, 1
jne 0x4111ba
movzx eax, bl
and byte [esp + eax + 0x38], 0x7f
movzx eax, bl
add eax, 0xffffff60
cmp eax, 5
ja case.default.0x4111c7
jmp dword [eax*4 + 0x411768]
test byte [esp + 0xda], 0x80
jne 0x4111e9
test byte [esp + 0xdb], 0x80
jne 0x4111e9
and byte [esp + 0x49], 0x7f
jmp case.default.0x4111c7
or byte [esp + 0x49], 0x80
jmp case.default.0x4111c7
test byte [esp + 0xd8], 0x80
jne 0x41120b
test byte [esp + 0xd9], 0x80
jne 0x41120b
and byte [esp + 0x48], 0x7f
jmp case.default.0x4111c7
or byte [esp + 0x48], 0x80
jmp case.default.0x4111c7
test byte [esp + 0xdc], 0x80
jne 0x41122d
test byte [esp + 0xdd], 0x80
jne 0x41122d
and byte [esp + 0x4a], 0x7f
jmp case.default.0x4111c7
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 0x411267
mov eax, esi
or eax, 1
push eax
movzx eax, bl
push eax
push pe_nt_image_headers32
push edi
call ebp
cmp byte [esp + 0x178], 0
mov eax, dword [esp + 0x24]
je 0x41128a
cmp eax, 2
jne 0x41128a
mov ecx, dword [0x4d98d8]
mov ecx, dword [ecx + 0x64]
call fcn.00412d20
jmp 0x411292
test eax, eax
je 0x411709
or esi, 0xc0000001
movzx eax, bl
push esi
push eax
push 0x101
push edi
call ebp
jmp 0x411709
cmp byte [0x4dc474], 0
mov dword [0x4de9a8], ebp
mov byte [0x4de9ac], bl
je 0x4112ee
cmp bl, 0x12
je 0x4112ce
cmp bl, 0xa4
je 0x4112ce
cmp bl, 0xa5
jne 0x4112ee
test bh, bh
jne 0x4112ee
push 0
mov byte [esp + 0x1f], 1
call dword [sym.imp.USER32.dll_BlockInput]
mov edx, dword [esp + 0x170]
mov byte [0x4dc474], bh
jmp 0x4112f3
mov byte [esp + 0x1b], 0
test bh, bh
lea esi, [esp + 0x34]
mov eax, 0x4dea04
cmove esi, eax
mov al, byte [esp + 0x16]
mov dword [esp + 0x24], esi
cmp bl, 0xa5
jne 0x4113d8
test al, al
jne 0x4113d8
cmp dword [0x4dc440], 0
je 0x4113d8
mov byte [esp + 0x19], 1
mov byte [esp + 0x17], 1
test bh, bh
jne 0x41133d
mov edi, dword [0x4dea00]
jmp 0x41139d
call dword [sym.imp.USER32.dll_GetForegroundWindow]
xor esi, esi
test eax, eax
je 0x411385
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 0x411385
mov eax, dword [esp + 0x144]
test eax, eax
je 0x411385
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.00413d60
mov esi, dword [esp + 0x24]
mov dword [esi], eax
cmp dword [esi], 0
je 0x4113b1
mov cl, byte [esp + 0x15]
mov byte [esp + 0x17], 0
mov byte [esp + 0x18], cl
jmp 0x41141a
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 [0x4dcdbc], eax
jmp 0x411422
mov byte [esp + 0x19], 0
mov byte [esp + 0x17], 0
test al, al
je 0x41140e
push 0
mov cl, bl
call fcn.00413a30
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 0x41142f
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 0x411452
mov eax, dword [0x4dea20]
cmp eax, 2
je 0x411452
cmp dword [0x4dc440], 0
je 0x41144b
cmp eax, 1
jne 0x411452
mov byte [esp + 0x15], 1
jmp 0x411457
mov byte [esp + 0x15], 0
mov bh, byte [esp + 0x16]
cmp ebp, 1
je 0x41157d
test bh, bh
je 0x411482
push dword [esp + 0x1c]
mov cl, ch
push dword [esp + 0x34]
push edx
mov dl, bl
call fcn.004127d0
add esp, 0xc
jmp 0x411560
cmp byte [esp + 0x19], 0
je 0x41149b
mov eax, dword [0x4dcdb8]
cmp dword [esi], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4dcdb8], 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 [0x4dcdb8], 0
je 0x411560
cmp dword [0x4dcdbc], 0
mov byte [esp + 0x17], 0
je 0x411532
mov dword [0x4dcdbc], 0
xor ecx, ecx
mov eax, dword [ecx*8 + 0x4de9b0]
test eax, eax
je 0x4114f5
cmp eax, edi
je 0x411519
inc ecx
cmp ecx, 0xa
jl 0x4114e0
cmp ecx, 0xa
mov eax, 9
cmovl eax, ecx
mov dword [eax*8 + 0x4de9b0], edi
mov dword [eax*8 + 0x4de9b4], 4
mov eax, 4
jmp 0x41155e
mov eax, dword [ecx*8 + 0x4de9b4]
test eax, eax
jne 0x41155e
mov eax, 4
mov dword [ecx*8 + 0x4de9b4], eax
jmp 0x41155e
cmp byte [esp + 0x28], 0
jne 0x411560
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.00413d60
mov dword [esi], eax
cmp byte [esp + 0x15], 0
mov esi, dword [esp + 0x170]
je 0x411584
push esi
mov dl, bl
xor cl, cl
call fcn.00412ee0
add esp, 4
jmp 0x411584
mov esi, dword [esp + 0x170]
cmp byte [esp + 0x178], 0
je 0x4115b4
cmp ebp, 2
jne 0x4115b4
mov eax, dword [0x4d98d8]
cmp dword [0x4dea20], ebp
jne 0x4115aa
mov ecx, dword [eax + 0x68]
call fcn.00412d20
jmp 0x4115bc
mov ecx, dword [eax + 0x64]
call fcn.00412d20
jmp 0x4115bc
test ebp, ebp
je 0x4116f3
mov ecx, dword [esp + 0x30]
or ecx, 2
test bh, bh
je 0x4115e4
push dword [esp + 0x1c]
mov dl, bl
push ecx
mov cl, byte [esp + 0x22]
push esi
call fcn.004127d0
mov ebp, dword [esp + 0x30]
add esp, 0xc
jmp 0x4116c8
cmp byte [esp + 0x19], 0
mov ebp, dword [esp + 0x24]
je 0x411602
mov eax, dword [0x4dcdb4]
cmp dword [ebp], 3
cmove eax, dword [esp + 0x1c]
mov dword [0x4dcdb4], 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 [0x4dcdb4], 0
je 0x4116c8
cmp dword [0x4dcdbc], 0
je 0x411698
mov dword [0x4dcdbc], 0
xor eax, eax
nop
mov ecx, dword [eax*8 + 0x4de9b0]
test ecx, ecx
je 0x411655
cmp ecx, edi
je 0x41167c
inc eax
cmp eax, 0xa
jl 0x411640
cmp eax, 0xa
mov ecx, 9
cmovl ecx, eax
mov dword [ecx*8 + 0x4de9b0], edi
mov dword [ecx*8 + 0x4de9b4], 4
mov ecx, 4
mov dword [ebp], ecx
jmp 0x4116c8
mov ecx, dword [eax*8 + 0x4de9b4]
test ecx, ecx
jne 0x411677
mov ecx, 4
mov dword [eax*8 + 0x4de9b4], ecx
mov dword [ebp], ecx
jmp 0x4116c8
cmp byte [esp + 0x28], 0
je 0x4116c8
movzx eax, byte [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ecx, 0x8000
mov edx, 0
test cx, ax
mov ecx, edi
setne dl
add edx, 3
call fcn.00413d60
mov dword [ebp], eax
cmp dword [ebp], 0
je 0x4116df
mov eax, 0x138
cmp si, ax
jne 0x4116df
and byte [0x4dea14], 0xfe
cmp byte [esp + 0x15], 0
je 0x4116f3
push esi
mov dl, bl
mov cl, 1
call fcn.00412ee0
add esp, 4
cmp byte [esp + 0x1b], 0
je 0x411709
push 1
call dword [sym.imp.USER32.dll_BlockInput]
mov byte [0x4dc474], 1
cmp byte [esp + 0x178], 0
je 0x411745
cmp dword [0x4dea20], 2
mov eax, dword [0x4d98d8]
jne 0x411733
mov ecx, dword [eax + 0x60]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.00412d20
mov ecx, dword [eax + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
jmp fcn.00412d20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret