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

Disassembly:
mov ecx, dword [0x4a65a8]
sub esp, 0x120
push ebx
mov bl, byte [esp + 0x12c]
push ebp
mov ebp, dword [0x4a7c88]
push esi
push edi
mov di, word [esp + 0x13c]
cmp ebp, 1
jne 0x406a07
cmp byte [0x4a7cb4], 0
jne 0x406a07
movzx eax, bl
lea eax, [eax + eax*8]
shl eax, 5
cmp dword [eax + ecx], 0
mov byte [esp + 0x11], 0
je 0x406a0c
mov byte [esp + 0x11], 1
cmp byte [esp + 0x140], 0
je 0x406a3b
movzx eax, bl
lea edx, [eax + eax*8]
shl edx, 5
cmp byte [edx + ecx + 4], 0
mov al, 1
jne 0x407340
mov al, byte [esp + 0x11]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
cmp dword [0x4a7570], 0
je 0x406a53
test dl, dl
jne 0x406a53
mov byte [esp + 0x12], 1
cmp byte [esp + 0x11], dl
jne 0x406a58
mov byte [esp + 0x12], 0
mov al, byte [0x4a5c6d]
cmp ebp, 1
jne 0x406b29
cmp byte [0x4a7cb2], 0
je 0x406a77
test dl, dl
jne 0x406b29
mov edx, dword [0x4a7c8c]
mov esi, dword [0x4a7c90]
movzx ecx, bl
mov cl, byte [ecx + edx]
mov byte [esp + 0x13], 1
test cl, cl
jne 0x406a9c
movzx ecx, di
mov cl, byte [ecx + esi]
test cl, cl
je 0x406b08
mov dl, cl
shr cl, 2
shr dl, 1
and cl, 1
and dl, 1
je 0x406b30
test cl, cl
jne 0x406abf
test al, 0x30
jne 0x406abf
test cl, cl
je 0x406b08
test al, 0x30
jne 0x406b08
movzx ecx, di
mov ebp, 4
mov dword [0x4a7c88], ebp
cmp byte [ecx + esi], 0
mov byte [0x4a7c94], bl
setne cl
mov byte [0x4a7c98], cl
mov word [0x4a7c96], di
test dl, dl
je 0x406af6
mov byte [0x4a7c99], 1
test al, 0x30
jne 0x406afd
mov byte [0x4a7c99], 0
cmp byte [esp + 0x12], 0
je 0x40733c
movzx ebx, byte [esp + 0x138]
lea ecx, [ebx - 0x21]
cmp ecx, 0x84
ja case.0x406b22.41
movzx edx, byte [ecx + 0x407358]
jmp dword [edx*4 + 0x40734c]
mov byte [esp + 0x13], 0
jmp 0x406b08
test cl, cl
je 0x406abf
jmp 0x406abb
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
cmp byte [esp + 0x12], 0
je case.0x406b22.41
mov ecx, dword [0x4a4a1c]
test ecx, ecx
je 0x406b6b
xor ecx, ecx
mov byte [0x4a4a20], 0
mov dword [0x4a4a1c], ecx
jmp 0x406b6b
mov ecx, dword [0x4a4a1c]
test al, al
je 0x406b95
cmp ebp, 1
jne 0x406b7d
cmp byte [0x4a7cb3], 0
jne 0x406b95
cmp al, 0x10
je 0x406b95
cmp al, 0x20
je 0x406b95
test al, 0xc
je 0x40733c
test al, 3
je 0x40733c
cmp byte [esp + 0x138], 8
jne 0x406c0b
test al, al
jne 0x406c0b
cmp byte [esp + 0x13], al
je 0x406bcf
cmp ebp, 1
jne 0x406bcf
cmp byte [0x4a7cb0], al
je 0x406bcf
mov eax, dword [0x4a7cbc]
test eax, eax
je 0x406bcf
mov edx, dword [0x4a7cb8]
dec eax
mov dword [0x4a7cbc], eax
mov byte [edx + eax], 0
cmp byte [esp + 0x12], 0
je 0x406be8
test ecx, ecx
je 0x406be8
dec ecx
mov dword [0x4a4a1c], ecx
mov byte [ecx + 0x4a4a20], 0
cmp byte [0x4a84fc], 0
je 0x40733c
mov byte [0x4a84fc], 0
mov al, byte [esp + 0x11]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
mov ecx, 0x40
mov esi, 0x4a5c90
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x30]
call fcn.00411060
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x406c37
or byte [esp + 0x44], 1
jmp 0x406c3c
and byte [esp + 0x44], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, eax
test ebp, ebp
je 0x406c53
push 0
push ebp
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x406c55
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
mov edi, dword [sym.imp.USER32.dll_ToAsciiEx]
mov esi, eax
xor eax, eax
cmp dword [0x4a5dfc], eax
push esi
setne al
lea ecx, [esp + 0x18]
lea edx, [esp + 0x34]
mov dword [esp + 0x30], esi
push eax
mov eax, dword [esp + 0x13c]
push ecx
mov ecx, dword [eax + 4]
push edx
push ecx
push ebx
call edi
mov dword [esp + 0x28], eax
test eax, eax
je 0x40733c
cmp byte [0x4a84fc], 0
mov cl, byte [esp + 0x138]
je 0x406cb8
cmp cl, 9
je 0x406cb8
mov byte [esp + 0x1c], 1
cmp cl, 0x1b
jne 0x406cbd
mov byte [esp + 0x1c], 0
test eax, eax
jns 0x406d3b
cmp byte [esp + 0x11], 0
je 0x40733c
mov al, byte [0x4a5c6d]
mov dx, word [esp + 0x13c]
test al, 0x30
mov byte [0x4a84fc], cl
setne cl
mov word [0x4a8500], dx
mov byte [0x4a8502], cl
test al, 3
je 0x406d00
mov byte [0x4a8503], 1
test al, 0xc
jne 0x406d07
mov byte [0x4a8503], 0
xor edx, edx
cmp dword [0x4a5dfc], edx
push esi
setne dl
lea eax, [esp + 0x18]
lea ecx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x13c]
push eax
mov eax, dword [edx + 4]
push ecx
push eax
push ebx
call edi
mov al, byte [esp + 0x11]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
test byte [0x4a5c6d], 3
jne 0x406d5c
mov cl, 0xd
mov al, 0xa
cmp byte [esp + 0x14], cl
jne 0x406d52
mov byte [esp + 0x14], al
cmp byte [esp + 0x15], cl
jne 0x406d5c
mov byte [esp + 0x15], al
cmp byte [esp + 0x12], 0
mov byte [esp + 0x1a], 0
je 0x407105
cmp ebp, dword [0x4a4a18]
je 0x406d85
mov dword [0x4a4a18], ebp
mov byte [0x4a4a20], 0
xor ecx, ecx
jmp 0x406dc8
mov ecx, dword [0x4a4a1c]
mov edx, 0x5a
sub edx, ecx
cmp edx, 3
jge 0x406dc8
mov eax, 0x4a4a4d
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406da0
sub eax, edx
mov dword [0x4a4a1c], eax
inc eax
push eax
push 0x4a4a4d
push 0x4a4a20
call fcn.00481b10
mov ecx, dword [0x4a4a1c]
add esp, 0xc
mov al, byte [esp + 0x14]
mov byte [ecx + 0x4a4a20], al
inc ecx
cmp dword [esp + 0x28], 1
mov dword [0x4a4a1c], ecx
jle 0x406df1
mov dl, byte [esp + 0x15]
mov byte [ecx + 0x4a4a20], dl
inc ecx
mov dword [0x4a4a1c], ecx
mov byte [ecx + 0x4a4a20], 0
test ecx, ecx
je 0x407105
cmp dword [0x4a7574], 0
mov dword [esp + 0x24], 0
jbe 0x407105
jmp 0x406e20
mov eax, dword [0x4a7570]
mov edx, dword [esp + 0x24]
mov ebp, dword [eax + edx*4]
cmp byte [ebp + 0x27], 0
jne 0x406f2e
cmp byte [ebp + 0x2f], 0
je 0x406e73
movzx eax, byte [ebp + 0x26]
cmp ecx, eax
jle 0x406f2e
movsx eax, byte [ecx + 0x4a4a1f]
push eax
push str._____:____.___n__t
call fcn.00481f21
add esp, 8
test eax, eax
je 0x406f28
mov ecx, dword [0x4a4a1c]
lea edi, [ecx + 0x4a4a1e]
jmp 0x406e85
movzx edx, byte [ebp + 0x26]
cmp ecx, edx
jl 0x406f2e
lea edi, [ecx + 0x4a4a1f]
cmp byte [ebp + 0x2a], 0
movzx edx, byte [ebp + 0x26]
mov eax, dword [ebp + 4]
lea esi, [edx + eax - 1]
je 0x406eae
cmp esi, eax
jb 0x406edd
lea ebx, [ebx]
mov dl, byte [edi]
cmp dl, byte [esi]
jne 0x406edd
dec esi
dec edi
cmp esi, eax
jae 0x406ea0
jmp 0x406edd
cmp esi, eax
jb 0x406edd
movzx eax, byte [esi]
mov ebx, dword [sym.imp.USER32.dll_CharLowerA]
push eax
call ebx
movzx ecx, byte [edi]
push ecx
mov dword [esp + 0x24], eax
call ebx
mov ecx, dword [esp + 0x20]
cmp al, cl
jne 0x406ed7
dec esi
dec edi
cmp esi, dword [ebp + 4]
jae 0x406eb2
mov ecx, dword [0x4a4a1c]
cmp esi, dword [ebp + 4]
jae 0x406f2e
cmp byte [ebp + 0x30], 0
jne 0x406efe
cmp edi, 0x4a4a20
jb 0x406efe
movzx edx, byte [edi]
push edx
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x406f28
mov eax, dword [ebp]
test eax, eax
je 0x406f09
mov eax, dword [eax]
jmp 0x406f0e
mov eax, 0x4947f9
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.00409130
add esp, 8
test eax, eax
jne 0x406f48
mov ecx, dword [0x4a4a1c]
mov eax, dword [esp + 0x24]
inc eax
mov dword [esp + 0x24], eax
cmp eax, dword [0x4a7574]
jb 0x406e20
jmp 0x407105
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.00409b20
add esp, 4
test al, al
je 0x407105
xor edi, edi
cmp byte [ebp + 0x2b], 0
je 0x40704c
cmp byte [ebp + 0x2f], 0
mov ebx, dword [0x4a4a1c]
lea ebx, [ebx + 0x4a4a20]
je 0x406f90
dec ebx
movzx ecx, byte [ebp + 0x26]
mov esi, ebx
sub esi, ecx
mov dword [esp + 0x20], edi
mov byte [esp + 0x1b], 0
mov byte [esp + 0x12], 0
cmp esi, ebx
jae 0x406ff4
mov edi, dword [sym.imp.USER32.dll_IsCharUpperA]
movzx edx, byte [esi]
push edx
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x406fc8
movzx eax, byte [esi]
push eax
call edi
test eax, eax
je 0x406fe7
cmp byte [esp + 0x1b], 0
jne 0x406fe3
movzx ecx, byte [esi]
push ecx
mov byte [esp + 0x1f], 1
call edi
test eax, eax
je 0x406fe3
mov byte [esp + 0x12], 1
inc dword [esp + 0x20]
inc esi
cmp esi, ebx
jb 0x406fb0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x406ff8
xor edi, edi
jmp 0x40704c
cmp eax, 1
jne 0x40700b
movzx edi, byte [esp + 0x12]
neg edi
sbb edi, edi
and edi, 2
jmp 0x40704c
cmp byte [esp + 0x12], 0
jne 0x407016
xor edi, edi
jmp 0x40704c
movzx edx, byte [ebp + 0x26]
mov esi, ebx
sub esi, edx
mov edi, 2
cmp esi, ebx
jae 0x407045
jmp 0x407030
movzx eax, byte [esi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x407043
inc esi
cmp esi, ebx
jb 0x407030
cmp esi, ebx
jne 0x40704c
mov edi, 1
mov dl, byte [ebp + 0x2c]
test dl, dl
jne 0x407058
cmp byte [ebp + 0x2d], dl
je 0x407062
mov byte [esp + 0x11], 0
mov byte [esp + 0x1a], 1
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x148]
mov dword [ecx], eax
mov al, byte [ebp + 0x2f]
test al, al
je 0x407085
mov ecx, dword [0x4a4a1c]
movsx ecx, byte [ecx + 0x4a4a1f]
jmp 0x407087
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 ecx, dword [ebp + 8]
cmp byte [ecx], 0
je 0x4070d0
test al, al
je 0x4070c4
mov edx, dword [0x4a4a1c]
mov al, byte [edx + 0x4a4a1f]
mov byte [0x4a4a20], al
mov dword [0x4a4a1c], 1
jmp 0x4070e8
mov dword [0x4a4a1c], 0
jmp 0x4070e8
test dl, dl
je 0x4070e8
movzx ecx, byte [ebp + 0x26]
sub dword [0x4a4a1c], ecx
test al, al
je 0x4070e8
dec dword [0x4a4a1c]
cmp byte [ebp + 0x31], 0
je 0x4070f8
mov dword [0x4a4a1c], 0
mov edx, dword [0x4a4a1c]
mov byte [edx + 0x4a4a20], 0
cmp byte [esp + 0x1c], 0
je 0x407176
cmp byte [esp + 0x11], 0
mov bl, byte [0x4a84fc]
mov byte [0x4a84fc], 0
je 0x407176
push 0x100
lea eax, [esp + 0x34]
push 0
push eax
call fcn.0048a290
mov al, byte [0x4a8502]
mov cl, byte [0x4a8503]
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.00411060
mov edx, dword [esp + 0x2c]
push edx
movzx edx, word [0x4a8500]
push 0
lea eax, [esp + 0x24]
push eax
push ecx
movzx eax, bl
push edx
push eax
call dword [sym.imp.USER32.dll_ToAsciiEx]
cmp byte [esp + 0x13], 0
je 0x40733c
mov ebx, 1
cmp dword [0x4a7c88], ebx
jne 0x40733c
cmp byte [esp + 0x1a], 0
jne 0x40733c
mov eax, dword [0x4a7cbc]
cmp eax, dword [0x4a7cc0]
jge 0x4071cd
mov ecx, dword [0x4a7cb8]
mov dl, byte [esp + 0x14]
mov byte [ecx + eax], dl
mov eax, dword [0x4a7cbc]
mov ecx, dword [0x4a7cb8]
add eax, ebx
mov dword [0x4a7cbc], eax
mov byte [ecx + eax], 0
cmp dword [esp + 0x28], ebx
jle 0x407203
mov eax, dword [0x4a7cbc]
cmp eax, dword [0x4a7cc0]
jge 0x407203
mov edx, dword [0x4a7cb8]
mov cl, byte [esp + 0x15]
mov byte [edx + eax], cl
mov eax, dword [0x4a7cbc]
mov edx, dword [0x4a7cb8]
add eax, ebx
mov dword [0x4a7cbc], eax
mov byte [edx + eax], 0
mov eax, dword [0x4a7ca0]
test eax, eax
jne 0x40721c
mov eax, dword [0x4a7cc0]
cmp dword [0x4a7cbc], eax
jmp 0x407330
xor esi, esi
cmp byte [0x4a7cb5], 0
je 0x4072b6
cmp byte [0x4a7cb1], 0
je 0x407285
test eax, eax
je 0x407324
lea esp, [esp]
mov ecx, dword [0x4a7c9c]
mov eax, dword [ecx + esi*4]
mov edx, dword [0x4a7cb8]
push eax
push edx
call fcn.00482062
add esp, 8
test eax, eax
jne 0x40726c
add esi, ebx
cmp esi, dword [0x4a7ca0]
jb 0x407240
jmp 0x407324
mov dword [0x4a7c88], 3
mov al, byte [esp + 0x11]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret
test eax, eax
je 0x407324
lea ecx, [ecx]
mov eax, dword [0x4a7c9c]
mov ecx, dword [eax + esi*4]
mov eax, dword [0x4a7cb8]
push ecx
call fcn.0046eb30
add esp, 4
test eax, eax
jne 0x40726c
add esi, ebx
cmp esi, dword [0x4a7ca0]
jb 0x407290
jmp 0x407324
cmp byte [0x4a7cb1], 0
je 0x4072eb
test eax, eax
je 0x407324
mov edx, dword [0x4a7c9c]
mov eax, dword [edx + esi*4]
push eax
mov eax, dword [0x4a7cb8]
push eax
call fcn.004810a1
add esp, 8
test eax, eax
je 0x40726c
add esi, ebx
cmp esi, dword [0x4a7ca0]
jb 0x4072c3
jmp 0x407324
test eax, eax
je 0x407324
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
jmp 0x407300
mov ecx, dword [0x4a7c9c]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x4a7cb8]
push edx
push eax
call edi
test eax, eax
je 0x40726c
add esi, ebx
cmp esi, dword [0x4a7ca0]
jb 0x407300
mov ecx, dword [0x4a7cc0]
cmp dword [0x4a7cbc], ecx
jl 0x40733c
mov dword [0x4a7c88], 5
mov al, byte [esp + 0x11]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret