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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x468404]
push esi
mov esi, dword [0x467ca0]
cmp esi, 1
jne 0x40cf5b
cmp byte [0x467ccc], 0
jne 0x40cf5b
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp dword [ecx + eax], 0
mov byte [ebp - 1], 0
je 0x40cf5f
mov byte [ebp - 1], 1
cmp byte [ebp + 0x14], 0
je 0x40cf84
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp byte [ecx + eax + 4], 0
mov al, 1
jne 0x40d76e
mov al, byte [ebp - 1]
jmp 0x40d76e
cmp dword [0x4693e0], 0
je 0x40cf9d
cmp byte [ebp + 0x18], 0
jne 0x40cf9d
cmp byte [ebp - 1], 0
mov byte [ebp + 0x17], 1
jne 0x40cfa1
mov byte [ebp + 0x17], 0
cmp esi, 1
push ebx
mov bl, byte [0x467270]
push edi
mov di, word [ebp + 0x10]
jne 0x40cffc
cmp byte [0x467cca], 0
je 0x40cfc1
cmp byte [ebp + 0x18], 0
jne 0x40cffc
movzx eax, byte [ebp + 0xc]
mov ecx, dword [0x467ca4]
mov al, byte [eax + ecx]
test al, al
mov edx, dword [0x467ca8]
mov byte [ebp - 3], 1
jne 0x40cfe6
movzx eax, di
mov al, byte [eax + edx]
test al, al
je 0x40d000
mov cl, al
shr cl, 1
shr al, 2
and cl, 1
and al, 1
test cl, cl
je 0x40d036
test al, al
je 0x40d03a
jmp 0x40d04c
mov byte [ebp - 3], 0
mov al, byte [ebp + 0xc]
cmp al, 0x21
jb 0x40d0b6
cmp al, 0x28
jbe 0x40d099
cmp al, 0x5a
jbe 0x40d0b6
cmp al, 0x5c
jbe 0x40d02f
cmp al, 0x9f
jbe 0x40d0b6
cmp al, 0xa5
ja 0x40d0b6
mov al, 1
jmp 0x40d76c
test al, al
je 0x40d04c
test cl, cl
je 0x40d043
test bl, 0x30
jne 0x40d04c
test al, al
je 0x40d000
test bl, 0x30
jne 0x40d000
push 4
movzx eax, di
pop esi
mov dword [0x467ca0], esi
cmp byte [eax + edx], 0
mov word [0x467cae], di
setne al
test cl, cl
mov byte [0x467cb0], al
mov al, byte [ebp + 0xc]
mov byte [0x467cac], al
je 0x40d083
test bl, 0x30
mov byte [0x467cb1], 1
jne 0x40d08a
mov byte [0x467cb1], 0
cmp byte [ebp + 0x17], 0
jne 0x40d003
jmp 0x40d769
cmp byte [ebp + 0x17], 0
je 0x40d0b6
cmp dword [0x467110], 0
je 0x40d0b6
and dword [0x467110], 0
mov byte [0x467118], 0
test bl, bl
je 0x40d0e4
cmp esi, 1
jne 0x40d0c8
cmp byte [0x467ccb], 0
jne 0x40d0e4
cmp bl, 0x10
je 0x40d0e4
cmp bl, 0x20
je 0x40d0e4
test bl, 0xc
je 0x40d769
test bl, 3
je 0x40d769
cmp al, 8
jne 0x40d14b
test bl, bl
jne 0x40d14b
cmp byte [ebp - 3], bl
je 0x40d116
cmp esi, 1
jne 0x40d116
cmp byte [0x467cc8], bl
je 0x40d116
mov eax, dword [0x467cd4]
test eax, eax
je 0x40d116
mov ecx, dword [0x467cd0]
dec eax
mov dword [0x467cd4], eax
mov byte [ecx + eax], bl
cmp byte [ebp + 0x17], 0
je 0x40d132
mov eax, dword [0x467110]
test eax, eax
je 0x40d132
dec eax
mov dword [0x467110], eax
mov byte [eax + 0x467118], 0
cmp byte [0x468412], 0
je 0x40d769
mov byte [0x468412], 0
jmp 0x40d769
push 0x100
lea eax, [ebp - 0x118]
push 0x467278
push eax
call fcn.004576b0
xor eax, eax
mov al, byte [0x467270]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.00412040
add esp, 0x14
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40d18d
or byte [ebp - 0x104], 1
jmp 0x40d194
and byte [ebp - 0x104], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
xor eax, eax
cmp esi, eax
je 0x40d1aa
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 [0x4673cc], 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 0x40d769
cmp byte [0x468412], 0
je 0x40d1fe
cmp bl, 9
je 0x40d1fe
cmp bl, 0x1b
mov byte [ebp - 2], 1
jne 0x40d202
mov byte [ebp - 2], 0
xor eax, eax
cmp dword [ebp - 0x18], eax
jge 0x40d24d
cmp byte [ebp - 2], al
jne 0x40d24d
cmp byte [ebp - 1], al
je 0x40d246
mov al, byte [0x467270]
test al, 0x30
setne cl
test al, 3
mov byte [0x468412], bl
mov word [0x468410], di
mov byte [0x46840d], cl
je 0x40d23f
test al, 0xc
mov byte [0x46840c], 1
jne 0x40d246
mov byte [0x46840c], 0
xor al, al
jmp 0x40d76c
cmp byte [ebp - 8], 0xd
jne 0x40d257
mov byte [ebp - 8], 0xa
cmp byte [ebp - 7], 0xd
jne 0x40d261
mov byte [ebp - 7], 0xa
cmp byte [ebp + 0x17], 0
mov byte [ebp - 4], 0
je 0x40d58a
cmp esi, dword [0x46710c]
je 0x40d286
mov dword [0x46710c], esi
mov byte [0x467118], 0
jmp 0x40d2ba
mov eax, dword [0x467110]
push 0x5a
pop ecx
sub ecx, eax
cmp ecx, 3
jge 0x40d2ba
mov esi, 0x467145
push esi
call fcn.00457cb0
mov dword [0x467110], eax
inc eax
push eax
push esi
push 0x467118
call fcn.00457ea0
mov eax, dword [0x467110]
add esp, 0x10
mov cl, byte [ebp - 8]
mov byte [eax + 0x467118], cl
inc eax
cmp dword [ebp - 0x18], 1
mov dword [0x467110], eax
jle 0x40d2de
mov cl, byte [ebp - 7]
mov byte [eax + 0x467118], cl
inc eax
mov dword [0x467110], eax
test eax, eax
mov byte [eax + 0x467118], 0
je 0x40d58a
and dword [ebp - 0x14], 0
cmp dword [0x4693e4], 0
jbe 0x40d58a
mov ecx, dword [0x4693e0]
mov edx, dword [ebp - 0x14]
mov esi, dword [ecx + edx*4]
cmp byte [esi + 0x22], 0
jne 0x40d3e6
cmp byte [esi + 0x2a], 0
movzx ecx, byte [esi + 0x21]
je 0x40d34f
cmp eax, ecx
jle 0x40d3e6
movsx eax, byte [eax + 0x467117]
push eax
push str._____:____.___n__t
call fcn.00457de0
test eax, eax
pop ecx
pop ecx
je 0x40d3e1
mov eax, dword [0x467110]
lea edx, [eax + 0x467116]
jmp 0x40d35d
cmp eax, ecx
jl 0x40d3e6
lea edx, [eax + 0x467117]
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 0x40d405
cmp edi, ecx
jb 0x40d3a7
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 0x40d3a2
dec edx
dec edi
cmp edi, dword [esi + 4]
mov dword [ebp + 0x14], edx
jae 0x40d379
mov eax, dword [0x467110]
cmp edi, dword [esi + 4]
jae 0x40d3e6
cmp byte [esi + 0x2b], 0
jne 0x40d3c9
cmp edx, 0x467118
jb 0x40d3c9
xor eax, eax
mov al, byte [edx]
push eax
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x40d3e1
push dword [esi + 0x10]
xor eax, eax
mov al, byte [esi + 0x20]
push dword [esi + 0xc]
push eax
call fcn.0040fd3d
add esp, 0xc
test eax, eax
jne 0x40d40b
mov eax, dword [0x467110]
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [0x4693e4]
jb 0x40d2fe
jmp 0x40d58a
mov bl, byte [edx]
cmp bl, byte [edi]
jne 0x40d3a7
dec edx
dec edi
cmp edi, ecx
jae 0x40d3fd
jmp 0x40d3a7
cmp byte [esi + 0x26], 0
jne 0x40d418
xor ebx, ebx
jmp 0x40d4cf
cmp byte [esi + 0x2a], 0
mov eax, dword [0x467110]
lea eax, [eax + 0x467118]
mov dword [ebp - 0x10], eax
je 0x40d42f
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 0x40d411
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40d463
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x40d481
cmp byte [ebp + 0x17], 0
jne 0x40d47e
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 0x40d47e
mov bl, 1
inc dword [ebp - 0xc]
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40d447
cmp dword [ebp - 0xc], 0
je 0x40d411
cmp dword [ebp - 0xc], 1
jne 0x40d49c
neg bl
sbb ebx, ebx
and ebx, 2
jmp 0x40d4cf
test bl, bl
je 0x40d411
movzx eax, byte [esi + 0x21]
mov edi, dword [ebp - 0x10]
push 2
pop ebx
sub edi, eax
jmp 0x40d4c2
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40d4c7
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40d4b2
cmp edi, dword [ebp - 0x10]
jne 0x40d4cf
xor ebx, ebx
inc ebx
cmp byte [esi + 0x27], 0
jne 0x40d4db
cmp byte [esi + 0x28], 0
je 0x40d4e3
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 0x40d4ff
mov eax, dword [0x467110]
movzx eax, byte [eax + 0x467117]
jmp 0x40d512
cmp byte [ebp - 2], 0
je 0x40d510
cmp byte [ebp - 4], 0
je 0x40d510
xor eax, eax
inc eax
jmp 0x40d512
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 0x40d555
cmp byte [esi + 0x2a], 0
je 0x40d54c
mov eax, dword [0x467110]
mov al, byte [eax + 0x467117]
mov byte [0x467118], al
mov dword [0x467110], 1
jmp 0x40d571
and dword [0x467110], 0
jmp 0x40d571
cmp byte [esi + 0x27], 0
je 0x40d571
movzx eax, byte [esi + 0x21]
sub dword [0x467110], eax
cmp byte [esi + 0x2a], 0
je 0x40d571
dec dword [0x467110]
cmp byte [esi + 0x2c], 0
je 0x40d57e
and dword [0x467110], 0
mov eax, dword [0x467110]
mov byte [eax + 0x467118], 0
cmp byte [ebp - 2], 0
je 0x40d684
cmp byte [ebp - 1], 0
mov al, byte [0x468412]
mov byte [ebp - 0x14], al
mov byte [0x468412], 0
je 0x40d684
mov cl, byte [0x467270]
mov byte [0x4683e8], al
xor al, al
test cl, 0x10
je 0x40d5c3
mov al, 0xa0
jmp 0x40d5ca
test cl, 0x20
je 0x40d5cf
mov al, 0xa1
mov byte [ebp - 0xc], al
jmp 0x40d5d3
mov byte [ebp - 0xc], 0xa0
test al, al
mov al, byte [0x46840d]
setne byte [ebp + 0x17]
cmp al, byte [ebp + 0x17]
mov esi, 0xffc3d44d
je 0x40d5ff
xor ecx, ecx
push esi
push ecx
push ecx
push ecx
push dword [ebp - 0xc]
test al, al
sete cl
push ecx
call fcn.00412cfd
add esp, 0x18
cmp byte [0x46840c], 0
je 0x40d771
test byte [0x467270], 8
jne 0x40d771
push esi
xor edi, edi
push edi
push edi
push edi
push 0xa5
push edi
mov bl, 1
call fcn.00412cfd
add esp, 0x18
xor eax, eax
mov ax, word [0x468410]
push 0xffc3d44e
push edi
push edi
push eax
push dword [ebp - 0x14]
push 2
call fcn.00412cfd
add esp, 0x18
test bl, bl
je 0x40d663
push esi
push edi
push edi
push edi
push 0xa5
push 1
call fcn.00412cfd
add esp, 0x18
mov al, byte [0x46840d]
cmp al, byte [ebp + 0x17]
je 0x40d684
push esi
xor ecx, ecx
push edi
test al, al
push edi
setne cl
push edi
push dword [ebp - 0xc]
push ecx
call fcn.00412cfd
add esp, 0x18
cmp byte [ebp - 3], 0
je 0x40d769
cmp dword [0x467ca0], 1
jne 0x40d769
cmp byte [ebp - 4], 0
jne 0x40d769
mov eax, dword [0x467cd4]
cmp eax, dword [0x467cd8]
jge 0x40d6d3
mov ecx, dword [0x467cd0]
mov dl, byte [ebp - 8]
mov byte [ecx + eax], dl
inc dword [0x467cd4]
mov eax, dword [0x467cd0]
mov ecx, dword [0x467cd4]
mov byte [eax + ecx], 0
cmp dword [ebp - 0x18], 1
jle 0x40d707
mov eax, dword [0x467cd4]
cmp eax, dword [0x467cd8]
jge 0x40d707
mov ecx, dword [0x467cd0]
mov dl, byte [ebp - 7]
mov byte [ecx + eax], dl
inc dword [0x467cd4]
mov eax, dword [0x467cd0]
mov ecx, dword [0x467cd4]
mov byte [eax + ecx], 0
mov eax, dword [0x467cb8]
test eax, eax
je 0x40d752
xor esi, esi
cmp byte [0x467ccd], 0
je 0x40d7a2
cmp byte [0x467cc9], 0
je 0x40d77a
test eax, eax
jbe 0x40d752
mov eax, dword [0x467cb4]
push dword [eax + esi*4]
push dword [0x467cd0]
call fcn.00457d40
test eax, eax
pop ecx
pop ecx
jne 0x40d804
inc esi
cmp esi, dword [0x467cb8]
jb 0x40d72c
mov eax, dword [0x467cd8]
cmp dword [0x467cd4], eax
jl 0x40d769
mov dword [0x467ca0], 5
mov al, byte [ebp - 1]
pop edi
pop ebx
pop esi
leave
ret
xor bl, bl
xor edi, edi
jmp 0x40d62f
test eax, eax
jbe 0x40d752
mov eax, dword [0x467cb4]
push dword [eax + esi*4]
push dword [0x467cd0]
call fcn.00439613
test eax, eax
pop ecx
pop ecx
jne 0x40d804
inc esi
cmp esi, dword [0x467cb8]
jb 0x40d77e
jmp 0x40d752
cmp byte [0x467cc9], 0
je 0x40d7d6
test eax, eax
jbe 0x40d752
mov eax, dword [0x467cb4]
push dword [eax + esi*4]
push dword [0x467cd0]
call fcn.004579f0
test eax, eax
pop ecx
pop ecx
je 0x40d804
inc esi
cmp esi, dword [0x467cb8]
jb 0x40d7af
jmp 0x40d752
test eax, eax
jbe 0x40d752
mov eax, dword [0x467cb4]
push dword [eax + esi*4]
push dword [0x467cd0]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40d804
inc esi
cmp esi, dword [0x467cb8]
jb 0x40d7de
jmp 0x40d752
mov dword [0x467ca0], 3
jmp 0x40d769