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

Disassembly:
mov eax, dword [0x4acad4]
sub esp, 0x15c
push ebx
push ebp
push esi
xor bl, bl
push edi
test eax, eax
je 0x40699c
cmp dword [eax], 1
jne 0x406995
mov cl, byte [eax + 0x3c]
test cl, cl
je 0x406956
mov edx, dword [esp + 0x170]
mov edx, dword [edx + 0x10]
lea esi, [edx + 0x3c2c17]
cmp esi, 0x66
ja 0x406956
dec cl
movzx ecx, cl
mov esi, 0xffc3d44d
sub esi, edx
cmp esi, ecx
jle 0x406995
cmp byte [esp + 0x17c], 0
je 0x40698d
mov ecx, dword [esp + 0x178]
movzx edx, cx
test byte [edx + eax + 0x150], 0x80
jne 0x406b13
mov cl, byte [esp + 0x174]
movzx edx, cl
test byte [edx + eax + 0x50], 0x80
jne 0x406b32
cmp byte [eax + 0x3f], 0
je 0x406995
mov bl, 1
mov eax, dword [eax + 4]
test eax, eax
jne 0x406925
cmp byte [esp + 0x17c], 0
jne 0x406dae
mov al, byte [0x4ac2c9]
mov byte [esp + 0x14], 1
test al, 0xcf
je 0x4069c9
test bl, bl
jne 0x4069c9
test al, 0xc
je 0x4069c4
test al, 3
jne 0x4069c9
mov byte [esp + 0x14], 0
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebx, eax
xor esi, esi
mov dword [esp + 0x18], ebx
test ebx, ebx
je 0x406a0e
mov edi, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push ebx
call edi
mov esi, eax
lea eax, [esp + 0x38]
push eax
push esi
mov dword [esp + 0x40], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x406a0e
mov eax, dword [esp + 0x44]
test eax, eax
je 0x406a0e
push 0
push eax
call edi
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
cmp dword [0x4ada8c], ebx
je 0x406a4e
push 0x1c
lea ecx, [esp + 0x20]
push ecx
push ebx
mov dword [0x4ada8c], ebx
call dword [sym.imp.USER32.dll_GetClassNameA]
lea edx, [esp + 0x1c]
push str.ApplicationFrameWindow
push edx
call fcn.004870c1
add esp, 8
test eax, eax
sete byte [0x4ada88]
mov bl, byte [0x4ada80]
xor eax, eax
mov ecx, 0x40
mov esi, 0x4ac2f0
lea edi, [esp + 0x68]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [sym.imp.USER32.dll_ToAsciiEx]
mov byte [esp + 0x10], 0
mov word [esp + 0x11], ax
test bl, bl
je 0x406af2
cmp byte [0x4ada88], al
je 0x406af2
cmp byte [esp + 0x174], 0xe7
je 0x406af2
mov al, byte [0x4ada86]
mov cl, byte [0x4ada87]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x68]
call fcn.00412af0
push ebp
push 0
lea edx, [esp + 0x18]
push edx
mov eax, ecx
movzx ecx, word [0x4ada84]
push eax
movzx edx, bl
push ecx
push edx
call edi
test eax, eax
jle 0x406aeb
movzx edx, word [0x4ada84]
push ebp
push 0
lea eax, [esp + 0x18]
push eax
movzx eax, byte [0x4ada80]
lea ecx, [esp + 0x74]
push ecx
push edx
push eax
call edi
mov byte [0x4ada80], 0
mov al, byte [0x4ac2c9]
lea ecx, [esp + 0x68]
call fcn.00412af0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406b4b
or byte [esp + 0x7c], 1
jmp 0x406b50
movzx ecx, cx
and byte [ecx + eax + 0x150], 0x7f
lea eax, [ecx + eax + 0x150]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret
movzx edx, cl
and byte [edx + eax + 0x50], 0x7f
lea eax, [edx + eax + 0x50]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x15c
ret
and byte [esp + 0x7c], 0xfe
mov ebx, dword [esp + 0x174]
cmp bl, 0xe7
jne 0x406b85
mov edx, dword [esp + 0x170]
push 0
push 0
push 3
lea ecx, [esp + 0x1c]
push ecx
push 1
add edx, 4
push edx
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
jmp 0x406bf9
cmp byte [esp + 0x14], 0
je 0x406bd9
xor eax, eax
cmp dword [0x4ac464], eax
push ebp
setne al
lea ecx, [esp + 0x14]
lea edx, [esp + 0x6c]
push eax
mov eax, dword [esp + 0x178]
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 0x406bdb
mov al, 0xd
mov cl, 0xa
cmp byte [esp + 0x10], al
jne 0x406bcd
mov byte [esp + 0x10], cl
cmp byte [esp + 0x11], al
jne 0x406bdb
mov byte [esp + 0x11], cl
jmp 0x406bdb
xor esi, esi
cmp bl, 8
jne 0x406bf9
test esi, esi
je 0x406bf9
cmp byte [0x4ada88], 0
je 0x406bf8
xor esi, esi
mov byte [0x4ada80], 0
jmp 0x406bf9
dec esi
mov ecx, dword [esp + 0x178]
mov edx, dword [esp + 0x170]
push esi
lea eax, [esp + 0x14]
push eax
push ecx
push ebx
push edx
call fcn.00407190
add esp, 0x14
test al, al
je 0x406b25
cmp byte [0x4ada80], 0
je 0x406c32
mov byte [esp + 0x14], 1
test esi, esi
jg 0x406c39
mov byte [esp + 0x14], 0
test esi, esi
jns 0x406caa
mov ax, word [esp + 0x178]
mov word [0x4ada84], ax
mov al, byte [0x4ac2c9]
test al, 0x30
setne cl
mov byte [0x4ada80], bl
mov byte [0x4ada86], cl
test al, 3
je 0x406c6e
mov byte [0x4ada87], 1
test al, 0xc
jne 0x406c75
mov byte [0x4ada87], 0
xor edx, edx
cmp dword [0x4ac464], edx
push ebp
setne dl
lea eax, [esp + 0x14]
lea ecx, [esp + 0x6c]
push edx
mov edx, dword [esp + 0x178]
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, 0x15c
ret
cmp dword [0x4acb48], 0
je 0x406d4c
cmp byte [esp + 0x180], 0
jne 0x406d4c
cmp bl, 8
je 0x406cf0
cmp bl, 0x20
jbe 0x406d0f
cmp bl, 0x28
ja 0x406d0f
cmp dword [0x4ab084], 0
je 0x406d0f
mov byte [0x4ab088], 0
mov dword [0x4ab084], 0
jmp 0x406d0f
cmp byte [0x4ac2c9], 0
jne 0x406d0f
mov eax, dword [0x4ab084]
test eax, eax
je 0x406d0f
dec eax
mov dword [0x4ab084], eax
mov byte [eax + 0x4ab088], 0
test esi, esi
jle 0x406d4c
mov edx, dword [esp + 0x18c]
mov eax, dword [esp + 0x188]
mov ecx, dword [esp + 0x184]
push edx
mov edx, dword [esp + 0x174]
push eax
mov eax, dword [esp + 0x20]
push ecx
push esi
push edx
lea ecx, [esp + 0x24]
call fcn.00406dc0
add esp, 0x14
test al, al
je 0x406b25
cmp byte [esp + 0x14], 0
je 0x406dae
push 0x100
lea eax, [esp + 0x6c]
push 0
push eax
call fcn.00490580
mov al, byte [0x4ada86]
mov cl, byte [0x4ada87]
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 + 0x68]
call fcn.00412af0
push ebp
push 0
lea edx, [esp + 0x1c]
push edx
movzx edx, byte [0x4ada80]
mov eax, ecx
movzx ecx, word [0x4ada84]
push eax
push ecx
push edx
call edi
mov byte [0x4ada80], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x15c
ret