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

Disassembly:
sub esp, 0x164
push ebx
push ebp
push esi
mov esi, dword [0x4adaf8]
push edi
mov byte [esp + 0x1f], 0
test esi, esi
je 0x406cec
lea ecx, [ecx]
cmp dword [esi], 1
jne 0x406ce1
mov al, byte [esi + 0x3c]
test al, al
je 0x406c40
mov ecx, dword [esp + 0x178]
mov ecx, dword [ecx + 0x10]
lea edx, [ecx + 0x3c2c17]
dec al
cmp edx, 0x66
ja 0x406c30
mov edx, 0xffc3d44d
sub edx, ecx
jmp 0x406c35
mov edx, 0x65
movzx eax, al
cmp edx, eax
jle 0x406ce1
cmp byte [esp + 0x184], 0
je 0x406cd6
mov eax, dword [esi + 8]
test eax, eax
je 0x406ca9
cmp dword [eax + 0x364], 0
je 0x406ca9
mov ebp, dword [esp + 0x180]
mov bl, byte [esp + 0x17c]
movzx eax, bp
mov dl, byte [eax + esi + 0x150]
movzx edi, bl
mov cl, byte [edi + esi + 0x50]
or dl, cl
test dl, 0x20
jne 0x406c8f
cmp byte [esi + 0x42], 0
je 0x406cb7
test cl, 0x40
jne 0x406cb7
shl eax, 0x10
or eax, edi
push eax
mov eax, dword [0x4ad2ec]
push esi
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x406cb7
mov bl, byte [esp + 0x17c]
mov ebp, dword [esp + 0x180]
movzx ecx, bp
test byte [ecx + esi + 0x150], 0x80
jne 0x406e69
movzx edx, bl
test byte [edx + esi + 0x50], 0x80
jne 0x406e88
cmp byte [esi + 0x3f], 0
je 0x406ce1
mov byte [esp + 0x1f], 1
mov esi, dword [esi + 4]
test esi, esi
jne 0x406c00
cmp byte [esp + 0x184], 0
jne 0x407107
mov al, byte [0x4ad2e9]
mov byte [esp + 0x18], 1
test al, 0xcf
je 0x406d1c
cmp byte [esp + 0x1f], 0
jne 0x406d1c
test al, 0xc
je 0x406d17
test al, 3
jne 0x406d1c
mov byte [esp + 0x18], 0
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebx, eax
xor esi, esi
mov dword [esp + 0x20], ebx
test ebx, ebx
je 0x406d61
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebx
call edi
lea edx, [esp + 0x40]
mov esi, eax
push edx
push esi
mov dword [esp + 0x48], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x406d61
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x406d61
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
cmp dword [0x4aeaac], ebx
je 0x406da1
push 0x1c
lea eax, [esp + 0x28]
push eax
push ebx
mov dword [0x4aeaac], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea ecx, [esp + 0x24]
push str.ApplicationFrameWindow
push ecx
call fcn.00487791
add esp, 8
test eax, eax
sete byte [0x4aeaa8]
mov bl, byte [0x4aeaa0]
xor edx, edx
mov ecx, 0x40
mov esi, 0x4ad310
lea edi, [esp + 0x70]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [esp + 0x14], 0
mov word [esp + 0x15], dx
test bl, bl
je 0x406e45
cmp byte [0x4aeaa8], dl
je 0x406e45
cmp byte [esp + 0x17c], 0xe7
je 0x406e45
mov al, byte [0x4aeaa6]
mov cl, byte [0x4aeaa7]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x70]
call fcn.00412fb0
push ebp
push 0
lea edx, [esp + 0x1c]
push edx
mov eax, ecx
movzx ecx, word [0x4aeaa4]
push eax
movzx edx, bl
push ecx
push edx
call edi
test eax, eax
jle 0x406e3e
movzx edx, word [0x4aeaa4]
push ebp
push 0
lea eax, [esp + 0x1c]
push eax
movzx eax, byte [0x4aeaa0]
lea ecx, [esp + 0x7c]
push ecx
push edx
push eax
call edi
mov byte [0x4aeaa0], 0
mov al, byte [0x4ad2e9]
lea ecx, [esp + 0x70]
call fcn.00412fb0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406ea1
or byte [esp + 0x84], 1
jmp 0x406ea9
movzx eax, bp
and byte [eax + esi + 0x150], 0x7f
lea eax, [eax + esi + 0x150]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
movzx ecx, bl
and byte [ecx + esi + 0x50], 0x7f
lea esi, [ecx + esi + 0x50]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
and byte [esp + 0x84], 0xfe
mov ebx, dword [esp + 0x17c]
cmp bl, 0xe7
jne 0x406ede
mov edx, dword [esp + 0x178]
push 0
push 0
push 3
lea ecx, [esp + 0x20]
push ecx
push 1
add edx, 4
push edx
push 0x400
push 0
call dword [sym.imp.KERNEL32.DLL_WideCharToMultiByte]
mov esi, eax
jmp 0x406f52
cmp byte [esp + 0x18], 0
je 0x406f32
xor eax, eax
cmp dword [0x4ad488], eax
push ebp
setne al
lea ecx, [esp + 0x18]
lea edx, [esp + 0x74]
push eax
mov eax, dword [esp + 0x180]
push ecx
mov ecx, dword [eax + 4]
push edx
movzx edx, bl
push ecx
push edx
call edi
test byte [0x4ad2e9], 3
mov esi, eax
jne 0x406f34
mov al, 0xd
mov cl, 0xa
cmp byte [esp + 0x14], al
jne 0x406f26
mov byte [esp + 0x14], cl
cmp byte [esp + 0x15], al
jne 0x406f34
mov byte [esp + 0x15], cl
jmp 0x406f34
xor esi, esi
cmp bl, 8
jne 0x406f52
test esi, esi
je 0x406f52
cmp byte [0x4aeaa8], 0
je 0x406f51
xor esi, esi
mov byte [0x4aeaa0], 0
jmp 0x406f52
dec esi
mov ecx, dword [esp + 0x180]
mov edx, dword [esp + 0x178]
push esi
lea eax, [esp + 0x18]
push eax
push ecx
push ebx
push edx
call fcn.004074f0
add esp, 0x14
test al, al
je 0x406e7b
cmp byte [0x4aeaa0], 0
je 0x406f8b
mov byte [esp + 0x18], 1
test esi, esi
jg 0x406f92
mov byte [esp + 0x18], 0
test esi, esi
jns 0x407003
mov ax, word [esp + 0x180]
mov word [0x4aeaa4], ax
mov al, byte [0x4ad2e9]
test al, 0x30
setne cl
mov byte [0x4aeaa0], bl
mov byte [0x4aeaa6], cl
test al, 3
je 0x406fc7
mov byte [0x4aeaa7], 1
test al, 0xc
jne 0x406fce
mov byte [0x4aeaa7], 0
xor edx, edx
cmp dword [0x4ad488], edx
push ebp
setne dl
lea eax, [esp + 0x18]
lea ecx, [esp + 0x74]
push edx
mov edx, dword [esp + 0x180]
push eax
mov eax, dword [edx + 4]
push ecx
movzx ecx, bl
push eax
push ecx
call edi
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret
cmp dword [0x4adb6c], 0
je 0x4070a5
cmp byte [esp + 0x188], 0
jne 0x4070a5
cmp bl, 8
je 0x407049
cmp bl, 0x20
jbe 0x407068
cmp bl, 0x28
ja 0x407068
cmp dword [0x4ac0a4], 0
je 0x407068
mov byte [0x4ac0a8], 0
mov dword [0x4ac0a4], 0
jmp 0x407068
cmp byte [0x4ad2e9], 0
jne 0x407068
mov eax, dword [0x4ac0a4]
test eax, eax
je 0x407068
dec eax
mov dword [0x4ac0a4], eax
mov byte [eax + 0x4ac0a8], 0
test esi, esi
jle 0x4070a5
mov edx, dword [esp + 0x194]
mov eax, dword [esp + 0x190]
mov ecx, dword [esp + 0x18c]
push edx
mov edx, dword [esp + 0x17c]
push eax
mov eax, dword [esp + 0x28]
push ecx
push esi
push edx
lea ecx, [esp + 0x28]
call fcn.00407120
add esp, 0x14
test al, al
je 0x406e7b
cmp byte [esp + 0x18], 0
je 0x407107
push 0x100
lea eax, [esp + 0x74]
push 0
push eax
call fcn.004909b0
mov al, byte [0x4aeaa6]
mov cl, byte [0x4aeaa7]
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 + 0x70]
call fcn.00412fb0
push ebp
push 0
lea edx, [esp + 0x20]
push edx
movzx edx, byte [0x4aeaa0]
mov eax, ecx
movzx ecx, word [0x4aeaa4]
push eax
push ecx
push edx
call edi
mov byte [0x4aeaa0], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x164
ret