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

Disassembly:
sub esp, 0x164
push ebx
push ebp
push esi
mov esi, dword [0x4acad4]
push edi
mov byte [esp + 0x1f], 0
test esi, esi
je 0x406a35
lea ecx, [ecx]
cmp dword [esi], 1
jne 0x406a2a
mov al, byte [esi + 0x3c]
test al, al
je 0x406989
mov ecx, dword [esp + 0x178]
mov ecx, dword [ecx + 0x10]
lea edx, [ecx + 0x3c2c17]
cmp edx, 0x66
ja 0x406989
dec al
movzx eax, al
mov edx, 0xffc3d44d
sub edx, ecx
cmp edx, eax
jle 0x406a2a
cmp byte [esp + 0x184], 0
je 0x406a1f
mov eax, dword [esi + 8]
test eax, eax
je 0x4069f2
cmp dword [eax + 0x364], 0
je 0x4069f2
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 0x4069d8
cmp byte [esi + 0x42], 0
je 0x406a00
test cl, 0x40
jne 0x406a00
shl eax, 0x10
or eax, edi
push eax
mov eax, dword [0x4ac2cc]
push esi
push 0x41e
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
jmp 0x406a00
mov bl, byte [esp + 0x17c]
mov ebp, dword [esp + 0x180]
movzx ecx, bp
test byte [ecx + esi + 0x150], 0x80
jne 0x406bb2
movzx edx, bl
test byte [edx + esi + 0x50], 0x80
jne 0x406bd1
cmp byte [esi + 0x3f], 0
je 0x406a2a
mov byte [esp + 0x1f], 1
mov esi, dword [esi + 4]
test esi, esi
jne 0x406950
cmp byte [esp + 0x184], 0
jne 0x406e50
mov al, byte [0x4ac2c9]
mov byte [esp + 0x18], 1
test al, 0xcf
je 0x406a65
cmp byte [esp + 0x1f], 0
jne 0x406a65
test al, 0xc
je 0x406a60
test al, 3
jne 0x406a65
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 0x406aaa
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 0x406aaa
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x406aaa
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
cmp dword [0x4ada88], ebx
je 0x406aea
push 0x1c
lea eax, [esp + 0x28]
push eax
push ebx
mov dword [0x4ada88], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea ecx, [esp + 0x24]
push str.ApplicationFrameWindow
push ecx
call fcn.00486ea1
add esp, 8
test eax, eax
sete byte [0x4ada84]
mov bl, byte [0x4ada7c]
xor edx, edx
mov ecx, 0x40
mov esi, 0x4ac2f0
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 0x406b8e
cmp byte [0x4ada84], dl
je 0x406b8e
cmp byte [esp + 0x17c], 0xe7
je 0x406b8e
mov al, byte [0x4ada82]
mov cl, byte [0x4ada83]
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.00412b10
push ebp
push 0
lea edx, [esp + 0x1c]
push edx
mov eax, ecx
movzx ecx, word [0x4ada80]
push eax
movzx edx, bl
push ecx
push edx
call edi
test eax, eax
jle 0x406b87
movzx edx, word [0x4ada80]
push ebp
push 0
lea eax, [esp + 0x1c]
push eax
movzx eax, byte [0x4ada7c]
lea ecx, [esp + 0x7c]
push ecx
push edx
push eax
call edi
mov byte [0x4ada7c], 0
mov al, byte [0x4ac2c9]
lea ecx, [esp + 0x70]
call fcn.00412b10
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406bea
or byte [esp + 0x84], 1
jmp 0x406bf2
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 0x406c27
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 0x406c9b
cmp byte [esp + 0x18], 0
je 0x406c7b
xor eax, eax
cmp dword [0x4ac464], 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 [0x4ac2c9], 3
mov esi, eax
jne 0x406c7d
mov al, 0xd
mov cl, 0xa
cmp byte [esp + 0x14], al
jne 0x406c6f
mov byte [esp + 0x14], cl
cmp byte [esp + 0x15], al
jne 0x406c7d
mov byte [esp + 0x15], cl
jmp 0x406c7d
xor esi, esi
cmp bl, 8
jne 0x406c9b
test esi, esi
je 0x406c9b
cmp byte [0x4ada84], 0
je 0x406c9a
xor esi, esi
mov byte [0x4ada7c], 0
jmp 0x406c9b
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.00407230
add esp, 0x14
test al, al
je 0x406bc4
cmp byte [0x4ada7c], 0
je 0x406cd4
mov byte [esp + 0x18], 1
test esi, esi
jg 0x406cdb
mov byte [esp + 0x18], 0
test esi, esi
jns 0x406d4c
mov ax, word [esp + 0x180]
mov word [0x4ada80], ax
mov al, byte [0x4ac2c9]
test al, 0x30
setne cl
mov byte [0x4ada7c], bl
mov byte [0x4ada82], cl
test al, 3
je 0x406d10
mov byte [0x4ada83], 1
test al, 0xc
jne 0x406d17
mov byte [0x4ada83], 0
xor edx, edx
cmp dword [0x4ac464], 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 [0x4acb48], 0
je 0x406dee
cmp byte [esp + 0x188], 0
jne 0x406dee
cmp bl, 8
je 0x406d92
cmp bl, 0x20
jbe 0x406db1
cmp bl, 0x28
ja 0x406db1
cmp dword [0x4ab084], 0
je 0x406db1
mov byte [0x4ab088], 0
mov dword [0x4ab084], 0
jmp 0x406db1
cmp byte [0x4ac2c9], 0
jne 0x406db1
mov eax, dword [0x4ab084]
test eax, eax
je 0x406db1
dec eax
mov dword [0x4ab084], eax
mov byte [eax + 0x4ab088], 0
test esi, esi
jle 0x406dee
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.00406e60
add esp, 0x14
test al, al
je 0x406bc4
cmp byte [esp + 0x18], 0
je 0x406e50
push 0x100
lea eax, [esp + 0x74]
push 0
push eax
call fcn.00490360
mov al, byte [0x4ada82]
mov cl, byte [0x4ada83]
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.00412b10
push ebp
push 0
lea edx, [esp + 0x20]
push edx
movzx edx, byte [0x4ada7c]
mov eax, ecx
movzx ecx, word [0x4ada80]
push eax
push ecx
push edx
call edi
mov byte [0x4ada7c], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x164
ret