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

Disassembly:
mov ecx, dword [0x4c6eec]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov bp, word [esp + 0x134]
push edi
mov edi, dword [0x4c8600]
cmp edi, 1
jne 0x406f16
cmp byte [0x4c8630], 0
jne 0x406f16
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0xe], 0
je 0x406f1b
mov byte [esp + 0xe], 1
cmp byte [esp + 0x13c], 0
je 0x406f49
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x407920
mov al, byte [esp + 0xe]
pop edi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4c7eb4], 0
je 0x406f61
test dl, dl
jne 0x406f61
mov byte [esp + 0xf], 1
cmp byte [esp + 0xe], dl
jne 0x406f66
mov byte [esp + 0xf], 0
mov al, byte [0x4c64b5]
push esi
cmp edi, 1
jne 0x407048
cmp byte [0x4c862e], 0
je 0x406f86
test dl, dl
jne 0x407048
mov byte [esp + 0x14], 1
cmp bl, 0xe7
je 0x407027
mov edx, dword [0x4c8604]
mov esi, dword [0x4c8608]
movzx ecx, bl
mov cl, byte [ecx + edx]
test cl, cl
jne 0x406fb4
movzx ecx, bp
mov cl, byte [ecx + esi]
test cl, cl
je 0x407027
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x40704f
test cl, cl
jne 0x406fd7
test al, 0x30
jne 0x406fd7
test cl, cl
je 0x407027
test al, 0x30
jne 0x407027
movzx ecx, bp
mov edi, 4
mov dword [0x4c8600], edi
cmp byte [ecx + esi], 0
mov byte [0x4c8610], bl
setne cl
mov byte [0x4c8616], cl
xor ecx, ecx
mov word [0x4c8612], bp
mov word [0x4c8614], cx
test dl, dl
je 0x407017
mov byte [0x4c8617], 1
test al, 0x30
jne 0x40701d
mov byte [0x4c8617], cl
cmp byte [esp + 0x13], cl
je 0x40791b
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x407041.41
movzx edx, byte [ecx + 0x407938]
jmp dword [edx*4 + 0x40792c]
mov byte [esp + 0x14], 0
jmp 0x407027
test cl, cl
je 0x406fd7
jmp 0x406fd3
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x13], 0
je case.0x407041.41
mov ecx, dword [0x4c5204]
test ecx, ecx
je 0x40708d
xor ecx, ecx
mov word [0x4c5208], cx
mov dword [0x4c5204], ecx
jmp 0x40708d
mov ecx, dword [0x4c5204]
test al, al
je 0x4070b7
cmp edi, 1
jne 0x40709f
cmp byte [0x4c862f], 0
jne 0x4070b7
cmp al, 0x10
je 0x4070b7
cmp al, 0x20
je 0x4070b7
test al, 0xc
je 0x40791b
test al, 3
je 0x40791b
cmp byte [esp + 0x138], 8
jne 0x407132
test al, al
jne 0x407132
cmp byte [esp + 0x14], al
je 0x4070f3
cmp edi, 1
jne 0x4070f3
cmp byte [0x4c862c], al
je 0x4070f3
mov eax, dword [0x4c8638]
test eax, eax
je 0x4070f3
mov esi, dword [0x4c8634]
dec eax
xor edx, edx
mov dword [0x4c8638], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x13], 0
je 0x40710f
test ecx, ecx
je 0x40710f
dec ecx
xor eax, eax
mov dword [0x4c5204], ecx
mov word [ecx*2 + 0x4c5208], ax
cmp byte [0x4c92f0], 0
je 0x40791b
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov byte [0x4c92f0], 0
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4c64d8
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.00411a40
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40715e
or byte [esp + 0x44], 1
jmp 0x407163
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x40717a
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x40717c
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 0x4071b1
mov cx, word [esp + 0x13c]
mov eax, 1
mov dword [esp + 0x28], eax
mov word [esp + 0x18], cx
jmp 0x4071e4
xor edx, edx
cmp dword [0x4c6648], 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 0x40791b
cmp byte [0x4c92f0], 0
mov cl, byte [esp + 0x138]
je 0x407203
cmp cl, 9
je 0x407203
mov byte [esp + 0x17], 1
cmp cl, 0x1b
jne 0x407208
mov byte [esp + 0x17], 0
test eax, eax
jns 0x407288
cmp byte [esp + 0x12], 0
je 0x40791b
mov al, byte [0x4c64b5]
test al, 0x30
mov byte [0x4c92f0], cl
mov cx, word [esp + 0x13c]
setne dl
mov word [0x4c92f4], cx
mov byte [0x4c92f6], dl
test al, 3
je 0x40724b
mov byte [0x4c92f7], 1
test al, 0xc
jne 0x407252
mov byte [0x4c92f7], 0
xor eax, eax
cmp dword [0x4c6648], 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 [0x4c64b5], 3
jne 0x4072b8
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x4072a7
mov edx, 0xa
mov word [esp + 0x18], dx
cmp word [esp + 0x1a], ax
jne 0x4072b8
mov eax, 0xa
mov word [esp + 0x1a], ax
cmp byte [esp + 0x13], 0
mov byte [esp + 0x15], 0
je 0x407686
cmp ebp, dword [0x4c5200]
je 0x4072e1
xor ecx, ecx
mov dword [0x4c5200], ebp
mov word [0x4c5208], cx
jmp 0x407331
mov ecx, dword [0x4c5204]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x407331
mov eax, 0x4c5262
lea edx, [eax + 2]
jmp 0x407300
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407300
sub eax, edx
sar eax, 1
mov dword [0x4c5204], eax
lea eax, [eax + eax + 2]
push eax
push 0x4c5262
push 0x4c5208
call fcn.0048d840
mov ecx, dword [0x4c5204]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x4c5208], dx
inc ecx
cmp dword [esp + 0x28], 1
mov dword [0x4c5204], ecx
jle 0x407360
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x4c5208], ax
inc ecx
mov dword [0x4c5204], ecx
xor edx, edx
mov word [ecx*2 + 0x4c5208], dx
test ecx, ecx
je 0x407686
mov dword [esp + 0x24], edx
cmp dword [0x4c7eb8], edx
jbe 0x407686
mov eax, dword [0x4c7eb4]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x27], 0
jne 0x4074a2
cmp byte [ebp + 0x2f], 0
je 0x4073d7
movzx eax, byte [ebp + 0x26]
cmp ecx, eax
jle 0x4074a2
movzx eax, word [ecx*2 + 0x4c5206]
push eax
push 0x4c28f0
call fcn.0048dba1
add esp, 8
test eax, eax
je 0x40749c
mov ecx, dword [0x4c5204]
lea edi, [ecx*2 + 0x4c5204]
jmp 0x4073ea
movzx edx, byte [ebp + 0x26]
cmp ecx, edx
jl 0x4074a2
lea edi, [ecx*2 + 0x4c5206]
cmp byte [ebp + 0x2a], 0
movzx edx, byte [ebp + 0x26]
mov eax, dword [ebp + 4]
lea esi, [eax + edx*2 - 2]
je 0x407414
cmp esi, eax
jb 0x407450
nop
mov dx, word [edi]
cmp dx, word [esi]
jne 0x407450
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407400
jmp 0x407450
cmp esi, eax
jb 0x407450
jmp 0x407420
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 0x40744a
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 4]
jae 0x407420
mov ecx, dword [0x4c5204]
cmp esi, dword [ebp + 4]
jae 0x4074a2
cmp byte [ebp + 0x30], 0
jne 0x407471
cmp edi, 0x4c5208
jb 0x407471
movzx edx, word [edi]
push edx
call dword [sym.imp.USER32.dll_IsCharAlphaNumericW]
test eax, eax
jne 0x40749c
mov eax, dword [ebp]
test eax, eax
je 0x40747d
mov eax, dword [eax + 4]
jmp 0x407482
mov eax, 0x4ab04c
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.00409920
add esp, 8
test eax, eax
jne 0x4074bc
mov ecx, dword [0x4c5204]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4c7eb8]
jb 0x407382
jmp 0x407686
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.0040a400
add esp, 4
test al, al
je 0x407686
xor edi, edi
cmp byte [ebp + 0x2b], 0
je 0x4075cd
cmp byte [ebp + 0x2f], 0
mov ebx, dword [0x4c5204]
lea ebx, [ebx*2 + 0x4c5208]
je 0x407507
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 0x407576
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 0x407548
movzx eax, word [esi]
push eax
call edi
test eax, eax
je 0x407567
cmp byte [esp + 0x16], 0
jne 0x407563
movzx ecx, word [esi]
push ecx
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x407563
mov byte [esp + 0x13], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x407530
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40757a
xor edi, edi
jmp 0x4075cd
cmp eax, 1
jne 0x40758d
movzx edi, byte [esp + 0x13]
neg edi
sbb edi, edi
and edi, 2
jmp 0x4075cd
cmp byte [esp + 0x13], 0
jne 0x407598
xor edi, edi
jmp 0x4075cd
movzx edx, byte [ebp + 0x26]
add edx, edx
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x4075c6
jmp 0x4075b0
movzx eax, word [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x4075c4
add esi, edi
cmp esi, ebx
jb 0x4075b0
cmp esi, ebx
jne 0x4075cd
mov edi, 1
mov dl, byte [ebp + 0x2c]
test dl, dl
jne 0x4075d9
cmp byte [ebp + 0x2d], dl
je 0x4075e3
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 0x407607
mov ecx, dword [0x4c5204]
movzx ecx, word [ecx*2 + 0x4c5206]
jmp 0x407609
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 0x407653
test al, al
je 0x40764b
mov edx, dword [0x4c5204]
mov ax, word [edx*2 + 0x4c5206]
mov word [0x4c5208], ax
mov dword [0x4c5204], 1
jmp 0x40766b
mov dword [0x4c5204], ecx
jmp 0x40766b
test dl, dl
je 0x40766b
movzx edx, byte [ebp + 0x26]
sub dword [0x4c5204], edx
test al, al
je 0x40766b
dec dword [0x4c5204]
cmp byte [ebp + 0x31], cl
je 0x407676
mov dword [0x4c5204], ecx
mov ecx, dword [0x4c5204]
xor eax, eax
mov word [ecx*2 + 0x4c5208], ax
cmp byte [esp + 0x17], 0
je 0x4076f9
cmp byte [esp + 0x12], 0
mov bl, byte [0x4c92f0]
mov byte [0x4c92f0], 0
je 0x4076f9
push 0x100
lea edx, [esp + 0x34]
push 0
push edx
call fcn.00495ca0
mov al, byte [0x4c92f6]
mov cl, byte [0x4c92f7]
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.00411a40
mov edx, dword [esp + 0x2c]
push edx
movzx edx, word [0x4c92f4]
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 0x40791b
cmp dword [0x4c8600], 1
jne 0x40791b
cmp byte [esp + 0x15], 0
jne 0x40791b
mov edi, dword [esp + 0x28]
xor esi, esi
test edi, edi
jle 0x40779a
jmp 0x407730
cmp byte [0x4c862d], 0
mov ecx, dword [0x4c860c]
je 0x407750
movzx eax, word [esp + esi*2 + 0x18]
push eax
push ecx
call fcn.0048dba1
add esp, 8
jmp 0x40775a
mov ax, word [esp + esi*2 + 0x18]
call fcn.00473fb0
test eax, eax
jne 0x4077ea
mov eax, dword [0x4c8638]
cmp eax, dword [0x4c863c]
je 0x40779a
mov dx, word [esp + esi*2 + 0x18]
mov ecx, dword [0x4c8634]
mov word [ecx + eax*2], dx
mov eax, dword [0x4c8638]
mov ecx, dword [0x4c8634]
inc eax
xor edx, edx
inc esi
mov dword [0x4c8638], eax
mov word [ecx + eax*2], dx
cmp esi, edi
jl 0x407730
xor esi, esi
cmp byte [0x4c8631], 0
je 0x407869
cmp byte [0x4c862d], 0
je 0x407828
cmp dword [0x4c861c], esi
jbe 0x407903
mov edi, edi
mov eax, dword [0x4c8618]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4c8634]
push eax
push ecx
call fcn.0048dbc8
add esp, 8
test eax, eax
jne 0x40780f
inc esi
cmp esi, dword [0x4c861c]
jb 0x4077c0
jmp 0x407903
mov dx, word [esp + esi*2 + 0x18]
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4c8600], 4
mov word [0x4c8614], dx
pop ebx
add esp, 0x120
ret
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
mov dword [0x4c8600], 3
pop ebx
add esp, 0x120
ret
cmp dword [0x4c861c], esi
jbe 0x407903
jmp 0x407840
mov edx, dword [0x4c8634]
mov eax, dword [0x4c8618]
mov eax, dword [eax + esi*4]
push edx
call fcn.00474000
add esp, 4
test eax, eax
jne 0x40780f
inc esi
cmp esi, dword [0x4c861c]
jb 0x407840
jmp 0x407903
cmp byte [0x4c862d], 0
je 0x4078cf
mov ebp, dword [0x4c861c]
test ebp, ebp
je 0x407903
mov edi, dword [0x4c8634]
mov ebx, dword [0x4c8618]
lea esp, [esp]
mov ecx, dword [ebx + esi*4]
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4078bb
test dx, dx
je 0x4078b7
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4078bb
add eax, 4
add ecx, 4
test dx, dx
jne 0x407895
xor eax, eax
jmp 0x4078c0
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40780f
inc esi
cmp esi, ebp
jb 0x407890
jmp 0x407903
cmp dword [0x4c861c], esi
jbe 0x407903
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ecx, [ecx]
mov ecx, dword [0x4c8618]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4c8634]
push edx
push eax
call edi
test eax, eax
je 0x40780f
inc esi
cmp esi, dword [0x4c861c]
jb 0x4078e0
mov ecx, dword [0x4c863c]
cmp dword [0x4c8638], ecx
jl 0x40791b
mov dword [0x4c8600], 5
mov al, byte [esp + 0x12]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x120
ret