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

Disassembly:
mov eax, dword [0x4cad6c]
sub esp, 0x178
push ebx
xor bl, bl
push esi
test eax, eax
je 0x406d32
cmp dword [eax], 1
jne 0x406d2b
mov cl, byte [eax + 0x3c]
test cl, cl
je 0x406cf4
mov edx, dword [esp + 0x184]
mov edx, dword [edx + 0x10]
lea esi, [edx + 0x3c2c17]
cmp esi, 0x66
ja 0x406cf4
dec cl
movzx ecx, cl
mov esi, 0xffc3d44d
sub esi, edx
cmp esi, ecx
jle 0x406d2b
cmp byte [esp + 0x190], 0
je 0x406d23
mov ecx, dword [esp + 0x18c]
movzx edx, cx
test byte [edx + eax + 0x154], 0x80
jne 0x406d47
mov cl, byte [esp + 0x188]
movzx edx, cl
test byte [edx + eax + 0x54], 0x80
jne 0x406d64
cmp byte [eax + 0x3f], 0
je 0x406d2b
mov bl, 1
mov eax, dword [eax + 4]
test eax, eax
jne 0x406cc3
cmp byte [esp + 0x190], 0
je 0x406d7b
pop esi
mov al, 1
pop ebx
add esp, 0x178
ret
movzx ecx, cx
and byte [ecx + eax + 0x154], 0x7f
lea eax, [ecx + eax + 0x154]
pop esi
xor al, al
pop ebx
add esp, 0x178
ret
movzx edx, cl
and byte [edx + eax + 0x54], 0x7f
lea eax, [edx + eax + 0x54]
pop esi
xor al, al
pop ebx
add esp, 0x178
ret
mov al, byte [0x4ca561]
mov byte [esp + 0xb], 1
test al, 0xcf
je 0x406d9a
test bl, bl
jne 0x406d9a
test al, 0xc
je 0x406d95
test al, 3
jne 0x406d9a
mov byte [esp + 0xb], 0
push edi
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebx, eax
xor esi, esi
mov dword [esp + 0x18], ebx
test ebx, ebx
je 0x406de0
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebx
call edi
mov esi, eax
lea eax, [esp + 0x1c]
push eax
push esi
mov dword [esp + 0x24], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x406de0
mov eax, dword [esp + 0x28]
test eax, eax
je 0x406de0
push 0
push eax
call edi
mov esi, eax
push ebp
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
cmp dword [0x4cc1fc], ebx
je 0x406e27
push 0x1c
lea ecx, [esp + 0x154]
push ecx
push ebx
mov dword [0x4cc1fc], ebx
call dword [sym.imp.USER32.dll_GetClassNameW]
lea edx, [esp + 0x150]
push str.ApplicationFrameWindow
push edx
call fcn.0048fa69
add esp, 8
test eax, eax
sete byte [0x4cc1f8]
mov bl, byte [0x4cc1f0]
xor eax, eax
mov ecx, 0x40
mov esi, 0x4ca588
lea edi, [esp + 0x50]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [sym.imp.USER32.dll_ToUnicodeEx]
mov word [esp + 0x14], ax
mov dword [esp + 0x16], eax
test bl, bl
je 0x406ece
cmp byte [0x4cc1f8], al
je 0x406ece
cmp byte [esp + 0x190], 0xe7
je 0x406ece
mov al, byte [0x4cc1f6]
mov cl, byte [0x4cc1f7]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x50]
call fcn.00413260
push ebp
push 0
push 2
lea edx, [esp + 0x20]
push edx
mov eax, ecx
movzx ecx, word [0x4cc1f4]
push eax
movzx edx, bl
push ecx
push edx
call edi
test eax, eax
jle 0x406ec7
movzx edx, word [0x4cc1f4]
push ebp
push 0
push 2
lea eax, [esp + 0x20]
push eax
movzx eax, byte [0x4cc1f0]
lea ecx, [esp + 0x60]
push ecx
push edx
push eax
call edi
mov byte [0x4cc1f0], 0
mov al, byte [0x4ca561]
lea ecx, [esp + 0x50]
call fcn.00413260
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406eef
or byte [esp + 0x64], 1
jmp 0x406ef4
and byte [esp + 0x64], 0xfe
mov ebx, dword [esp + 0x190]
cmp bl, 0xe7
jne 0x406f1a
mov ecx, dword [esp + 0x18c]
mov dx, word [ecx + 4]
mov esi, 1
mov word [esp + 0x14], dx
jmp 0x406f9f
cmp byte [esp + 0x13], 0
je 0x406f7f
xor eax, eax
cmp dword [0x4ca6fc], eax
push ebp
setne al
lea ecx, [esp + 0x18]
lea edx, [esp + 0x54]
push eax
mov eax, dword [esp + 0x194]
push 2
push ecx
mov ecx, dword [eax + 4]
push edx
movzx edx, bl
push ecx
push edx
call edi
test byte [0x4ca561], 3
mov esi, eax
jne 0x406f81
mov eax, 0xd
cmp word [esp + 0x14], ax
jne 0x406f6c
mov ecx, 0xa
mov word [esp + 0x14], cx
cmp word [esp + 0x16], ax
jne 0x406f81
mov edx, 0xa
mov word [esp + 0x16], dx
jmp 0x406f81
xor esi, esi
cmp bl, 8
jne 0x406f9f
test esi, esi
je 0x406f9f
cmp byte [0x4cc1f8], 0
je 0x406f9e
xor esi, esi
mov byte [0x4cc1f0], 0
jmp 0x406f9f
dec esi
mov ecx, dword [esp + 0x194]
mov edx, dword [esp + 0x18c]
push esi
lea eax, [esp + 0x18]
push eax
push ecx
push ebx
push edx
call fcn.00407590
add esp, 0x14
test al, al
je 0x4070f1
cmp byte [0x4cc1f0], 0
je 0x406fd8
mov byte [esp + 0x13], 1
test esi, esi
jg 0x406fdf
mov byte [esp + 0x13], 0
test esi, esi
jns 0x407052
mov ax, word [esp + 0x194]
mov word [0x4cc1f4], ax
mov al, byte [0x4ca561]
test al, 0x30
setne cl
mov byte [0x4cc1f0], bl
mov byte [0x4cc1f6], cl
test al, 3
je 0x407014
mov byte [0x4cc1f7], 1
test al, 0xc
jne 0x40701b
mov byte [0x4cc1f7], 0
xor edx, edx
cmp dword [0x4ca6fc], edx
push ebp
setne dl
lea eax, [esp + 0x18]
lea ecx, [esp + 0x54]
push edx
mov edx, dword [esp + 0x194]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
movzx ecx, bl
push eax
push ecx
call edi
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
add esp, 0x178
ret
cmp dword [0x4cade0], 0
je 0x4070fe
cmp byte [esp + 0x19c], 0
jne 0x4070fe
cmp bl, 8
je 0x407096
cmp bl, 0x20
jbe 0x4070b8
cmp bl, 0x28
ja 0x4070b8
cmp dword [0x4c92c4], 0
je 0x4070b8
xor edx, edx
mov word [0x4c92c8], dx
mov dword [0x4c92c4], edx
jmp 0x4070b8
cmp byte [0x4ca561], 0
jne 0x4070b8
mov eax, dword [0x4c92c4]
test eax, eax
je 0x4070b8
dec eax
xor ecx, ecx
mov dword [0x4c92c4], eax
mov word [eax*2 + 0x4c92c8], cx
test esi, esi
jle 0x4070fe
mov edx, dword [esp + 0x1a8]
mov eax, dword [esp + 0x1a4]
mov ecx, dword [esp + 0x1a0]
push edx
mov edx, dword [esp + 0x190]
push eax
mov eax, dword [esp + 0x24]
push ecx
push esi
push edx
lea ecx, [esp + 0x28]
call fcn.00407170
add esp, 0x14
test al, al
jne 0x4070fe
pop ebp
pop edi
pop esi
xor al, al
pop ebx
add esp, 0x178
ret
cmp byte [esp + 0x13], 0
je 0x407162
push 0x100
lea eax, [esp + 0x54]
push 0
push eax
call fcn.00498940
mov al, byte [0x4cc1f6]
mov cl, byte [0x4cc1f7]
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 + 0x50]
call fcn.00413260
push ebp
push 0
push 2
lea edx, [esp + 0x28]
push edx
movzx edx, byte [0x4cc1f0]
mov eax, ecx
movzx ecx, word [0x4cc1f4]
push eax
push ecx
push edx
call edi
mov byte [0x4cc1f0], 0
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
add esp, 0x178
ret