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

Disassembly:
mov ecx, dword [0x4c2904]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov ebp, dword [0x4c3fe8]
push edi
mov di, word [esp + 0x138]
cmp ebp, 1
jne 0x406b86
cmp byte [0x4c4014], 0
jne 0x406b86
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0xe], 0
je 0x406b8b
mov byte [esp + 0xe], 1
cmp byte [esp + 0x13c], 0
je 0x406bb9
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x407542
mov al, byte [esp + 0xe]
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4c38cc], 0
je 0x406bd1
test dl, dl
jne 0x406bd1
mov byte [esp + 0xf], 1
cmp byte [esp + 0xe], dl
jne 0x406bd6
mov byte [esp + 0xf], 0
mov al, byte [0x4c1ec5]
push esi
cmp ebp, 1
jne 0x406ca8
cmp byte [0x4c4012], 0
je 0x406bf6
test dl, dl
jne 0x406ca8
mov edx, dword [0x4c3fec]
mov esi, dword [0x4c3ff0]
movzx ecx, bl
mov cl, byte [ecx + edx]
mov byte [esp + 0x14], 1
test cl, cl
jne 0x406c1b
movzx ecx, di
mov cl, byte [ecx + esi]
test cl, cl
je 0x406c87
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x406caf
test cl, cl
jne 0x406c3e
test al, 0x30
jne 0x406c3e
test cl, cl
je 0x406c87
test al, 0x30
jne 0x406c87
movzx ecx, di
mov ebp, 4
mov dword [0x4c3fe8], ebp
cmp byte [ecx + esi], 0
mov byte [0x4c3ff4], bl
setne cl
mov byte [0x4c3ff8], cl
mov word [0x4c3ff6], di
test dl, dl
je 0x406c75
mov byte [0x4c3ff9], 1
test al, 0x30
jne 0x406c7c
mov byte [0x4c3ff9], 0
cmp byte [esp + 0x13], 0
je 0x40753d
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x406ca1.41
movzx edx, byte [ecx + 0x407558]
jmp dword [edx*4 + 0x40754c]
mov byte [esp + 0x14], 0
jmp 0x406c87
test cl, cl
je 0x406c3e
jmp 0x406c3a
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x13], 0
je case.0x406ca1.41
mov ecx, dword [0x4c0c1c]
test ecx, ecx
je 0x406cea
xor ecx, ecx
mov word [0x4c0c20], cx
mov dword [0x4c0c1c], ecx
jmp 0x406cea
mov ecx, dword [0x4c0c1c]
test al, al
je 0x406d14
cmp ebp, 1
jne 0x406cfc
cmp byte [0x4c4013], 0
jne 0x406d14
cmp al, 0x10
je 0x406d14
cmp al, 0x20
je 0x406d14
test al, 0xc
je 0x40753d
test al, 3
je 0x40753d
cmp byte [esp + 0x138], 8
jne 0x406d8f
test al, al
jne 0x406d8f
cmp byte [esp + 0x14], al
je 0x406d50
cmp ebp, 1
jne 0x406d50
cmp byte [0x4c4010], al
je 0x406d50
mov eax, dword [0x4c401c]
test eax, eax
je 0x406d50
mov esi, dword [0x4c4018]
dec eax
xor edx, edx
mov dword [0x4c401c], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x13], 0
je 0x406d6c
test ecx, ecx
je 0x406d6c
dec ecx
xor eax, eax
mov dword [0x4c0c1c], ecx
mov word [ecx*2 + 0x4c0c20], ax
cmp byte [0x4c4e90], 0
je 0x40753d
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov byte [0x4c4e90], 0
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4c1ee8
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.00411440
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406dbb
or byte [esp + 0x44], 1
jmp 0x406dc0
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x406dd7
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x406dd9
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edi, dword [sym.imp.USER32.dll_ToUnicodeEx]
xor ecx, ecx
cmp dword [0x4c2054], ecx
mov esi, eax
setne cl
push esi
lea edx, [esp + 0x1c]
lea eax, [esp + 0x34]
mov dword [esp + 0x2c], esi
push ecx
mov ecx, dword [esp + 0x13c]
push 2
push edx
mov edx, dword [ecx + 4]
push eax
push edx
push ebx
call edi
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40753d
cmp byte [0x4c4e90], 0
mov cl, byte [esp + 0x138]
je 0x406e3e
cmp cl, 9
je 0x406e3e
mov byte [esp + 0x17], 1
cmp cl, 0x1b
jne 0x406e43
mov byte [esp + 0x17], 0
test eax, eax
jns 0x406ec2
cmp byte [esp + 0x12], 0
je 0x40753d
mov ax, word [esp + 0x13c]
mov word [0x4c4e94], ax
mov al, byte [0x4c1ec5]
test al, 0x30
mov byte [0x4c4e90], cl
setne cl
mov byte [0x4c4e96], cl
test al, 3
je 0x406e85
mov byte [0x4c4e97], 1
test al, 0xc
jne 0x406e8c
mov byte [0x4c4e97], 0
xor edx, edx
cmp dword [0x4c2054], edx
push esi
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x13c]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
push eax
push ebx
call edi
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
test byte [0x4c1ec5], 3
jne 0x406ef2
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x406ee1
mov ecx, 0xa
mov word [esp + 0x18], cx
cmp word [esp + 0x1a], ax
jne 0x406ef2
mov edx, 0xa
mov word [esp + 0x1a], dx
cmp byte [esp + 0x13], 0
mov byte [esp + 0x15], 0
je 0x4072c6
cmp ebp, dword [0x4c0c18]
je 0x406f1c
xor eax, eax
mov dword [0x4c0c18], ebp
mov word [0x4c0c20], ax
xor ecx, ecx
jmp 0x406f67
mov ecx, dword [0x4c0c1c]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x406f67
mov eax, 0x4c0c7a
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406f36
sub eax, edx
sar eax, 1
mov dword [0x4c0c1c], eax
lea eax, [eax + eax + 2]
push eax
push 0x4c0c7a
push 0x4c0c20
call fcn.00489880
mov ecx, dword [0x4c0c1c]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x4c0c20], dx
inc ecx
cmp dword [esp + 0x2c], 1
mov dword [0x4c0c1c], ecx
jle 0x406f96
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x4c0c20], ax
inc ecx
mov dword [0x4c0c1c], ecx
xor edx, edx
mov word [ecx*2 + 0x4c0c20], dx
test ecx, ecx
je 0x4072c6
mov dword [esp + 0x24], edx
cmp dword [0x4c38d0], edx
jbe 0x4072c6
jmp 0x406fc0
mov eax, dword [0x4c38cc]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x27], 0
jne 0x4070e1
cmp byte [ebp + 0x2f], 0
je 0x407015
movzx eax, byte [ebp + 0x26]
cmp ecx, eax
jle 0x4070e1
movzx eax, word [ecx*2 + 0x4c0c1e]
push eax
push 0x4be410
call fcn.00489be1
add esp, 8
test eax, eax
je 0x4070db
mov ecx, dword [0x4c0c1c]
lea edi, [ecx*2 + 0x4c0c1c]
jmp 0x407028
movzx edx, byte [ebp + 0x26]
cmp ecx, edx
jl 0x4070e1
lea edi, [ecx*2 + 0x4c0c1e]
cmp byte [ebp + 0x2a], 0
movzx edx, byte [ebp + 0x26]
mov eax, dword [ebp + 4]
lea esi, [eax + edx*2 - 2]
je 0x407054
cmp esi, eax
jb 0x407090
lea ecx, [ecx]
mov dx, word [edi]
cmp dx, word [esi]
jne 0x407090
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407040
jmp 0x407090
cmp esi, eax
jb 0x407090
jmp 0x407060
movzx eax, word [esi]
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
push eax
call ebx
movzx ecx, word [edi]
push ecx
mov dword [esp + 0x24], eax
call ebx
mov ecx, dword [esp + 0x20]
cmp ax, cx
jne 0x40708a
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 4]
jae 0x407060
mov ecx, dword [0x4c0c1c]
cmp esi, dword [ebp + 4]
jae 0x4070e1
cmp byte [ebp + 0x30], 0
jne 0x4070b1
cmp edi, 0x4c0c20
jb 0x4070b1
movzx edx, word [edi]
push edx
call dword [sym.imp.USER32.dll_IsCharAlphaNumericW]
test eax, eax
jne 0x4070db
mov eax, dword [ebp]
test eax, eax
je 0x4070bc
mov eax, dword [eax]
jmp 0x4070c1
mov eax, 0x4a6b2c
mov edx, dword [ebp + 0xc]
mov bl, byte [ebp + 0x24]
push eax
mov eax, dword [ebp + 0x1c]
push eax
mov eax, dword [ebp + 0x10]
call fcn.00409380
add esp, 8
test eax, eax
jne 0x4070fb
mov ecx, dword [0x4c0c1c]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4c38d0]
jb 0x406fc0
jmp 0x4072c6
movzx edx, byte [ebp + 0x25]
mov ecx, dword [esp + 0x144]
mov eax, dword [esp + 0x134]
mov eax, dword [eax + 0x10]
add ecx, 4
push edx
call fcn.00409dd0
add esp, 4
test al, al
je 0x4072c6
xor edi, edi
cmp byte [ebp + 0x2b], 0
je 0x40720d
cmp byte [ebp + 0x2f], 0
mov ebx, dword [0x4c0c1c]
lea ebx, [ebx*2 + 0x4c0c20]
je 0x407146
sub ebx, 2
movzx ecx, byte [ebp + 0x26]
add ecx, ecx
mov esi, ebx
sub esi, ecx
mov dword [esp + 0x20], edi
mov byte [esp + 0x16], 0
mov byte [esp + 0x13], 0
cmp esi, ebx
jae 0x4071b6
mov edi, dword [sym.imp.USER32.dll_IsCharUpperW]
jmp 0x407170
movzx edx, word [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407188
movzx eax, word [esi]
push eax
call edi
test eax, eax
je 0x4071a7
cmp byte [esp + 0x16], 0
jne 0x4071a3
movzx ecx, word [esi]
push ecx
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x4071a3
mov byte [esp + 0x13], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x407170
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4071ba
xor edi, edi
jmp 0x40720d
cmp eax, 1
jne 0x4071cd
movzx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
and edi, 2
jmp 0x40720d
cmp byte [esp + 0x13], 0
jne 0x4071d8
xor edi, edi
jmp 0x40720d
movzx edx, byte [ebp + 0x26]
add edx, edx
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x407206
jmp 0x4071f0
movzx eax, word [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407204
add esi, edi
cmp esi, ebx
jb 0x4071f0
cmp esi, ebx
jne 0x40720d
mov edi, 1
mov dl, byte [ebp + 0x2c]
test dl, dl
jne 0x407219
cmp byte [ebp + 0x2d], dl
je 0x407223
mov byte [esp + 0x12], 0
mov byte [esp + 0x15], 1
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x148]
mov dword [ecx], eax
mov al, byte [ebp + 0x2f]
test al, al
je 0x407247
mov ecx, dword [0x4c0c1c]
movzx ecx, word [ecx*2 + 0x4c0c1e]
jmp 0x407249
xor ecx, ecx
movzx esi, di
movzx ecx, cx
shl esi, 0x10
or esi, ecx
mov ecx, dword [esp + 0x14c]
mov dword [ecx], esi
mov esi, dword [ebp + 8]
xor ecx, ecx
cmp word [esi], cx
je 0x407293
test al, al
je 0x40728b
mov edx, dword [0x4c0c1c]
mov ax, word [edx*2 + 0x4c0c1e]
mov word [0x4c0c20], ax
mov dword [0x4c0c1c], 1
jmp 0x4072ab
mov dword [0x4c0c1c], ecx
jmp 0x4072ab
test dl, dl
je 0x4072ab
movzx edx, byte [ebp + 0x26]
sub dword [0x4c0c1c], edx
test al, al
je 0x4072ab
dec dword [0x4c0c1c]
cmp byte [ebp + 0x31], cl
je 0x4072b6
mov dword [0x4c0c1c], ecx
mov ecx, dword [0x4c0c1c]
xor eax, eax
mov word [ecx*2 + 0x4c0c20], ax
cmp byte [esp + 0x17], 0
je 0x407339
cmp byte [esp + 0x12], 0
mov bl, byte [0x4c4e90]
mov byte [0x4c4e90], 0
je 0x407339
push 0x100
lea edx, [esp + 0x34]
push 0
push edx
call fcn.00491b20
mov al, byte [0x4c4e96]
mov cl, byte [0x4c4e97]
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 + 0x30]
call fcn.00411440
mov edx, dword [esp + 0x28]
push edx
movzx edx, word [0x4c4e94]
push 0
push 2
lea eax, [esp + 0x34]
push eax
push ecx
movzx eax, bl
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
cmp byte [esp + 0x14], 0
je 0x40753d
mov ebx, 1
cmp dword [0x4c3fe8], ebx
jne 0x40753d
cmp byte [esp + 0x15], 0
jne 0x40753d
mov eax, dword [0x4c401c]
cmp eax, dword [0x4c4020]
jge 0x407394
mov ecx, dword [0x4c4018]
mov dx, word [esp + 0x18]
mov word [ecx + eax*2], dx
mov eax, dword [0x4c401c]
mov edx, dword [0x4c4018]
add eax, ebx
xor ecx, ecx
mov dword [0x4c401c], eax
mov word [edx + eax*2], cx
cmp dword [esp + 0x2c], ebx
jle 0x4073ce
mov eax, dword [0x4c401c]
cmp eax, dword [0x4c4020]
jge 0x4073ce
mov ecx, dword [0x4c4018]
mov dx, word [esp + 0x1a]
mov word [ecx + eax*2], dx
mov eax, dword [0x4c401c]
mov edx, dword [0x4c4018]
add eax, ebx
xor ecx, ecx
mov dword [0x4c401c], eax
mov word [edx + eax*2], cx
mov edi, dword [0x4c4000]
test edi, edi
jne 0x4073e8
mov eax, dword [0x4c4020]
cmp dword [0x4c401c], eax
jmp 0x407531
xor esi, esi
cmp byte [0x4c4015], 0
je 0x40748a
cmp byte [0x4c4011], 0
je 0x407455
test edi, edi
je 0x407525
jmp 0x407410
mov ecx, dword [0x4c3ffc]
mov eax, dword [ecx + esi*4]
mov edx, dword [0x4c4018]
push eax
push edx
call fcn.00489c08
add esp, 8
test eax, eax
jne 0x40743c
add esi, ebx
cmp esi, dword [0x4c4000]
jb 0x407410
jmp 0x407525
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4c3fe8], 3
pop ebx
add esp, 0x120
ret
test edi, edi
je 0x407525
lea ecx, [ecx]
mov eax, dword [0x4c4018]
mov ecx, dword [0x4c3ffc]
push eax
mov eax, dword [ecx + esi*4]
call fcn.004706c0
add esp, 4
test eax, eax
jne 0x40743c
add esi, ebx
cmp esi, dword [0x4c4000]
jb 0x407460
jmp 0x407525
cmp byte [0x4c4011], 0
je 0x4074ea
test edi, edi
je 0x407525
mov ebx, dword [0x4c4018]
mov ebp, dword [0x4c3ffc]
mov ecx, dword [ebp + esi*4]
mov eax, ebx
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4074d6
test dx, dx
je 0x4074d2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4074d6
add eax, 4
add ecx, 4
test dx, dx
jne 0x4074b0
xor eax, eax
jmp 0x4074db
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40743c
inc esi
cmp esi, edi
jb 0x4074a7
jmp 0x407525
test edi, edi
je 0x407525
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
jmp 0x407500
mov edx, dword [0x4c3ffc]
mov eax, dword [edx + esi*4]
mov ecx, dword [0x4c4018]
push eax
push ecx
call edi
test eax, eax
je 0x40743c
add esi, ebx
cmp esi, dword [0x4c4000]
jb 0x407500
mov edx, dword [0x4c4020]
cmp dword [0x4c401c], edx
jl 0x40753d
mov dword [0x4c3fe8], 5
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret