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

Disassembly:
sub esp, 0x17c
push ebx
push ebp
push esi
mov esi, dword [0x4d9eac]
push edi
mov byte [esp + 0x13], 0
test esi, esi
je 0x40c36c
lea ecx, [ecx]
cmp dword [esi], 1
jne 0x40c361
mov al, byte [esi + 0x3c]
test al, al
je 0x40c2c0
mov ecx, dword [esp + 0x190]
mov ecx, dword [ecx + 0x10]
lea edx, [ecx + 0x3c2c17]
dec al
cmp edx, 0x66
ja 0x40c2b0
mov edx, 0xffc3d44d
sub edx, ecx
jmp 0x40c2b5
mov edx, 0x65
movzx eax, al
cmp edx, eax
jle 0x40c361
cmp byte [esp + 0x19c], 0
je 0x40c356
mov eax, dword [esi + 8]
test eax, eax
je 0x40c329
cmp dword [eax + 0x368], 0
je 0x40c329
mov ebp, dword [esp + 0x198]
mov bl, byte [esp + 0x194]
movzx eax, bp
mov dl, byte [eax + esi + 0x154]
movzx edi, bl
mov cl, byte [edi + esi + 0x54]
or dl, cl
test dl, 0x20
jne 0x40c30f
cmp byte [esi + 0x42], 0
je 0x40c337
test cl, 0x40
jne 0x40c337
shl eax, 0x10
or eax, edi
push eax
mov eax, dword [0x4d96a0]
push esi
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x40c337
mov bl, byte [esp + 0x194]
mov ebp, dword [esp + 0x198]
movzx ecx, bp
test byte [ecx + esi + 0x154], 0x80
jne 0x40c4e9
movzx edx, bl
test byte [edx + esi + 0x54], 0x80
jne 0x40c508
cmp byte [esi + 0x3f], 0
je 0x40c361
mov byte [esp + 0x13], 1
mov esi, dword [esi + 4]
test esi, esi
jne 0x40c280
cmp byte [esp + 0x19c], 0
jne 0x40c83e
mov al, byte [0x4d969d]
mov byte [esp + 0x12], 1
test al, 0xcf
je 0x40c39c
cmp byte [esp + 0x13], 0
jne 0x40c39c
test al, 0xc
je 0x40c397
test al, 3
jne 0x40c39c
mov byte [esp + 0x12], 0
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov edi, eax
xor esi, esi
mov dword [esp + 0x20], edi
test edi, edi
je 0x40c3ea
mov ebx, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push edi
call ebx
lea edx, [esp + 0x124]
mov esi, eax
push edx
push esi
mov dword [esp + 0x12c], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x40c3ea
mov eax, dword [esp + 0x130]
test eax, eax
je 0x40c3ea
push 0
push eax
call ebx
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
mov dword [esp + 0x1c], ebp
cmp dword [0x4db3c4], edi
je 0x40c434
push 0x1c
lea eax, [esp + 0x158]
push eax
push edi
mov dword [0x4db3c4], edi
call dword [sym.imp.USER32.dll_GetClassNameW]
lea ecx, [esp + 0x154]
push str.ApplicationFrameWindow
push ecx
call fcn.00499499
add esp, 8
test eax, eax
sete byte [0x4db3c0]
mov bl, byte [0x4db3b8]
xor edx, edx
mov ecx, 0x40
mov esi, 0x4d96c8
lea edi, [esp + 0x24]
mov word [esp + 0x14], dx
mov dword [esp + 0x16], edx
rep movsd dword es:[edi], dword [esi]
test bl, bl
je 0x40c521
cmp byte [0x4db3c0], dl
je 0x40c521
cmp byte [esp + 0x194], 0xe7
je 0x40c521
mov al, byte [0x4db3be]
mov cl, byte [0x4db3bf]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x24]
call fcn.00418aa0
mov esi, dword [sym.imp.USER32.dll_ToUnicodeEx]
push ebp
push 0
push 2
lea edx, [esp + 0x20]
push edx
mov eax, ecx
movzx ecx, word [0x4db3bc]
push eax
movzx edx, bl
push ecx
push edx
call esi
test eax, eax
jle 0x40c4e0
movzx edx, word [0x4db3bc]
push ebp
push 0
push 2
lea eax, [esp + 0x20]
push eax
movzx eax, byte [0x4db3b8]
lea ecx, [esp + 0x34]
push ecx
push edx
push eax
call esi
mov byte [0x4db3b8], 0
jmp 0x40c527
movzx eax, bp
and byte [eax + esi + 0x154], 0x7f
lea esi, [eax + esi + 0x154]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x17c
ret
movzx ecx, bl
and byte [ecx + esi + 0x54], 0x7f
lea esi, [ecx + esi + 0x54]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x17c
ret
mov esi, dword [sym.imp.USER32.dll_ToUnicodeEx]
mov al, byte [0x4d969d]
lea ecx, [esp + 0x24]
call fcn.00418aa0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40c548
or byte [esp + 0x38], 1
jmp 0x40c54d
and byte [esp + 0x38], 0xfe
mov ebx, dword [esp + 0x194]
cmp bl, 0xe7
jne 0x40c573
mov ebp, dword [esp + 0x190]
mov cx, word [ebp + 4]
mov edi, 1
mov word [esp + 0x14], cx
jmp 0x40c608
cmp byte [esp + 0x12], 0
je 0x40c5d8
xor edx, edx
cmp dword [0x4d9838], edx
push ebp
setne dl
lea eax, [esp + 0x18]
lea ecx, [esp + 0x28]
push edx
mov edx, dword [esp + 0x198]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
movzx ecx, bl
push eax
push ecx
call esi
test byte [0x4d969d], 3
mov edi, eax
jne 0x40c5da
mov eax, 0xd
cmp word [esp + 0x14], ax
jne 0x40c5c5
mov edx, 0xa
mov word [esp + 0x14], dx
cmp word [esp + 0x16], ax
jne 0x40c5da
mov eax, 0xa
mov word [esp + 0x16], ax
jmp 0x40c5da
xor edi, edi
cmp bl, 8
jne 0x40c601
test edi, edi
je 0x40c601
cmp byte [0x4db3c0], 0
mov ebp, dword [esp + 0x190]
je 0x40c5fe
xor edi, edi
mov byte [0x4db3b8], 0
jmp 0x40c608
dec edi
jmp 0x40c608
mov ebp, dword [esp + 0x190]
mov esi, dword [esp + 0x198]
push edi
lea ecx, [esp + 0x18]
push ecx
push esi
push ebx
push ebp
call fcn.0040cc60
add esp, 0x14
test al, al
je 0x40c4fb
cmp byte [0x4db3b8], 0
je 0x40c63a
mov byte [esp + 0x12], 1
test edi, edi
jg 0x40c641
mov byte [esp + 0x12], 0
test edi, edi
jns 0x40c6ae
mov al, byte [0x4d969d]
test al, 0x30
setne dl
mov byte [0x4db3b8], bl
mov word [0x4db3bc], si
mov byte [0x4db3be], dl
test al, 3
je 0x40c66f
mov byte [0x4db3bf], 1
test al, 0xc
jne 0x40c676
mov byte [0x4db3bf], 0
mov eax, dword [esp + 0x1c]
xor ecx, ecx
cmp dword [0x4d9838], ecx
push eax
setne cl
lea edx, [esp + 0x18]
lea eax, [esp + 0x28]
push ecx
mov ecx, dword [ebp + 4]
push 2
push edx
push eax
movzx edx, bl
push ecx
push edx
call dword [sym.imp.USER32.dll_ToUnicodeEx]
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17c
ret
cmp dword [0x4d9f1c], 0
je 0x40c74f
cmp byte [esp + 0x1a0], 0
jne 0x40c74f
cmp bl, 8
je 0x40c6eb
cmp bl, 0x20
jbe 0x40c70d
cmp bl, 0x28
ja 0x40c70d
cmp dword [0x4d83f4], 0
je 0x40c70d
xor eax, eax
mov word [0x4d83f8], ax
jmp 0x40c708
cmp byte [0x4d969d], 0
jne 0x40c70d
mov eax, dword [0x4d83f4]
test eax, eax
je 0x40c70d
dec eax
xor ecx, ecx
mov word [eax*2 + 0x4d83f8], cx
mov dword [0x4d83f4], eax
test edi, edi
jle 0x40c74f
mov edx, dword [esp + 0x1ac]
mov eax, dword [esp + 0x1a8]
mov ecx, dword [esp + 0x1a4]
push edx
push eax
mov eax, dword [esp + 0x28]
push ecx
push edi
push ebp
lea ecx, [esp + 0x28]
call fcn.0040c850
add esp, 0x14
test al, al
jne 0x40c74f
pop edi
pop esi
pop ebp
mov byte [0x4db3b8], al
pop ebx
add esp, 0x17c
ret
cmp byte [esp + 0x12], 0
je 0x40c83e
mov edx, dword [esp + 0x1c]
xor eax, eax
cmp dword [0x4d9838], eax
push edx
setne al
lea ecx, [esp + 0x24]
lea edx, [esp + 0x28]
movzx esi, bl
push eax
mov eax, dword [ebp + 4]
push 2
push ecx
push edx
push eax
push esi
call dword [sym.imp.USER32.dll_ToUnicodeEx]
mov ebp, eax
test ebp, ebp
jns 0x40c7ba
mov ecx, dword [esp + 0x1c]
xor edx, edx
cmp dword [0x4d9838], edx
push ecx
setne dl
lea eax, [esp + 0x24]
lea ecx, [esp + 0x28]
push edx
mov edx, dword [esp + 0x198]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
push eax
push esi
call dword [sym.imp.USER32.dll_ToUnicodeEx]
cmp ebp, edi
jne 0x40c7db
mov eax, dword [esp + 0x20]
cmp ax, 0xd
jne 0x40c7cf
mov eax, 0xa
jmp 0x40c7d2
movzx eax, ax
movzx ecx, word [esp + 0x14]
cmp ecx, eax
je 0x40c83e
push pe_nt_image_headers32
lea edx, [esp + 0x28]
push 0
push edx
call fcn.004a43b0
mov al, byte [0x4db3be]
mov cl, byte [0x4db3bf]
add esp, 0xc
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x24]
call fcn.00418aa0
mov edx, dword [esp + 0x1c]
push edx
movzx edx, word [0x4db3bc]
push 0
push 2
lea eax, [esp + 0x28]
push eax
movzx eax, byte [0x4db3b8]
push ecx
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
mov byte [0x4db3b8], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17c
ret