Function at 0x406cf0
Capabilities:
Get keyboard layout
Log keystrokes via polling
Resolve function by parsing pe exports

Disassembly:
mov dl, byte [esp + 8]
mov ecx, dword [0x4c9f44]
sub esp, 0x18c
push ebx
push ebp
mov ebp, dword [0x4cb640]
push edi
mov di, word [esp + 0x1a4]
cmp ebp, 1
jne 0x406d36
cmp byte [0x4cb670], 0
jne 0x406d36
movzx eax, dl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
jne 0x406d36
xor bl, bl
mov byte [esp + 0xf], bl
jmp 0x406d3f
mov byte [esp + 0xf], 1
mov bl, byte [esp + 0xf]
cmp byte [esp + 0x1a8], 0
je 0x406d6b
movzx eax, dl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x4077f9
pop edi
pop ebp
mov al, bl
pop ebx
add esp, 0x18c
ret
cmp dword [0x4caf0c], 0
je 0x406d87
cmp byte [esp + 0x1ac], 0
jne 0x406d87
mov byte [esp + 0x10], 1
test bl, bl
jne 0x406d8c
mov byte [esp + 0x10], 0
mov bl, byte [0x4c9505]
push esi
cmp ebp, 1
jne 0x406e7a
cmp byte [0x4cb66e], 0
je 0x406db3
cmp byte [esp + 0x1b0], 0
jne 0x406e7a
mov byte [esp + 0x15], 1
cmp dl, 0xe7
je 0x406e5b
mov ecx, dword [0x4cb644]
mov esi, dword [0x4cb648]
movzx eax, dl
mov al, byte [eax + ecx]
test al, al
jne 0x406de1
movzx eax, di
mov al, byte [eax + esi]
test al, al
je 0x406e5b
mov cl, al
shr al, 2
shr cl, 1
and al, 1
and cl, 1
je 0x406e81
test al, al
jne 0x406e05
test bl, 0x30
jne 0x406e05
test al, al
je 0x406e5b
test bl, 0x30
jne 0x406e5b
movzx eax, di
mov ebp, 4
mov dword [0x4cb640], ebp
cmp byte [eax + esi], 0
mov byte [0x4cb650], dl
setne al
mov byte [0x4cb656], al
xor eax, eax
mov word [0x4cb652], di
mov word [0x4cb654], ax
test cl, cl
je 0x406e44
mov byte [0x4cb657], 1
test bl, 0x30
jne 0x406e49
mov byte [0x4cb657], al
cmp byte [esp + 0x14], al
jne 0x406e5b
cmp byte [0x4cc354], al
je 0x40780d
movzx eax, dl
mov dword [esp + 0x20], eax
add eax, 0xffffffdf
cmp eax, 0x84
ja case.0x406e73.41
movzx ecx, byte [eax + 0x407864]
jmp dword [ecx*4 + 0x407858]
mov byte [esp + 0x15], 0
jmp 0x406e5b
test al, al
je 0x406e05
jmp 0x406e00
pop esi
pop edi
pop ebp
mov al, 1
pop ebx
add esp, 0x18c
ret
cmp byte [esp + 0x14], 0
je case.0x406e73.41
mov ecx, dword [0x4c8254]
test ecx, ecx
je 0x406ec0
xor eax, eax
xor ecx, ecx
mov word [0x4c8258], ax
mov dword [0x4c8254], ecx
jmp 0x406ec0
mov ecx, dword [0x4c8254]
test bl, bl
je 0x406ef3
cmp ebp, 1
jne 0x406ed2
cmp byte [0x4cb66f], 0
jne 0x406ef3
cmp bl, 0x10
je 0x406ef3
cmp bl, 0x20
je 0x406ef3
cmp bl, 0x30
je 0x406ef3
test bl, 0xc
je 0x40780d
test bl, 3
je 0x40780d
cmp dl, 8
jne 0x406f65
test bl, bl
jne 0x406f65
cmp byte [esp + 0x15], bl
je 0x406f2a
cmp ebp, 1
jne 0x406f2a
cmp byte [0x4cb66c], bl
je 0x406f2a
mov eax, dword [0x4cb678]
test eax, eax
je 0x406f2a
mov esi, dword [0x4cb674]
dec eax
xor edx, edx
mov dword [0x4cb678], eax
mov word [esi + eax*2], dx
cmp byte [esp + 0x14], 0
je 0x406f46
test ecx, ecx
je 0x406f46
dec ecx
xor eax, eax
mov dword [0x4c8254], ecx
mov word [ecx*2 + 0x4c8258], ax
cmp byte [0x4cc354], 0
je 0x406f56
mov byte [0x4cc354], 0
mov al, byte [esp + 0x13]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x18c
ret
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov edi, eax
xor esi, esi
mov dword [esp + 0x28], edi
test edi, edi
je 0x406faa
mov ebx, dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push esi
push edi
call ebx
lea ecx, [esp + 0x34]
mov esi, eax
push ecx
push esi
mov dword [esp + 0x3c], 0x30
call dword [sym.imp.USER32.dll_GetGUIThreadInfo]
test eax, eax
je 0x406faa
mov eax, dword [esp + 0x40]
test eax, eax
je 0x406faa
push 0
push eax
call ebx
mov esi, eax
push esi
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov ebp, eax
mov dword [esp + 0x30], ebp
cmp dword [0x4cc360], edi
je 0x406ff4
push 0x1c
lea edx, [esp + 0x168]
push edx
push edi
mov dword [0x4cc360], edi
call dword [sym.imp.USER32.dll_GetClassNameW]
lea eax, [esp + 0x164]
push str.ApplicationFrameWindow
push eax
call fcn.0048e559
add esp, 8
test eax, eax
sete byte [0x4cc35c]
mov bl, byte [0x4cc354]
mov ecx, 0x40
mov esi, 0x4c9528
lea edi, [esp + 0x64]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [sym.imp.USER32.dll_ToUnicodeEx]
test bl, bl
je 0x407091
cmp byte [0x4cc35c], 0
je 0x407091
cmp byte [esp + 0x1a4], 0xe7
je 0x407091
mov al, byte [0x4cc35a]
mov cl, byte [0x4cc35b]
neg al
sbb al, al
and al, 0x20
neg cl
sbb cl, cl
and cl, 9
or al, cl
lea ecx, [esp + 0x64]
call fcn.00412060
push ebp
push 0
push 2
lea edx, [esp + 0x24]
push edx
mov eax, ecx
movzx ecx, word [0x4cc358]
push eax
movzx edx, bl
push ecx
push edx
call esi
test eax, eax
jle 0x40708a
movzx edx, word [0x4cc358]
push ebp
push 0
push 2
lea eax, [esp + 0x24]
push eax
movzx eax, byte [0x4cc354]
lea ecx, [esp + 0x74]
push ecx
push edx
push eax
call esi
mov byte [0x4cc354], 0
mov al, byte [0x4c9505]
lea ecx, [esp + 0x64]
call fcn.00412060
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x4070b2
or byte [esp + 0x78], 1
jmp 0x4070b7
and byte [esp + 0x78], 0xfe
cmp byte [esp + 0x1a4], 0xe7
jne 0x4070d9
mov cx, word [esp + 0x1a8]
mov eax, 1
mov dword [esp + 0x2c], eax
mov word [esp + 0x18], cx
jmp 0x407110
xor edx, edx
cmp dword [0x4c9698], edx
push ebp
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x68]
push edx
mov edx, dword [esp + 0x1a8]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
mov ecx, dword [esp + 0x34]
push eax
push ecx
call esi
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40780d
cmp byte [0x4cc354], 0
setne byte [esp + 0x27]
test eax, eax
jns 0x4071a9
mov bl, byte [esp + 0x13]
test bl, bl
je 0x4077f6
mov ax, word [esp + 0x1a8]
mov dl, byte [esp + 0x1a4]
mov word [0x4cc358], ax
mov al, byte [0x4c9505]
test al, 0x30
setne cl
mov byte [0x4cc354], dl
mov byte [0x4cc35a], cl
test al, 3
je 0x40716a
mov byte [0x4cc35b], 1
test al, 0xc
jne 0x407171
mov byte [0x4cc35b], 0
xor edx, edx
cmp dword [0x4c9698], edx
push ebp
setne dl
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x68]
push edx
mov edx, dword [esp + 0x1a8]
push 2
push eax
mov eax, dword [edx + 4]
push ecx
mov ecx, dword [esp + 0x34]
push eax
push ecx
call esi
pop esi
pop edi
pop ebp
mov al, bl
pop ebx
add esp, 0x18c
ret
test byte [0x4c9505], 3
jne 0x4071d9
mov eax, 0xd
cmp word [esp + 0x18], ax
jne 0x4071c8
mov edx, 0xa
mov word [esp + 0x18], dx
cmp word [esp + 0x1a], ax
jne 0x4071d9
mov eax, 0xa
mov word [esp + 0x1a], ax
cmp byte [esp + 0x14], 0
mov byte [esp + 0x17], 0
je 0x4075a3
mov eax, dword [esp + 0x28]
cmp eax, dword [0x4c8250]
je 0x407205
xor ecx, ecx
mov dword [0x4c8250], eax
mov word [0x4c8258], cx
jmp 0x407251
mov ecx, dword [0x4c8254]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x407251
mov eax, 0x4c82b2
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407220
sub eax, edx
sar eax, 1
mov dword [0x4c8254], eax
lea eax, [eax + eax + 2]
push eax
push 0x4c82b2
push 0x4c8258
call fcn.0048efd0
mov ecx, dword [0x4c8254]
add esp, 0xc
mov dx, word [esp + 0x18]
mov word [ecx*2 + 0x4c8258], dx
inc ecx
cmp dword [esp + 0x2c], 1
mov dword [0x4c8254], ecx
jle 0x407280
mov ax, word [esp + 0x1a]
mov word [ecx*2 + 0x4c8258], ax
inc ecx
mov dword [0x4c8254], ecx
xor edx, edx
mov word [ecx*2 + 0x4c8258], dx
test ecx, ecx
je 0x4075a3
mov dword [esp + 0x28], edx
cmp dword [0x4caf10], edx
jbe 0x4075a3
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
jmp 0x4072b0
mov eax, dword [0x4caf0c]
mov edx, dword [esp + 0x28]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x23], 0
jne 0x4073c2
cmp byte [ebp + 0x2a], 0
je 0x407305
movzx eax, byte [ebp + 0x22]
cmp ecx, eax
jle 0x4073c2
movzx eax, word [ecx*2 + 0x4c8256]
push eax
push 0x4c5910
call fcn.0048f331
add esp, 8
test eax, eax
je 0x4073bc
mov ecx, dword [0x4c8254]
lea edi, [ecx*2 + 0x4c8254]
jmp 0x407318
movzx edx, byte [ebp + 0x22]
cmp ecx, edx
jl 0x4073c2
lea edi, [ecx*2 + 0x4c8256]
cmp byte [ebp + 0x26], 0
movzx edx, byte [ebp + 0x22]
mov eax, dword [ebp + 8]
lea esi, [eax + edx*2 - 2]
je 0x407344
cmp esi, eax
jb 0x407386
lea ecx, [ecx]
mov dx, word [edi]
cmp dx, word [esi]
jne 0x407386
sub esi, 2
sub edi, 2
cmp esi, eax
jae 0x407330
jmp 0x407386
cmp esi, eax
jb 0x407386
jmp 0x407356
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
movzx eax, word [esi]
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 0x40737a
sub esi, 2
sub edi, 2
cmp esi, dword [ebp + 8]
jae 0x407350
mov ecx, dword [0x4c8254]
mov ebx, dword [sym.imp.USER32.dll_CharLowerW]
cmp esi, dword [ebp + 8]
jae 0x4073c2
cmp byte [ebp + 0x2b], 0
jne 0x4073a9
cmp edi, 0x4c8258
jb 0x4073a9
movzx edx, word [edi]
push edx
call fcn.004078f0
add esp, 4
test al, al
jne 0x4073bc
mov eax, dword [ebp + 4]
mov esi, dword [ebp + 0x10]
push eax
call fcn.004098d0
add esp, 4
test eax, eax
jne 0x4073dc
mov ecx, dword [0x4c8254]
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [0x4caf10]
jb 0x4072b0
jmp 0x4075a3
movzx edx, byte [ebp + 0x21]
mov ecx, dword [esp + 0x1b4]
mov eax, dword [esp + 0x1a0]
mov eax, dword [eax + 0x10]
add ecx, 4
push edx
call fcn.0040a510
add esp, 4
test al, al
je 0x4075a3
cmp byte [ebp + 0x27], 0
jne 0x407412
xor edi, edi
jmp 0x4074ed
cmp byte [ebp + 0x2a], 0
mov ebx, dword [0x4c8254]
lea ebx, [ebx*2 + 0x4c8258]
je 0x407428
sub ebx, 2
movzx ecx, byte [ebp + 0x22]
add ecx, ecx
mov esi, ebx
sub esi, ecx
mov dword [esp + 0x20], 0
mov byte [esp + 0x16], 0
mov byte [esp + 0x14], 0
cmp esi, ebx
jae 0x407496
mov edi, dword [sym.imp.USER32.dll_IsCharUpperW]
mov edi, edi
movzx edx, word [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x407468
movzx eax, word [esi]
push eax
call edi
test eax, eax
je 0x407487
cmp byte [esp + 0x16], 0
jne 0x407483
movzx ecx, word [esi]
push ecx
mov byte [esp + 0x1a], 1
call edi
test eax, eax
je 0x407483
mov byte [esp + 0x14], 1
inc dword [esp + 0x20]
add esi, 2
cmp esi, ebx
jb 0x407450
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40749a
xor edi, edi
jmp 0x4074ed
cmp eax, 1
jne 0x4074ad
movzx edi, byte [esp + 0x14]
neg edi
sbb edi, edi
and edi, 2
jmp 0x4074ed
cmp byte [esp + 0x14], 0
jne 0x4074b8
xor edi, edi
jmp 0x4074ed
movzx edx, byte [ebp + 0x22]
add edx, edx
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x4074e6
jmp 0x4074d0
movzx eax, word [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerW]
test eax, eax
jne 0x4074e4
add esi, edi
cmp esi, ebx
jb 0x4074d0
cmp esi, ebx
jne 0x4074ed
mov edi, 1
mov dl, byte [ebp + 0x28]
test dl, dl
jne 0x4074f9
cmp byte [ebp + 0x29], dl
je 0x407503
mov byte [esp + 0x13], 0
mov byte [esp + 0x17], 1
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x1b8]
mov dword [ecx], eax
mov al, byte [ebp + 0x2a]
test al, al
je 0x407527
mov ecx, dword [0x4c8254]
movzx ecx, word [ecx*2 + 0x4c8256]
jmp 0x407529
xor ecx, ecx
movzx esi, di
movzx ecx, cx
shl esi, 0x10
or esi, ecx
mov ecx, dword [esp + 0x1bc]
mov dword [ecx], esi
xor ecx, ecx
cmp dword [ebp + 0xc], ecx
je 0x407570
test al, al
je 0x407568
mov edx, dword [0x4c8254]
mov ax, word [edx*2 + 0x4c8256]
mov word [0x4c8258], ax
mov dword [0x4c8254], 1
jmp 0x407588
mov dword [0x4c8254], ecx
jmp 0x407588
test dl, dl
je 0x407588
movzx edx, byte [ebp + 0x22]
sub dword [0x4c8254], edx
test al, al
je 0x407588
dec dword [0x4c8254]
cmp byte [ebp + 0x2c], cl
je 0x407593
mov dword [0x4c8254], ecx
mov ecx, dword [0x4c8254]
xor eax, eax
mov word [ecx*2 + 0x4c8258], ax
cmp byte [esp + 0x27], 0
mov bl, byte [esp + 0x13]
je 0x407615
test bl, bl
je 0x407615
push 0x100
lea edx, [esp + 0x68]
push 0
push edx
call fcn.00497430
mov al, byte [0x4cc35a]
mov cl, byte [0x4cc35b]
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 + 0x64]
call fcn.00412060
mov edx, dword [esp + 0x30]
push edx
movzx edx, word [0x4cc358]
push 0
push 2
lea eax, [esp + 0x3c]
push eax
movzx eax, byte [0x4cc354]
push ecx
push edx
push eax
call dword [sym.imp.USER32.dll_ToUnicodeEx]
mov byte [0x4cc354], 0
cmp byte [esp + 0x15], 0
je 0x4077f6
cmp dword [0x4cb640], 1
jne 0x4077f6
cmp byte [esp + 0x17], 0
jne 0x4077f6
mov edi, dword [esp + 0x2c]
xor esi, esi
test edi, edi
jle 0x4076ba
jmp 0x407650
cmp byte [0x4cb66d], 0
mov ecx, dword [0x4cb64c]
je 0x407670
movzx eax, word [esp + esi*2 + 0x18]
push eax
push ecx
call fcn.0048f331
add esp, 8
jmp 0x40767a
mov ax, word [esp + esi*2 + 0x18]
call fcn.004755e0
test eax, eax
jne 0x40770a
mov eax, dword [0x4cb678]
cmp eax, dword [0x4cb67c]
je 0x4076ba
mov dx, word [esp + esi*2 + 0x18]
mov ecx, dword [0x4cb674]
mov word [ecx + eax*2], dx
mov eax, dword [0x4cb678]
mov ecx, dword [0x4cb674]
inc eax
xor edx, edx
inc esi
mov dword [0x4cb678], eax
mov word [ecx + eax*2], dx
cmp esi, edi
jl 0x407650
xor esi, esi
cmp byte [0x4cb671], 0
je 0x407776
cmp byte [0x4cb66d], 0
je 0x407744
cmp dword [0x4cb65c], esi
jbe 0x4077de
mov edi, edi
mov eax, dword [0x4cb658]
mov eax, dword [eax + esi*4]
mov ecx, dword [0x4cb674]
push eax
push ecx
call fcn.0048f358
add esp, 8
test eax, eax
jne 0x40772d
inc esi
cmp esi, dword [0x4cb65c]
jb 0x4076e0
jmp 0x4077de
mov dx, word [esp + esi*2 + 0x18]
pop esi
pop edi
pop ebp
mov al, bl
mov dword [0x4cb640], 4
mov word [0x4cb654], dx
pop ebx
add esp, 0x18c
ret
pop esi
pop edi
pop ebp
mov al, bl
mov dword [0x4cb640], 3
pop ebx
add esp, 0x18c
ret
cmp dword [0x4cb65c], esi
jbe 0x4077de
mov edx, dword [0x4cb674]
mov eax, dword [0x4cb658]
mov eax, dword [eax + esi*4]
push edx
call fcn.00475630
add esp, 4
test eax, eax
jne 0x40772d
inc esi
cmp esi, dword [0x4cb65c]
jb 0x407750
jmp 0x4077de
cmp byte [0x4cb66d], 0
je 0x40781c
mov ebx, dword [0x4cb65c]
test ebx, ebx
je 0x4077da
mov edi, dword [0x4cb674]
mov ebp, dword [0x4cb658]
lea esp, [esp]
mov ecx, dword [ebp + esi*4]
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4077cc
test dx, dx
je 0x4077c8
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4077cc
add eax, 4
add ecx, 4
test dx, dx
jne 0x4077a6
xor eax, eax
jmp 0x4077d1
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x407803
inc esi
cmp esi, ebx
jb 0x4077a0
mov bl, byte [esp + 0x13]
mov ecx, dword [0x4cb67c]
cmp dword [0x4cb678], ecx
jl 0x4077f6
mov dword [0x4cb640], 5
mov al, bl
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x18c
ret
mov dword [0x4cb640], 3
mov al, byte [esp + 0x13]
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x18c
ret
cmp dword [0x4cb65c], esi
jbe 0x4077de
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea ebx, [ebx]
mov ecx, dword [0x4cb658]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4cb674]
push edx
push eax
call edi
test eax, eax
je 0x40772d
inc esi
cmp esi, dword [0x4cb65c]
jb 0x407830
jmp 0x4077de