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

Disassembly:
mov ecx, dword [0x4c8efc]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov bp, word [esp + 0x134]
push edi
mov edi, dword [0x4ca610]
cmp edi, 1
jne 0x406fa6
cmp byte [0x4ca640], 0
jne 0x406fa6
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0xe], 0
je 0x406fab
mov byte [esp + 0xe], 1
cmp byte [esp + 0x13c], 0
je 0x406fd9
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x4079b0
mov al, byte [esp + 0xe]
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4c9ec4], 0
je 0x406ff1
test dl, dl
jne 0x406ff1
mov byte [esp + 0xf], 1
cmp byte [esp + 0xe], dl
jne 0x406ff6
mov byte [esp + 0xf], 0
mov al, byte [0x4c84c5]
push esi
cmp edi, 1
jne 0x4070d8
cmp byte [0x4ca63e], 0
je 0x407016
test dl, dl
jne 0x4070d8
mov byte [esp + 0x14], 1
cmp bl, 0xe7
je 0x4070b7
mov edx, dword [0x4ca614]
mov esi, dword [0x4ca618]
movzx ecx, bl
mov cl, byte [ecx + edx]
test cl, cl
jne 0x407044
movzx ecx, bp
mov cl, byte [ecx + esi]
test cl, cl
je 0x4070b7
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x4070df
test cl, cl
jne 0x407067
test al, 0x30
jne 0x407067
test cl, cl
je 0x4070b7
test al, 0x30
jne 0x4070b7
movzx ecx, bp
mov edi, 4
mov dword [0x4ca610], edi
cmp byte [ecx + esi], 0
mov byte [0x4ca620], bl
setne cl
mov byte [0x4ca626], cl
xor ecx, ecx
mov word [0x4ca622], bp
mov word [0x4ca624], cx
test dl, dl
je 0x4070a7
mov byte [0x4ca627], 1
test al, 0x30
jne 0x4070ad
mov byte [0x4ca627], cl
cmp byte [esp + 0x13], cl
je 0x4079ab
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x4070d1.41
movzx edx, byte [ecx + 0x4079c8]
jmp dword [edx*4 + 0x4079bc]
mov byte [esp + 0x14], 0
jmp 0x4070b7
test cl, cl
je 0x407067
jmp 0x407063
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x13], 0
je case.0x4070d1.41
mov ecx, dword [0x4c7214]
test ecx, ecx
je 0x40711d
xor ecx, ecx
mov word [0x4c7218], cx
mov dword [0x4c7214], ecx
jmp 0x40711d
mov ecx, dword [0x4c7214]
test al, al
je 0x407147
cmp edi, 1
jne 0x40712f
cmp byte [0x4ca63f], 0
jne 0x407147
cmp al, 0x10
je 0x407147
cmp al, 0x20
je 0x407147
test al, 0xc
je 0x4079ab
test al, 3
je 0x4079ab
cmp byte [esp + 0x138], 8
jne 0x4071c2
test al, al
jne 0x4071c2
cmp byte [esp + 0x14], al
je 0x407183
cmp edi, 1
jne 0x407183
cmp byte [0x4ca63c], al
je 0x407183
mov eax, dword [0x4ca648]
test eax, eax
je 0x407183
mov esi, dword [0x4ca644]
dec eax
xor edx, edx
mov dword [0x4ca648], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x13], 0
je 0x40719f
test ecx, ecx
je 0x40719f
dec ecx
xor eax, eax
mov dword [0x4c7214], ecx
mov word [ecx*2 + 0x4c7218], ax
cmp byte [0x4cb300], 0
je 0x4079ab
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov byte [0x4cb300], 0
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4c84e8
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.00411af0
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x4071ee
or byte [esp + 0x44], 1
jmp 0x4071f3
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x40720a
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x40720c
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
cmp byte [esp + 0x138], 0xe7
mov edi, dword [sym.imp.USER32.dll_ToUnicodeEx]
mov esi, eax
mov dword [esp + 0x2c], esi
jne 0x407241
mov cx, word [esp + 0x13c]
mov eax, 1
mov dword [esp + 0x28], eax
mov word [esp + 0x18], cx
jmp 0x407274
xor edx, edx
cmp dword [0x4c8658], 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 dword [esp + 0x28], eax
test eax, eax
je 0x4079ab
cmp byte [0x4cb300], 0
mov cl, byte [esp + 0x138]
je 0x407293
cmp cl, 9
je 0x407293
mov byte [esp + 0x17], 1
cmp cl, 0x1b
jne 0x407298
mov byte [esp + 0x17], 0
test eax, eax
jns 0x407318
cmp byte [esp + 0x12], 0
je 0x4079ab
mov al, byte [0x4c84c5]
test al, 0x30
mov byte [0x4cb300], cl
mov cx, word [esp + 0x13c]
setne dl
mov word [0x4cb304], cx
mov byte [0x4cb306], dl
test al, 3
je 0x4072db
mov byte [0x4cb307], 1
test al, 0xc
jne 0x4072e2
mov byte [0x4cb307], 0
xor eax, eax
cmp dword [0x4c8658], eax
push esi
setne al
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x34]
push eax
mov eax, dword [esp + 0x13c]
push 2
push ecx
mov ecx, dword [eax + 4]
push edx
push ecx
push ebx
call edi
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
test byte [0x4c84c5], 3
jne 0x407348
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x407337
mov edx, 0xa
mov word [esp + 0x18], dx
cmp word [esp + 0x1a], ax
jne 0x407348
mov eax, 0xa
mov word [esp + 0x1a], ax
cmp byte [esp + 0x13], 0
mov byte [esp + 0x15], 0
je 0x407716
cmp ebp, dword [0x4c7210]
je 0x407371
xor ecx, ecx
mov dword [0x4c7210], ebp
mov word [0x4c7218], cx
jmp 0x4073c1
mov ecx, dword [0x4c7214]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x4073c1
mov eax, 0x4c7272
lea edx, [eax + 2]
jmp 0x407390
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407390
sub eax, edx
sar eax, 1
mov dword [0x4c7214], eax
lea eax, [eax + eax + 2]
push eax
push 0x4c7272
push 0x4c7218
call fcn.0048e610
mov ecx, dword [0x4c7214]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x4c7218], dx
inc ecx
cmp dword [esp + 0x28], 1
mov dword [0x4c7214], ecx
jle 0x4073f0
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x4c7218], ax
inc ecx
mov dword [0x4c7214], ecx
xor edx, edx
mov word [ecx*2 + 0x4c7218], dx
test ecx, ecx
je 0x407716
mov dword [esp + 0x24], edx
cmp dword [0x4c9ec8], edx
jbe 0x407716
mov eax, dword [0x4c9ec4]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x27], 0
jne 0x407532
cmp byte [ebp + 0x2f], 0
je 0x407467
movzx eax, byte [ebp + 0x26]
cmp ecx, eax
jle 0x407532
movzx eax, word [ecx*2 + 0x4c7216]
push eax
push 0x4c48f0
call fcn.0048e971
add esp, 8
test eax, eax
je 0x40752c
mov ecx, dword [0x4c7214]
lea edi, [ecx*2 + 0x4c7214]
jmp 0x40747a
movzx edx, byte [ebp + 0x26]
cmp ecx, edx
jl 0x407532
lea edi, [ecx*2 + 0x4c7216]
cmp byte [ebp + 0x2a], 0
movzx edx, byte [ebp + 0x26]
mov eax, dword [ebp + 4]
lea esi, [eax + edx*2 - 2]
je 0x4074a4
cmp esi, eax
jb 0x4074e0
nop
mov dx, word [edi]
cmp dx, word [esi]
jne 0x4074e0
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407490
jmp 0x4074e0
cmp esi, eax
jb 0x4074e0
jmp 0x4074b0
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 0x4074da
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 4]
jae 0x4074b0
mov ecx, dword [0x4c7214]
cmp esi, dword [ebp + 4]
jae 0x407532
cmp byte [ebp + 0x30], 0
jne 0x407501
cmp edi, 0x4c7218
jb 0x407501
movzx edx, word [edi]
push edx
call dword [sym.imp.USER32.dll_IsCharAlphaNumericW]
test eax, eax
jne 0x40752c
mov eax, dword [ebp]
test eax, eax
je 0x40750d
mov eax, dword [eax + 4]
jmp 0x407512
mov eax, 0x4ac0f0
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.00409990
add esp, 8
test eax, eax
jne 0x40754c
mov ecx, dword [0x4c7214]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4c9ec8]
jb 0x407412
jmp 0x407716
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.0040a470
add esp, 4
test al, al
je 0x407716
xor edi, edi
cmp byte [ebp + 0x2b], 0
je 0x40765d
cmp byte [ebp + 0x2f], 0
mov ebx, dword [0x4c7214]
lea ebx, [ebx*2 + 0x4c7218]
je 0x407597
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 0x407606
mov edi, dword [sym.imp.USER32.dll_IsCharUpperW]
lea esp, [esp]
movzx edx, word [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x4075d8
movzx eax, word [esi]
push eax
call edi
test eax, eax
je 0x4075f7
cmp byte [esp + 0x16], 0
jne 0x4075f3
movzx ecx, word [esi]
push ecx
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x4075f3
mov byte [esp + 0x13], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x4075c0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40760a
xor edi, edi
jmp 0x40765d
cmp eax, 1
jne 0x40761d
movzx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
and edi, 2
jmp 0x40765d
cmp byte [esp + 0x13], 0
jne 0x407628
xor edi, edi
jmp 0x40765d
movzx edx, byte [ebp + 0x26]
add edx, edx
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x407656
jmp 0x407640
movzx eax, word [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407654
add esi, edi
cmp esi, ebx
jb 0x407640
cmp esi, ebx
jne 0x40765d
mov edi, 1
mov dl, byte [ebp + 0x2c]
test dl, dl
jne 0x407669
cmp byte [ebp + 0x2d], dl
je 0x407673
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 0x407697
mov ecx, dword [0x4c7214]
movzx ecx, word [ecx*2 + 0x4c7216]
jmp 0x407699
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 0x4076e3
test al, al
je 0x4076db
mov edx, dword [0x4c7214]
mov ax, word [edx*2 + 0x4c7216]
mov word [0x4c7218], ax
mov dword [0x4c7214], 1
jmp 0x4076fb
mov dword [0x4c7214], ecx
jmp 0x4076fb
test dl, dl
je 0x4076fb
movzx edx, byte [ebp + 0x26]
sub dword [0x4c7214], edx
test al, al
je 0x4076fb
dec dword [0x4c7214]
cmp byte [ebp + 0x31], cl
je 0x407706
mov dword [0x4c7214], ecx
mov ecx, dword [0x4c7214]
xor eax, eax
mov word [ecx*2 + 0x4c7218], ax
cmp byte [esp + 0x17], 0
je 0x407789
cmp byte [esp + 0x12], 0
mov bl, byte [0x4cb300]
mov byte [0x4cb300], 0
je 0x407789
push 0x100
lea edx, [esp + 0x34]
push 0
push edx
call fcn.00496a70
mov al, byte [0x4cb306]
mov cl, byte [0x4cb307]
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.00411af0
mov edx, dword [esp + 0x2c]
push edx
movzx edx, word [0x4cb304]
push 0
push 2
lea eax, [esp + 0x38]
push eax
push ecx
movzx eax, bl
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
cmp byte [esp + 0x14], 0
je 0x4079ab
cmp dword [0x4ca610], 1
jne 0x4079ab
cmp byte [esp + 0x15], 0
jne 0x4079ab
mov edi, dword [esp + 0x28]
xor esi, esi
test edi, edi
jle 0x40782a
jmp 0x4077c0
cmp byte [0x4ca63d], 0
mov ecx, dword [0x4ca61c]
je 0x4077e0
movzx eax, word [esp + esi*2 + 0x18]
push eax
push ecx
call fcn.0048e971
add esp, 8
jmp 0x4077ea
mov ax, word [esp + esi*2 + 0x18]
call fcn.00474d40
test eax, eax
jne 0x40787a
mov eax, dword [0x4ca648]
cmp eax, dword [0x4ca64c]
je 0x40782a
mov dx, word [esp + esi*2 + 0x18]
mov ecx, dword [0x4ca644]
mov word [ecx + eax*2], dx
mov eax, dword [0x4ca648]
mov ecx, dword [0x4ca644]
inc eax
xor edx, edx
inc esi
mov dword [0x4ca648], eax
mov word [ecx + eax*2], dx
cmp esi, edi
jl 0x4077c0
xor esi, esi
cmp byte [0x4ca641], 0
je 0x4078f9
cmp byte [0x4ca63d], 0
je 0x4078b8
cmp dword [0x4ca62c], esi
jbe 0x407993
mov edi, edi
mov eax, dword [0x4ca628]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4ca644]
push eax
push ecx
call fcn.0048e998
add esp, 8
test eax, eax
jne 0x40789f
inc esi
cmp esi, dword [0x4ca62c]
jb 0x407850
jmp 0x407993
mov dx, word [esp + esi*2 + 0x18]
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4ca610], 4
mov word [0x4ca624], dx
pop ebx
add esp, 0x120
ret
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4ca610], 3
pop ebx
add esp, 0x120
ret
cmp dword [0x4ca62c], esi
jbe 0x407993
jmp 0x4078d0
mov edx, dword [0x4ca644]
mov eax, dword [0x4ca628]
mov eax, dword [eax + esi*4]
push edx
call fcn.00474d90
add esp, 4
test eax, eax
jne 0x40789f
inc esi
cmp esi, dword [0x4ca62c]
jb 0x4078d0
jmp 0x407993
cmp byte [0x4ca63d], 0
je 0x40795f
mov ebp, dword [0x4ca62c]
test ebp, ebp
je 0x407993
mov edi, dword [0x4ca644]
mov ebx, dword [0x4ca628]
lea esp, [esp]
mov ecx, dword [ebx + esi*4]
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40794b
test dx, dx
je 0x407947
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40794b
add eax, 4
add ecx, 4
test dx, dx
jne 0x407925
xor eax, eax
jmp 0x407950
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40789f
inc esi
cmp esi, ebp
jb 0x407920
jmp 0x407993
cmp dword [0x4ca62c], esi
jbe 0x407993
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ecx, [ecx]
mov ecx, dword [0x4ca628]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4ca644]
push edx
push eax
call edi
test eax, eax
je 0x40789f
inc esi
cmp esi, dword [0x4ca62c]
jb 0x407970
mov ecx, dword [0x4ca64c]
cmp dword [0x4ca648], ecx
jl 0x4079ab
mov dword [0x4ca610], 5
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret