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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x45e428]
push esi
mov esi, dword [0x45fb1c]
push edi
xor edi, edi
cmp esi, 1
jne 0x40cae4
cmp byte [0x45fb48], 0
jne 0x40cae4
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp dword [ecx + eax], edi
mov byte [ebp - 1], 0
je 0x40cae8
mov byte [ebp - 1], 1
cmp byte [ebp + 0x14], 0
je 0x40cb0d
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp byte [ecx + eax + 4], 0
mov al, 1
jne 0x40d2f8
mov al, byte [ebp - 1]
jmp 0x40d2f8
cmp dword [0x45f3f8], edi
je 0x40cb25
cmp byte [ebp + 0x18], 0
jne 0x40cb25
cmp byte [ebp - 1], 0
mov byte [ebp + 0x17], 1
jne 0x40cb29
mov byte [ebp + 0x17], 0
cmp esi, 1
push ebx
mov bl, byte [0x45d9e8]
jne 0x40cb80
cmp byte [0x45fb46], 0
je 0x40cb44
cmp byte [ebp + 0x18], 0
jne 0x40cb80
movzx eax, byte [ebp + 0xc]
mov ecx, dword [0x45fb20]
mov al, byte [eax + ecx]
test al, al
mov edx, dword [0x45fb24]
mov byte [ebp - 3], 1
jne 0x40cb6a
movzx eax, word [ebp + 0x10]
mov al, byte [eax + edx]
test al, al
je 0x40cb84
mov cl, al
shr cl, 1
shr al, 2
and cl, 1
and al, 1
test cl, cl
je 0x40cbba
test al, al
je 0x40cbbe
jmp 0x40cbd0
mov byte [ebp - 3], 0
mov al, byte [ebp + 0xc]
cmp al, 0x21
jb 0x40cc3d
cmp al, 0x28
jbe 0x40cc22
cmp al, 0x5a
jbe 0x40cc3d
cmp al, 0x5c
jbe 0x40cbb3
cmp al, 0x9f
jbe 0x40cc3d
cmp al, 0xa5
ja 0x40cc3d
mov al, 1
jmp 0x40d2f7
test al, al
je 0x40cbd0
test cl, cl
je 0x40cbc7
test bl, 0x30
jne 0x40cbd0
test al, al
je 0x40cb84
test bl, 0x30
jne 0x40cb84
movzx eax, word [ebp + 0x10]
push 4
pop esi
mov dword [0x45fb1c], esi
cmp byte [eax + edx], 0
mov dx, word [ebp + 0x10]
setne al
test cl, cl
mov byte [0x45fb2c], al
mov al, byte [ebp + 0xc]
mov byte [0x45fb28], al
mov word [0x45fb2a], dx
je 0x40cc0c
test bl, 0x30
mov byte [0x45fb2d], 1
jne 0x40cc13
mov byte [0x45fb2d], 0
cmp byte [ebp + 0x17], 0
jne 0x40cb87
jmp 0x40d2f4
cmp byte [ebp + 0x17], 0
je 0x40cc3d
cmp dword [0x45c778], edi
je 0x40cc3d
mov byte [0x45c780], 0
mov dword [0x45c778], edi
test bl, bl
je 0x40cc6b
cmp esi, 1
jne 0x40cc4f
cmp byte [0x45fb47], 0
jne 0x40cc6b
cmp bl, 0x10
je 0x40cc6b
cmp bl, 0x20
je 0x40cc6b
test bl, 0xc
je 0x40d2f4
test bl, 3
je 0x40d2f4
cmp al, 8
jne 0x40ccd2
test bl, bl
jne 0x40ccd2
cmp byte [ebp - 3], bl
je 0x40cc9d
cmp esi, 1
jne 0x40cc9d
cmp byte [0x45fb44], bl
je 0x40cc9d
mov eax, dword [0x45fb50]
cmp eax, edi
je 0x40cc9d
mov ecx, dword [0x45fb4c]
dec eax
mov dword [0x45fb50], eax
mov byte [ecx + eax], bl
cmp byte [ebp + 0x17], 0
je 0x40ccb9
mov eax, dword [0x45c778]
cmp eax, edi
je 0x40ccb9
dec eax
mov dword [0x45c778], eax
mov byte [eax + 0x45c780], 0
cmp byte [0x46024a], 0
je 0x40d2f4
mov byte [0x46024a], 0
jmp 0x40d2f4
push 0x100
lea eax, [ebp - 0x118]
push 0x45d9f0
push eax
call sub.MSVCR71.dll_memcpy
mov cl, byte [0x45d9e8]
add esp, 0xc
lea eax, [ebp - 0x118]
call fcn.00411ad2
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40cd11
or byte [ebp - 0x104], 1
jmp 0x40cd18
and byte [ebp - 0x104], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
cmp esi, edi
je 0x40cd2e
push edi
push esi
call dword [sym.imp.USER32.dll_GetWindowThreadProcessId]
jmp 0x40cd30
xor eax, eax
push eax
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
mov bl, byte [ebp + 0xc]
xor eax, eax
cmp dword [0x45db44], edi
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]
cmp eax, edi
mov dword [ebp - 0x18], eax
je 0x40d2f4
cmp byte [0x46024a], 0
je 0x40cd84
cmp bl, 9
je 0x40cd84
cmp bl, 0x1b
mov byte [ebp - 2], 1
jne 0x40cd88
mov byte [ebp - 2], 0
cmp dword [ebp - 0x18], edi
jge 0x40cdd6
cmp byte [ebp - 2], 0
jne 0x40cdd6
cmp byte [ebp - 1], 0
je 0x40cdcf
mov ax, word [ebp + 0x10]
mov word [0x460248], ax
mov al, byte [0x45d9e8]
test al, 0x30
setne cl
test al, 3
mov byte [0x46024a], bl
mov byte [0x460245], cl
je 0x40cdc8
test al, 0xc
mov byte [0x460244], 1
jne 0x40cdcf
mov byte [0x460244], 0
xor al, al
jmp 0x40d2f7
cmp byte [ebp - 8], 0xd
jne 0x40cde0
mov byte [ebp - 8], 0xa
cmp byte [ebp - 7], 0xd
jne 0x40cdea
mov byte [ebp - 7], 0xa
cmp byte [ebp + 0x17], 0
mov byte [ebp - 4], 0
je 0x40d116
cmp esi, dword [0x45c774]
je 0x40ce11
mov dword [0x45c774], esi
mov byte [0x45c780], 0
xor eax, eax
jmp 0x40ce46
mov eax, dword [0x45c778]
push 0x5a
pop ecx
sub ecx, eax
cmp ecx, 3
jge 0x40ce46
mov esi, 0x45c7ad
push esi
call sub.MSVCR71.dll_strlen
mov dword [0x45c778], eax
inc eax
push eax
push esi
push 0x45c780
call dword [sym.imp.MSVCR71.dll_memmove]
mov eax, dword [0x45c778]
add esp, 0x10
mov cl, byte [ebp - 8]
mov byte [eax + 0x45c780], cl
inc eax
cmp dword [ebp - 0x18], 1
mov dword [0x45c778], eax
jle 0x40ce6a
mov cl, byte [ebp - 7]
mov byte [eax + 0x45c780], cl
inc eax
mov dword [0x45c778], eax
cmp eax, edi
mov byte [eax + 0x45c780], 0
je 0x40d116
cmp dword [0x45f3fc], edi
mov dword [ebp - 0x14], edi
jbe 0x40d116
mov ecx, dword [0x45f3f8]
mov edx, dword [ebp - 0x14]
mov esi, dword [ecx + edx*4]
cmp byte [esi + 0x22], 0
jne 0x40cf70
cmp byte [esi + 0x2a], 0
movzx ecx, byte [esi + 0x21]
je 0x40ceda
cmp eax, ecx
jle 0x40cf70
movsx eax, byte [eax + 0x45c77f]
push eax
push str._____:____.___n__t
call dword [sym.imp.MSVCR71.dll_strchr]
test eax, eax
pop ecx
pop ecx
je 0x40cf6b
mov eax, dword [0x45c778]
lea edx, [eax + 0x45c77e]
jmp 0x40cee8
cmp eax, ecx
jl 0x40cf70
lea edx, [eax + 0x45c77f]
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 0x40cf8f
cmp edi, ecx
jb 0x40cf32
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 0x40cf2d
dec edx
dec edi
cmp edi, dword [esi + 4]
mov dword [ebp + 0x14], edx
jae 0x40cf04
mov eax, dword [0x45c778]
cmp edi, dword [esi + 4]
jae 0x40cf70
cmp byte [esi + 0x2b], 0
jne 0x40cf54
cmp edx, 0x45c780
jb 0x40cf54
xor eax, eax
mov al, byte [edx]
push eax
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x40cf6b
push dword [esi + 0x10]
mov edx, dword [esi + 0xc]
xor eax, eax
mov al, byte [esi + 0x20]
push eax
call fcn.0040f869
test eax, eax
pop ecx
pop ecx
jne 0x40cf95
mov eax, dword [0x45c778]
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [0x45f3fc]
jb 0x40ce88
jmp 0x40d114
mov bl, byte [edx]
cmp bl, byte [edi]
jne 0x40cf32
dec edx
dec edi
cmp edi, ecx
jae 0x40cf87
jmp 0x40cf32
cmp byte [esi + 0x26], 0
jne 0x40cfa2
xor ebx, ebx
jmp 0x40d059
cmp byte [esi + 0x2a], 0
mov eax, dword [0x45c778]
lea eax, [eax + 0x45c780]
mov dword [ebp - 0x10], eax
je 0x40cfb9
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 0x40cf9b
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40cfed
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x40d00b
cmp byte [ebp + 0x17], 0
jne 0x40d008
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 0x40d008
mov bl, 1
inc dword [ebp - 0xc]
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40cfd1
cmp dword [ebp - 0xc], 0
je 0x40cf9b
cmp dword [ebp - 0xc], 1
jne 0x40d026
neg bl
sbb ebx, ebx
and ebx, 2
jmp 0x40d059
test bl, bl
je 0x40cf9b
movzx eax, byte [esi + 0x21]
mov edi, dword [ebp - 0x10]
push 2
pop ebx
sub edi, eax
jmp 0x40d04c
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40d051
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40d03c
cmp edi, dword [ebp - 0x10]
jne 0x40d059
xor ebx, ebx
inc ebx
cmp byte [esi + 0x27], 0
jne 0x40d065
cmp byte [esi + 0x28], 0
je 0x40d06d
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 0x40d089
mov eax, dword [0x45c778]
movzx eax, byte [eax + 0x45c77f]
jmp 0x40d09c
cmp byte [ebp - 2], 0
je 0x40d09a
cmp byte [ebp - 4], 0
je 0x40d09a
xor eax, eax
inc eax
jmp 0x40d09c
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 0x40d0df
cmp byte [esi + 0x2a], 0
je 0x40d0d6
mov eax, dword [0x45c778]
mov al, byte [eax + 0x45c77f]
mov byte [0x45c780], al
mov dword [0x45c778], 1
jmp 0x40d0fb
and dword [0x45c778], 0
jmp 0x40d0fb
cmp byte [esi + 0x27], 0
je 0x40d0fb
movzx eax, byte [esi + 0x21]
sub dword [0x45c778], eax
cmp byte [esi + 0x2a], 0
je 0x40d0fb
dec dword [0x45c778]
cmp byte [esi + 0x2c], 0
je 0x40d108
and dword [0x45c778], 0
mov eax, dword [0x45c778]
mov byte [eax + 0x45c780], 0
xor edi, edi
cmp byte [ebp - 2], 0
je 0x40d20e
cmp byte [ebp - 1], 0
mov al, byte [0x46024a]
mov byte [ebp - 0x14], al
mov byte [0x46024a], 0
je 0x40d20e
mov cl, byte [0x45d9e8]
mov byte [0x45c8e0], al
xor al, al
test cl, 0x10
je 0x40d14f
mov al, 0xa0
jmp 0x40d156
test cl, 0x20
je 0x40d15b
mov al, 0xa1
mov byte [ebp - 0xc], al
jmp 0x40d15f
mov byte [ebp - 0xc], 0xa0
test al, al
mov al, byte [0x460245]
setne byte [ebp + 0x17]
cmp al, byte [ebp + 0x17]
mov esi, 0xffc3d44d
je 0x40d18b
push esi
xor ecx, ecx
push edi
test al, al
push edi
sete cl
push edi
push dword [ebp - 0xc]
push ecx
call fcn.00412730
add esp, 0x18
cmp byte [0x460244], 0
je 0x40d2fc
test byte [0x45d9e8], 8
jne 0x40d2fc
push esi
push edi
push edi
push edi
push 0xa5
push edi
mov bl, 1
call fcn.00412730
add esp, 0x18
xor eax, eax
mov ax, word [0x460248]
push 0xffc3d44e
push edi
push edi
push eax
push dword [ebp - 0x14]
push 2
call fcn.00412730
add esp, 0x18
test bl, bl
je 0x40d1ed
push esi
push edi
push edi
push edi
push 0xa5
push 1
call fcn.00412730
add esp, 0x18
mov al, byte [0x460245]
cmp al, byte [ebp + 0x17]
je 0x40d20e
push esi
xor ecx, ecx
push edi
test al, al
push edi
setne cl
push edi
push dword [ebp - 0xc]
push ecx
call fcn.00412730
add esp, 0x18
cmp byte [ebp - 3], 0
je 0x40d2f4
cmp dword [0x45fb1c], 1
jne 0x40d2f4
cmp byte [ebp - 4], 0
jne 0x40d2f4
mov eax, dword [0x45fb50]
cmp eax, dword [0x45fb54]
jge 0x40d25d
mov ecx, dword [0x45fb4c]
mov dl, byte [ebp - 8]
mov byte [ecx + eax], dl
inc dword [0x45fb50]
mov eax, dword [0x45fb4c]
mov ecx, dword [0x45fb50]
mov byte [eax + ecx], 0
cmp dword [ebp - 0x18], 1
jle 0x40d291
mov eax, dword [0x45fb50]
cmp eax, dword [0x45fb54]
jge 0x40d291
mov ecx, dword [0x45fb4c]
mov dl, byte [ebp - 7]
mov byte [ecx + eax], dl
inc dword [0x45fb50]
mov eax, dword [0x45fb4c]
mov ecx, dword [0x45fb50]
mov byte [eax + ecx], 0
mov eax, dword [0x45fb34]
cmp eax, edi
je 0x40d2dd
xor esi, esi
cmp byte [0x45fb49], 0
je 0x40d32a
cmp byte [0x45fb45], 0
je 0x40d303
cmp eax, edi
jbe 0x40d2dd
mov eax, dword [0x45fb30]
push dword [eax + esi*4]
push dword [0x45fb4c]
call dword [sym.imp.MSVCR71.dll_strstr]
test eax, eax
pop ecx
pop ecx
jne 0x40d389
inc esi
cmp esi, dword [0x45fb34]
jb 0x40d2b6
mov eax, dword [0x45fb54]
cmp dword [0x45fb50], eax
jl 0x40d2f4
mov dword [0x45fb1c], 5
mov al, byte [ebp - 1]
pop ebx
pop edi
pop esi
leave
ret
xor bl, bl
jmp 0x40d1b9
cmp eax, edi
jbe 0x40d2dd
mov eax, dword [0x45fb30]
push dword [0x45fb4c]
mov eax, dword [eax + esi*4]
call fcn.004387ca
test eax, eax
pop ecx
jne 0x40d389
inc esi
cmp esi, dword [0x45fb34]
jb 0x40d307
jmp 0x40d2dd
cmp byte [0x45fb45], 0
je 0x40d35b
cmp eax, edi
jbe 0x40d2dd
mov eax, dword [0x45fb30]
push dword [eax + esi*4]
push dword [0x45fb4c]
call sub.MSVCR71.dll_strcmp
test eax, eax
pop ecx
pop ecx
je 0x40d389
inc esi
cmp esi, dword [0x45fb34]
jb 0x40d337
jmp 0x40d2dd
cmp eax, edi
jbe 0x40d2dd
mov eax, dword [0x45fb30]
push dword [eax + esi*4]
push dword [0x45fb4c]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40d389
inc esi
cmp esi, dword [0x45fb34]
jb 0x40d363
jmp 0x40d2dd
mov dword [0x45fb1c], 3
jmp 0x40d2f4