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

Disassembly:
sub esp, 0x164
push ebx
push ebp
push esi
mov esi, dword [0x4acaf8]
push edi
mov byte [esp + 0x1f], 0
test esi, esi
je 0x406b85
lea ecx, [ecx]
cmp dword [esi], 1
jne 0x406b7a
mov al, byte [esi + 0x3c]
test al, al
je 0x406ad9
mov ecx, dword [esp + 0x178]
mov ecx, dword [ecx + 0x10]
lea edx, [ecx + 0x3c2c17]
cmp edx, 0x66
ja 0x406ad9
dec al
movzx eax, al
mov edx, 0xffc3d44d
sub edx, ecx
cmp edx, eax
jle 0x406b7a
cmp byte [esp + 0x184], 0
je 0x406b6f
mov eax, dword [esi + 8]
test eax, eax
je 0x406b42
cmp dword [eax + 0x364], 0
je 0x406b42
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 0x406b28
cmp byte [esi + 0x42], 0
je 0x406b50
test cl, 0x40
jne 0x406b50
shl eax, 0x10
or eax, edi
push eax
mov eax, dword [0x4ac2ec]
push esi
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x406b50
mov bl, byte [esp + 0x17c]
mov ebp, dword [esp + 0x180]
movzx ecx, bp
test byte [ecx + esi + 0x150], 0x80
jne 0x406d02
movzx edx, bl
test byte [edx + esi + 0x50], 0x80
jne 0x406d21
cmp byte [esi + 0x3f], 0
je 0x406b7a
mov byte [esp + 0x1f], 1
mov esi, dword [esi + 4]
test esi, esi
jne 0x406aa0
cmp byte [esp + 0x184], 0
jne 0x406fa0
mov al, byte [0x4ac2e9]
mov byte [esp + 0x18], 1
test al, 0xcf
je 0x406bb5
cmp byte [esp + 0x1f], 0
jne 0x406bb5
test al, 0xc
je 0x406bb0
test al, 3
jne 0x406bb5
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 0x406bfa
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 0x406bfa
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x406bfa
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
cmp dword [0x4adaac], ebx
je 0x406c3a
push 0x1c
lea eax, [esp + 0x28]
push eax
push ebx
mov dword [0x4adaac], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea ecx, [esp + 0x24]
push str.ApplicationFrameWindow
push ecx
call fcn.004873c1
add esp, 8
test eax, eax
sete byte [0x4adaa8]
mov bl, byte [0x4adaa0]
xor edx, edx
mov ecx, 0x40
mov esi, 0x4ac310
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 0x406cde
cmp byte [0x4adaa8], dl
je 0x406cde
cmp byte [esp + 0x17c], 0xe7
je 0x406cde
mov al, byte [0x4adaa6]
mov cl, byte [0x4adaa7]
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.00412cc0
push ebp
push 0
lea edx, [esp + 0x1c]
push edx
mov eax, ecx
movzx ecx, word [0x4adaa4]
push eax
movzx edx, bl
push ecx
push edx
call edi
test eax, eax
jle 0x406cd7
movzx edx, word [0x4adaa4]
push ebp
push 0
lea eax, [esp + 0x1c]
push eax
movzx eax, byte [0x4adaa0]
lea ecx, [esp + 0x7c]
push ecx
push edx
push eax
call edi
mov byte [0x4adaa0], 0
mov al, byte [0x4ac2e9]
lea ecx, [esp + 0x70]
call fcn.00412cc0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406d3a
or byte [esp + 0x84], 1
jmp 0x406d42
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 0x406d77
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 0x406deb
cmp byte [esp + 0x18], 0
je 0x406dcb
xor eax, eax
cmp dword [0x4ac488], 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 [0x4ac2e9], 3
mov esi, eax
jne 0x406dcd
mov al, 0xd
mov cl, 0xa
cmp byte [esp + 0x14], al
jne 0x406dbf
mov byte [esp + 0x14], cl
cmp byte [esp + 0x15], al
jne 0x406dcd
mov byte [esp + 0x15], cl
jmp 0x406dcd
xor esi, esi
cmp bl, 8
jne 0x406deb
test esi, esi
je 0x406deb
cmp byte [0x4adaa8], 0
je 0x406dea
xor esi, esi
mov byte [0x4adaa0], 0
jmp 0x406deb
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.00407380
add esp, 0x14
test al, al
je 0x406d14
cmp byte [0x4adaa0], 0
je 0x406e24
mov byte [esp + 0x18], 1
test esi, esi
jg 0x406e2b
mov byte [esp + 0x18], 0
test esi, esi
jns 0x406e9c
mov ax, word [esp + 0x180]
mov word [0x4adaa4], ax
mov al, byte [0x4ac2e9]
test al, 0x30
setne cl
mov byte [0x4adaa0], bl
mov byte [0x4adaa6], cl
test al, 3
je 0x406e60
mov byte [0x4adaa7], 1
test al, 0xc
jne 0x406e67
mov byte [0x4adaa7], 0
xor edx, edx
cmp dword [0x4ac488], 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 [0x4acb6c], 0
je 0x406f3e
cmp byte [esp + 0x188], 0
jne 0x406f3e
cmp bl, 8
je 0x406ee2
cmp bl, 0x20
jbe 0x406f01
cmp bl, 0x28
ja 0x406f01
cmp dword [0x4ab0a4], 0
je 0x406f01
mov byte [0x4ab0a8], 0
mov dword [0x4ab0a4], 0
jmp 0x406f01
cmp byte [0x4ac2e9], 0
jne 0x406f01
mov eax, dword [0x4ab0a4]
test eax, eax
je 0x406f01
dec eax
mov dword [0x4ab0a4], eax
mov byte [eax + 0x4ab0a8], 0
test esi, esi
jle 0x406f3e
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.00406fb0
add esp, 0x14
test al, al
je 0x406d14
cmp byte [esp + 0x18], 0
je 0x406fa0
push 0x100
lea eax, [esp + 0x74]
push 0
push eax
call fcn.004905a0
mov al, byte [0x4adaa6]
mov cl, byte [0x4adaa7]
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.00412cc0
push ebp
push 0
lea edx, [esp + 0x20]
push edx
movzx edx, byte [0x4adaa0]
mov eax, ecx
movzx ecx, word [0x4adaa4]
push eax
push ecx
push edx
call edi
mov byte [0x4adaa0], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x164
ret