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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x4663a8]
push esi
mov esi, dword [0x465c48]
cmp esi, 1
jne 0x40a5ae
cmp byte [0x465c74], 0
jne 0x40a5ae
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp dword [ecx + eax], 0
mov byte [ebp - 1], 0
je 0x40a5b2
mov byte [ebp - 1], 1
cmp byte [ebp + 0x14], 0
je 0x40a5d7
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp byte [ecx + eax + 4], 0
mov al, 1
jne 0x40adc7
mov al, byte [ebp - 1]
jmp 0x40adc7
cmp dword [0x466ed8], 0
je 0x40a5f0
cmp byte [ebp + 0x18], 0
jne 0x40a5f0
cmp byte [ebp - 1], 0
mov byte [ebp + 0x17], 1
jne 0x40a5f4
mov byte [ebp + 0x17], 0
cmp esi, 1
push ebx
mov bl, byte [0x465224]
push edi
mov di, word [ebp + 0x10]
jne 0x40a64f
cmp byte [0x465c72], 0
je 0x40a614
cmp byte [ebp + 0x18], 0
jne 0x40a64f
movzx eax, byte [ebp + 0xc]
mov ecx, dword [0x465c4c]
mov al, byte [eax + ecx]
test al, al
mov edx, dword [0x465c50]
mov byte [ebp - 3], 1
jne 0x40a639
movzx eax, di
mov al, byte [eax + edx]
test al, al
je 0x40a653
mov cl, al
shr cl, 1
shr al, 2
and cl, 1
and al, 1
test cl, cl
je 0x40a689
test al, al
je 0x40a68d
jmp 0x40a69f
mov byte [ebp - 3], 0
mov al, byte [ebp + 0xc]
cmp al, 0x21
jb 0x40a709
cmp al, 0x28
jbe 0x40a6ec
cmp al, 0x5a
jbe 0x40a709
cmp al, 0x5c
jbe 0x40a682
cmp al, 0x9f
jbe 0x40a709
cmp al, 0xa5
ja 0x40a709
mov al, 1
jmp 0x40adc5
test al, al
je 0x40a69f
test cl, cl
je 0x40a696
test bl, 0x30
jne 0x40a69f
test al, al
je 0x40a653
test bl, 0x30
jne 0x40a653
push 4
movzx eax, di
pop esi
mov dword [0x465c48], esi
cmp byte [eax + edx], 0
mov word [0x465c56], di
setne al
test cl, cl
mov byte [0x465c58], al
mov al, byte [ebp + 0xc]
mov byte [0x465c54], al
je 0x40a6d6
test bl, 0x30
mov byte [0x465c59], 1
jne 0x40a6dd
mov byte [0x465c59], 0
cmp byte [ebp + 0x17], 0
jne 0x40a656
jmp 0x40adc2
cmp byte [ebp + 0x17], 0
je 0x40a709
cmp dword [0x464ff8], 0
je 0x40a709
and dword [0x464ff8], 0
mov byte [0x465000], 0
test bl, bl
je 0x40a737
cmp esi, 1
jne 0x40a71b
cmp byte [0x465c73], 0
jne 0x40a737
cmp bl, 0x10
je 0x40a737
cmp bl, 0x20
je 0x40a737
test bl, 0xc
je 0x40adc2
test bl, 3
je 0x40adc2
cmp al, 8
jne 0x40a79e
test bl, bl
jne 0x40a79e
cmp byte [ebp - 3], bl
je 0x40a769
cmp esi, 1
jne 0x40a769
cmp byte [0x465c70], bl
je 0x40a769
mov eax, dword [0x465c7c]
test eax, eax
je 0x40a769
mov ecx, dword [0x465c78]
dec eax
mov dword [0x465c7c], eax
mov byte [ecx + eax], bl
cmp byte [ebp + 0x17], 0
je 0x40a785
mov eax, dword [0x464ff8]
test eax, eax
je 0x40a785
dec eax
mov dword [0x464ff8], eax
mov byte [eax + 0x465000], 0
cmp byte [0x4663b6], 0
je 0x40adc2
mov byte [0x4663b6], 0
jmp 0x40adc2
push 0x100
lea eax, [ebp - 0x118]
push 0x465228
push eax
call fcn.00455650
xor eax, eax
mov al, byte [0x465224]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.0040f8d6
add esp, 0x14
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40a7e0
or byte [ebp - 0x104], 1
jmp 0x40a7e7
and byte [ebp - 0x104], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
xor eax, eax
cmp esi, eax
je 0x40a7fd
push eax
push esi
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
mov bl, byte [ebp + 0xc]
xor eax, eax
cmp dword [0x465370], eax
setne al
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x118]
push eax
mov eax, dword [ebp + 8]
push dword [eax + 4]
movzx eax, bl
push eax
call dword [sym.imp.USER32.dll_ToAsciiEx]
test eax, eax
mov dword [ebp - 0x18], eax
je 0x40adc2
cmp byte [0x4663b6], 0
je 0x40a851
cmp bl, 9
je 0x40a851
cmp bl, 0x1b
mov byte [ebp - 2], 1
jne 0x40a855
mov byte [ebp - 2], 0
xor eax, eax
cmp dword [ebp - 0x18], eax
jge 0x40a8a0
cmp byte [ebp - 2], al
jne 0x40a8a0
cmp byte [ebp - 1], al
je 0x40a899
mov al, byte [0x465224]
test al, 0x30
setne cl
test al, 3
mov byte [0x4663b6], bl
mov word [0x4663b4], di
mov byte [0x4663b1], cl
je 0x40a892
test al, 0xc
mov byte [0x4663b0], 1
jne 0x40a899
mov byte [0x4663b0], 0
xor al, al
jmp 0x40adc5
cmp byte [ebp - 8], 0xd
jne 0x40a8aa
mov byte [ebp - 8], 0xa
cmp byte [ebp - 7], 0xd
jne 0x40a8b4
mov byte [ebp - 7], 0xa
cmp byte [ebp + 0x17], 0
mov byte [ebp - 4], 0
je 0x40abe3
cmp esi, dword [0x464ff4]
je 0x40a8d9
mov dword [0x464ff4], esi
mov byte [0x465000], 0
jmp 0x40a90d
mov eax, dword [0x464ff8]
push 0x5a
pop ecx
sub ecx, eax
cmp ecx, 3
jge 0x40a90d
mov esi, 0x46502d
push esi
call fcn.00455c50
mov dword [0x464ff8], eax
inc eax
push eax
push esi
push 0x465000
call fcn.00455e40
mov eax, dword [0x464ff8]
add esp, 0x10
mov cl, byte [ebp - 8]
mov byte [eax + 0x465000], cl
inc eax
cmp dword [ebp - 0x18], 1
mov dword [0x464ff8], eax
jle 0x40a931
mov cl, byte [ebp - 7]
mov byte [eax + 0x465000], cl
inc eax
mov dword [0x464ff8], eax
test eax, eax
mov byte [eax + 0x465000], 0
je 0x40abe3
and dword [ebp - 0x14], 0
cmp dword [0x466edc], 0
jbe 0x40abe3
mov ecx, dword [0x466ed8]
mov edx, dword [ebp - 0x14]
mov esi, dword [ecx + edx*4]
cmp byte [esi + 0x22], 0
jne 0x40aa39
cmp byte [esi + 0x2a], 0
movzx ecx, byte [esi + 0x21]
je 0x40a9a2
cmp eax, ecx
jle 0x40aa39
movsx eax, byte [eax + 0x464fff]
push eax
push str._____:____.___n__t
call fcn.00455d80
test eax, eax
pop ecx
pop ecx
je 0x40aa34
mov eax, dword [0x464ff8]
lea edx, [eax + 0x464ffe]
jmp 0x40a9b0
cmp eax, ecx
jl 0x40aa39
lea edx, [eax + 0x464fff]
cmp byte [esi + 0x25], 0
movzx edi, byte [esi + 0x21]
mov ecx, dword [esi + 4]
mov dword [ebp + 0x14], edx
lea edi, [edi + ecx - 1]
jne 0x40aa58
cmp edi, ecx
jb 0x40a9fa
movzx eax, byte [edx]
mov ebx, dword [sym.imp.USER32.dll_CharLowerA]
push eax
call ebx
movzx ecx, byte [edi]
push ecx
mov dword [ebp - 0xc], eax
call ebx
mov ecx, dword [ebp - 0xc]
cmp ecx, eax
mov edx, dword [ebp + 0x14]
jne 0x40a9f5
dec edx
dec edi
cmp edi, dword [esi + 4]
mov dword [ebp + 0x14], edx
jae 0x40a9cc
mov eax, dword [0x464ff8]
cmp edi, dword [esi + 4]
jae 0x40aa39
cmp byte [esi + 0x2b], 0
jne 0x40aa1c
cmp edx, 0x465000
jb 0x40aa1c
xor eax, eax
mov al, byte [edx]
push eax
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x40aa34
push dword [esi + 0x10]
xor eax, eax
mov al, byte [esi + 0x20]
push dword [esi + 0xc]
push eax
call fcn.0040d5f2
add esp, 0xc
test eax, eax
jne 0x40aa5e
mov eax, dword [0x464ff8]
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [0x466edc]
jb 0x40a951
jmp 0x40abe3
mov bl, byte [edx]
cmp bl, byte [edi]
jne 0x40a9fa
dec edx
dec edi
cmp edi, ecx
jae 0x40aa50
jmp 0x40a9fa
cmp byte [esi + 0x26], 0
jne 0x40aa6b
xor ebx, ebx
jmp 0x40ab22
cmp byte [esi + 0x2a], 0
mov eax, dword [0x464ff8]
lea eax, [eax + 0x465000]
mov dword [ebp - 0x10], eax
je 0x40aa82
dec dword [ebp - 0x10]
movzx eax, byte [esi + 0x21]
mov edi, dword [ebp - 0x10]
and dword [ebp - 0xc], 0
sub edi, eax
xor bl, bl
cmp edi, dword [ebp - 0x10]
mov byte [ebp + 0x17], 0
jae 0x40aa64
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40aab6
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x40aad4
cmp byte [ebp + 0x17], 0
jne 0x40aad1
xor eax, eax
mov al, byte [edi]
mov byte [ebp + 0x17], 1
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x40aad1
mov bl, 1
inc dword [ebp - 0xc]
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40aa9a
cmp dword [ebp - 0xc], 0
je 0x40aa64
cmp dword [ebp - 0xc], 1
jne 0x40aaef
neg bl
sbb ebx, ebx
and ebx, 2
jmp 0x40ab22
test bl, bl
je 0x40aa64
movzx eax, byte [esi + 0x21]
mov edi, dword [ebp - 0x10]
push 2
pop ebx
sub edi, eax
jmp 0x40ab15
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40ab1a
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40ab05
cmp edi, dword [ebp - 0x10]
jne 0x40ab22
xor ebx, ebx
inc ebx
cmp byte [esi + 0x27], 0
jne 0x40ab2e
cmp byte [esi + 0x28], 0
je 0x40ab36
mov byte [ebp - 1], 0
mov byte [ebp - 4], 1
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
cmp byte [esi + 0x2a], 0
je 0x40ab58
cmp byte [esi + 0x27], 0
je 0x40ab58
mov eax, dword [0x464ff8]
movzx eax, byte [eax + 0x464fff]
jmp 0x40ab6b
cmp byte [ebp - 2], 0
je 0x40ab69
cmp byte [ebp - 4], 0
je 0x40ab69
xor eax, eax
inc eax
jmp 0x40ab6b
xor eax, eax
movzx ecx, bx
movzx eax, ax
shl ecx, 0x10
or ecx, eax
mov eax, dword [ebp + 0x20]
mov dword [eax], ecx
mov eax, dword [esi + 8]
cmp byte [eax], 0
je 0x40abae
cmp byte [esi + 0x2a], 0
je 0x40aba5
mov eax, dword [0x464ff8]
mov al, byte [eax + 0x464fff]
mov byte [0x465000], al
mov dword [0x464ff8], 1
jmp 0x40abca
and dword [0x464ff8], 0
jmp 0x40abca
cmp byte [esi + 0x27], 0
je 0x40abca
movzx eax, byte [esi + 0x21]
sub dword [0x464ff8], eax
cmp byte [esi + 0x2a], 0
je 0x40abca
dec dword [0x464ff8]
cmp byte [esi + 0x2c], 0
je 0x40abd7
and dword [0x464ff8], 0
mov eax, dword [0x464ff8]
mov byte [eax + 0x465000], 0
cmp byte [ebp - 2], 0
je 0x40acdd
cmp byte [ebp - 1], 0
mov al, byte [0x4663b6]
mov byte [ebp - 0x14], al
mov byte [0x4663b6], 0
je 0x40acdd
mov cl, byte [0x465224]
mov byte [0x46638c], al
xor al, al
test cl, 0x10
je 0x40ac1c
mov al, 0xa0
jmp 0x40ac23
test cl, 0x20
je 0x40ac28
mov al, 0xa1
mov byte [ebp - 0xc], al
jmp 0x40ac2c
mov byte [ebp - 0xc], 0xa0
test al, al
mov al, byte [0x4663b1]
setne byte [ebp + 0x17]
cmp al, byte [ebp + 0x17]
mov esi, 0xffc3d44d
je 0x40ac58
xor ecx, ecx
push esi
push ecx
push ecx
push ecx
push dword [ebp - 0xc]
test al, al
sete cl
push ecx
call fcn.00410525
add esp, 0x18
cmp byte [0x4663b0], 0
je 0x40adca
test byte [0x465224], 8
jne 0x40adca
push esi
xor edi, edi
push edi
push edi
push edi
push 0xa5
push edi
mov bl, 1
call fcn.00410525
add esp, 0x18
xor eax, eax
mov ax, word [0x4663b4]
push 0xffc3d44e
push edi
push edi
push eax
push dword [ebp - 0x14]
push 2
call fcn.00410525
add esp, 0x18
test bl, bl
je 0x40acbc
push esi
push edi
push edi
push edi
push 0xa5
push 1
call fcn.00410525
add esp, 0x18
mov al, byte [0x4663b1]
cmp al, byte [ebp + 0x17]
je 0x40acdd
push esi
xor ecx, ecx
push edi
test al, al
push edi
setne cl
push edi
push dword [ebp - 0xc]
push ecx
call fcn.00410525
add esp, 0x18
cmp byte [ebp - 3], 0
je 0x40adc2
cmp dword [0x465c48], 1
jne 0x40adc2
cmp byte [ebp - 4], 0
jne 0x40adc2
mov eax, dword [0x465c7c]
cmp eax, dword [0x465c80]
jge 0x40ad2c
mov ecx, dword [0x465c78]
mov dl, byte [ebp - 8]
mov byte [ecx + eax], dl
inc dword [0x465c7c]
mov eax, dword [0x465c78]
mov ecx, dword [0x465c7c]
mov byte [eax + ecx], 0
cmp dword [ebp - 0x18], 1
jle 0x40ad60
mov eax, dword [0x465c7c]
cmp eax, dword [0x465c80]
jge 0x40ad60
mov ecx, dword [0x465c78]
mov dl, byte [ebp - 7]
mov byte [ecx + eax], dl
inc dword [0x465c7c]
mov eax, dword [0x465c78]
mov ecx, dword [0x465c7c]
mov byte [eax + ecx], 0
mov eax, dword [0x465c60]
test eax, eax
je 0x40adab
xor esi, esi
cmp byte [0x465c75], 0
je 0x40adfb
cmp byte [0x465c71], 0
je 0x40add3
test eax, eax
jbe 0x40adab
mov eax, dword [0x465c5c]
push dword [eax + esi*4]
push dword [0x465c78]
call fcn.00455ce0
test eax, eax
pop ecx
pop ecx
jne 0x40ae5d
inc esi
cmp esi, dword [0x465c60]
jb 0x40ad85
mov eax, dword [0x465c80]
cmp dword [0x465c7c], eax
jl 0x40adc2
mov dword [0x465c48], 5
mov al, byte [ebp - 1]
pop edi
pop ebx
pop esi
leave
ret
xor bl, bl
xor edi, edi
jmp 0x40ac88
test eax, eax
jbe 0x40adab
mov eax, dword [0x465c5c]
push dword [eax + esi*4]
push dword [0x465c78]
call fcn.00438a3b
test eax, eax
pop ecx
pop ecx
jne 0x40ae5d
inc esi
cmp esi, dword [0x465c60]
jb 0x40add7
jmp 0x40adab
cmp byte [0x465c71], 0
je 0x40ae2f
test eax, eax
jbe 0x40adab
mov eax, dword [0x465c5c]
push dword [eax + esi*4]
push dword [0x465c78]
call fcn.00455990
test eax, eax
pop ecx
pop ecx
je 0x40ae5d
inc esi
cmp esi, dword [0x465c60]
jb 0x40ae08
jmp 0x40adab
test eax, eax
jbe 0x40adab
mov eax, dword [0x465c5c]
push dword [eax + esi*4]
push dword [0x465c78]
call dword [sym.imp.KERNEL32.DLL_lstrcmpiA]
test eax, eax
je 0x40ae5d
inc esi
cmp esi, dword [0x465c60]
jb 0x40ae37
jmp 0x40adab
mov dword [0x465c48], 3
jmp 0x40adc2