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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x464500]
push esi
mov esi, dword [0x463da0]
cmp esi, 1
jne 0x40b287
cmp byte [0x463dcc], 0
jne 0x40b287
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp dword [ecx + eax], 0
mov byte [ebp - 1], 0
je 0x40b28b
mov byte [ebp - 1], 1
cmp byte [ebp + 0x14], 0
je 0x40b2b0
movzx ecx, byte [ebp + 0xc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
cmp byte [ecx + eax + 4], 0
mov al, 1
jne 0x40baa0
mov al, byte [ebp - 1]
jmp 0x40baa0
cmp dword [0x465030], 0
je 0x40b2c9
cmp byte [ebp + 0x18], 0
jne 0x40b2c9
cmp byte [ebp - 1], 0
mov byte [ebp + 0x17], 1
jne 0x40b2cd
mov byte [ebp + 0x17], 0
cmp esi, 1
push ebx
mov bl, byte [0x46337c]
push edi
mov di, word [ebp + 0x10]
jne 0x40b328
cmp byte [0x463dca], 0
je 0x40b2ed
cmp byte [ebp + 0x18], 0
jne 0x40b328
movzx eax, byte [ebp + 0xc]
mov ecx, dword [0x463da4]
mov al, byte [eax + ecx]
test al, al
mov edx, dword [0x463da8]
mov byte [ebp - 3], 1
jne 0x40b312
movzx eax, di
mov al, byte [eax + edx]
test al, al
je 0x40b32c
mov cl, al
shr cl, 1
shr al, 2
and cl, 1
and al, 1
test cl, cl
je 0x40b362
test al, al
je 0x40b366
jmp 0x40b378
mov byte [ebp - 3], 0
mov al, byte [ebp + 0xc]
cmp al, 0x21
jb 0x40b3e2
cmp al, 0x28
jbe 0x40b3c5
cmp al, 0x5a
jbe 0x40b3e2
cmp al, 0x5c
jbe 0x40b35b
cmp al, 0x9f
jbe 0x40b3e2
cmp al, 0xa5
ja 0x40b3e2
mov al, 1
jmp 0x40ba9e
test al, al
je 0x40b378
test cl, cl
je 0x40b36f
test bl, 0x30
jne 0x40b378
test al, al
je 0x40b32c
test bl, 0x30
jne 0x40b32c
push 4
movzx eax, di
pop esi
mov dword [0x463da0], esi
cmp byte [eax + edx], 0
mov word [0x463dae], di
setne al
test cl, cl
mov byte [0x463db0], al
mov al, byte [ebp + 0xc]
mov byte [0x463dac], al
je 0x40b3af
test bl, 0x30
mov byte [0x463db1], 1
jne 0x40b3b6
mov byte [0x463db1], 0
cmp byte [ebp + 0x17], 0
jne 0x40b32f
jmp 0x40ba9b
cmp byte [ebp + 0x17], 0
je 0x40b3e2
cmp dword [0x4630f0], 0
je 0x40b3e2
and dword [0x4630f0], 0
mov byte [0x4630f8], 0
test bl, bl
je 0x40b410
cmp esi, 1
jne 0x40b3f4
cmp byte [0x463dcb], 0
jne 0x40b410
cmp bl, 0x10
je 0x40b410
cmp bl, 0x20
je 0x40b410
test bl, 0xc
je 0x40ba9b
test bl, 3
je 0x40ba9b
cmp al, 8
jne 0x40b477
test bl, bl
jne 0x40b477
cmp byte [ebp - 3], bl
je 0x40b442
cmp esi, 1
jne 0x40b442
cmp byte [0x463dc8], bl
je 0x40b442
mov eax, dword [0x463dd4]
test eax, eax
je 0x40b442
mov ecx, dword [0x463dd0]
dec eax
mov dword [0x463dd4], eax
mov byte [ecx + eax], bl
cmp byte [ebp + 0x17], 0
je 0x40b45e
mov eax, dword [0x4630f0]
test eax, eax
je 0x40b45e
dec eax
mov dword [0x4630f0], eax
mov byte [eax + 0x4630f8], 0
cmp byte [0x46450e], 0
je 0x40ba9b
mov byte [0x46450e], 0
jmp 0x40ba9b
push 0x100
lea eax, [ebp - 0x118]
push 0x463380
push eax
call fcn.00453500
xor eax, eax
mov al, byte [0x46337c]
push eax
lea eax, [ebp - 0x118]
push eax
call fcn.004102d0
add esp, 0x14
push 0x14
call dword [sym.imp.USER32.dll_GetKeyState]
test al, 1
je 0x40b4b9
or byte [ebp - 0x104], 1
jmp 0x40b4c0
and byte [ebp - 0x104], 0xfe
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov esi, eax
xor eax, eax
cmp esi, eax
je 0x40b4d6
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 [0x4634c8], 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 0x40ba9b
cmp byte [0x46450e], 0
je 0x40b52a
cmp bl, 9
je 0x40b52a
cmp bl, 0x1b
mov byte [ebp - 2], 1
jne 0x40b52e
mov byte [ebp - 2], 0
xor eax, eax
cmp dword [ebp - 0x18], eax
jge 0x40b579
cmp byte [ebp - 2], al
jne 0x40b579
cmp byte [ebp - 1], al
je 0x40b572
mov al, byte [0x46337c]
test al, 0x30
setne cl
test al, 3
mov byte [0x46450e], bl
mov word [0x46450c], di
mov byte [0x464509], cl
je 0x40b56b
test al, 0xc
mov byte [0x464508], 1
jne 0x40b572
mov byte [0x464508], 0
xor al, al
jmp 0x40ba9e
cmp byte [ebp - 8], 0xd
jne 0x40b583
mov byte [ebp - 8], 0xa
cmp byte [ebp - 7], 0xd
jne 0x40b58d
mov byte [ebp - 7], 0xa
cmp byte [ebp + 0x17], 0
mov byte [ebp - 4], 0
je 0x40b8bc
cmp esi, dword [0x4630ec]
je 0x40b5b2
mov dword [0x4630ec], esi
mov byte [0x4630f8], 0
jmp 0x40b5e6
mov eax, dword [0x4630f0]
push 0x46
pop ecx
sub ecx, eax
cmp ecx, 3
jge 0x40b5e6
mov esi, 0x46311b
push esi
call fcn.00453b00
mov dword [0x4630f0], eax
inc eax
push eax
push esi
push 0x4630f8
call fcn.00453cf0
mov eax, dword [0x4630f0]
add esp, 0x10
mov cl, byte [ebp - 8]
mov byte [eax + 0x4630f8], cl
inc eax
cmp dword [ebp - 0x18], 1
mov dword [0x4630f0], eax
jle 0x40b60a
mov cl, byte [ebp - 7]
mov byte [eax + 0x4630f8], cl
inc eax
mov dword [0x4630f0], eax
test eax, eax
mov byte [eax + 0x4630f8], 0
je 0x40b8bc
and dword [ebp - 0x14], 0
cmp dword [0x465034], 0
jbe 0x40b8bc
mov ecx, dword [0x465030]
mov edx, dword [ebp - 0x14]
mov esi, dword [ecx + edx*4]
cmp byte [esi + 0x22], 0
jne 0x40b712
cmp byte [esi + 0x2a], 0
movzx ecx, byte [esi + 0x21]
je 0x40b67b
cmp eax, ecx
jle 0x40b712
movsx eax, byte [eax + 0x4630f7]
push eax
push str._____:____.___n__t
call fcn.00453c30
test eax, eax
pop ecx
pop ecx
je 0x40b70d
mov eax, dword [0x4630f0]
lea edx, [eax + 0x4630f6]
jmp 0x40b689
cmp eax, ecx
jl 0x40b712
lea edx, [eax + 0x4630f7]
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 0x40b731
cmp edi, ecx
jb 0x40b6d3
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 0x40b6ce
dec edx
dec edi
cmp edi, dword [esi + 4]
mov dword [ebp + 0x14], edx
jae 0x40b6a5
mov eax, dword [0x4630f0]
cmp edi, dword [esi + 4]
jae 0x40b712
cmp byte [esi + 0x2b], 0
jne 0x40b6f5
cmp edx, 0x4630f8
jb 0x40b6f5
xor eax, eax
mov al, byte [edx]
push eax
call dword [sym.imp.USER32.dll_IsCharAlphaNumericA]
test eax, eax
jne 0x40b70d
push dword [esi + 0x10]
xor eax, eax
mov al, byte [esi + 0x20]
push dword [esi + 0xc]
push eax
call fcn.0040e0b6
add esp, 0xc
test eax, eax
jne 0x40b737
mov eax, dword [0x4630f0]
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [0x465034]
jb 0x40b62a
jmp 0x40b8bc
mov bl, byte [edx]
cmp bl, byte [edi]
jne 0x40b6d3
dec edx
dec edi
cmp edi, ecx
jae 0x40b729
jmp 0x40b6d3
cmp byte [esi + 0x26], 0
jne 0x40b744
xor ebx, ebx
jmp 0x40b7fb
cmp byte [esi + 0x2a], 0
mov eax, dword [0x4630f0]
lea eax, [eax + 0x4630f8]
mov dword [ebp - 0x10], eax
je 0x40b75b
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 0x40b73d
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40b78f
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharUpperA]
test eax, eax
je 0x40b7ad
cmp byte [ebp + 0x17], 0
jne 0x40b7aa
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 0x40b7aa
mov bl, 1
inc dword [ebp - 0xc]
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40b773
cmp dword [ebp - 0xc], 0
je 0x40b73d
cmp dword [ebp - 0xc], 1
jne 0x40b7c8
neg bl
sbb ebx, ebx
and ebx, 2
jmp 0x40b7fb
test bl, bl
je 0x40b73d
movzx eax, byte [esi + 0x21]
mov edi, dword [ebp - 0x10]
push 2
pop ebx
sub edi, eax
jmp 0x40b7ee
xor eax, eax
mov al, byte [edi]
push eax
call dword [sym.imp.USER32.dll_IsCharLowerA]
test eax, eax
jne 0x40b7f3
inc edi
cmp edi, dword [ebp - 0x10]
jb 0x40b7de
cmp edi, dword [ebp - 0x10]
jne 0x40b7fb
xor ebx, ebx
inc ebx
cmp byte [esi + 0x27], 0
jne 0x40b807
cmp byte [esi + 0x28], 0
je 0x40b80f
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 0x40b831
cmp byte [esi + 0x27], 0
je 0x40b831
mov eax, dword [0x4630f0]
movzx eax, byte [eax + 0x4630f7]
jmp 0x40b844
cmp byte [ebp - 2], 0
je 0x40b842
cmp byte [ebp - 4], 0
je 0x40b842
xor eax, eax
inc eax
jmp 0x40b844
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 0x40b887
cmp byte [esi + 0x2a], 0
je 0x40b87e
mov eax, dword [0x4630f0]
mov al, byte [eax + 0x4630f7]
mov byte [0x4630f8], al
mov dword [0x4630f0], 1
jmp 0x40b8a3
and dword [0x4630f0], 0
jmp 0x40b8a3
cmp byte [esi + 0x27], 0
je 0x40b8a3
movzx eax, byte [esi + 0x21]
sub dword [0x4630f0], eax
cmp byte [esi + 0x2a], 0
je 0x40b8a3
dec dword [0x4630f0]
cmp byte [esi + 0x2c], 0
je 0x40b8b0
and dword [0x4630f0], 0
mov eax, dword [0x4630f0]
mov byte [eax + 0x4630f8], 0
cmp byte [ebp - 2], 0
je 0x40b9b6
cmp byte [ebp - 1], 0
mov al, byte [0x46450e]
mov byte [ebp - 0x14], al
mov byte [0x46450e], 0
je 0x40b9b6
mov cl, byte [0x46337c]
mov byte [0x4644e4], al
xor al, al
test cl, 0x10
je 0x40b8f5
mov al, 0xa0
jmp 0x40b8fc
test cl, 0x20
je 0x40b901
mov al, 0xa1
mov byte [ebp - 0xc], al
jmp 0x40b905
mov byte [ebp - 0xc], 0xa0
test al, al
mov al, byte [0x464509]
setne byte [ebp + 0x17]
cmp al, byte [ebp + 0x17]
mov esi, 0xffc3d44d
je 0x40b931
xor ecx, ecx
push esi
push ecx
push ecx
push ecx
push dword [ebp - 0xc]
test al, al
sete cl
push ecx
call fcn.00410f1f
add esp, 0x18
cmp byte [0x464508], 0
je 0x40baa3
test byte [0x46337c], 8
jne 0x40baa3
push esi
xor edi, edi
push edi
push edi
push edi
push 0xa5
push edi
mov bl, 1
call fcn.00410f1f
add esp, 0x18
xor eax, eax
mov ax, word [0x46450c]
push 0xffc3d44e
push edi
push edi
push eax
push dword [ebp - 0x14]
push 2
call fcn.00410f1f
add esp, 0x18
test bl, bl
je 0x40b995
push esi
push edi
push edi
push edi
push 0xa5
push 1
call fcn.00410f1f
add esp, 0x18
mov al, byte [0x464509]
cmp al, byte [ebp + 0x17]
je 0x40b9b6
push esi
xor ecx, ecx
push edi
test al, al
push edi
setne cl
push edi
push dword [ebp - 0xc]
push ecx
call fcn.00410f1f
add esp, 0x18
cmp byte [ebp - 3], 0
je 0x40ba9b
cmp dword [0x463da0], 1
jne 0x40ba9b
cmp byte [ebp - 4], 0
jne 0x40ba9b
mov eax, dword [0x463dd4]
cmp eax, dword [0x463dd8]
jge 0x40ba05
mov ecx, dword [0x463dd0]
mov dl, byte [ebp - 8]
mov byte [ecx + eax], dl
inc dword [0x463dd4]
mov eax, dword [0x463dd0]
mov ecx, dword [0x463dd4]
mov byte [eax + ecx], 0
cmp dword [ebp - 0x18], 1
jle 0x40ba39
mov eax, dword [0x463dd4]
cmp eax, dword [0x463dd8]
jge 0x40ba39
mov ecx, dword [0x463dd0]
mov dl, byte [ebp - 7]
mov byte [ecx + eax], dl
inc dword [0x463dd4]
mov eax, dword [0x463dd0]
mov ecx, dword [0x463dd4]
mov byte [eax + ecx], 0
mov eax, dword [0x463db8]
test eax, eax
je 0x40ba84
xor esi, esi
cmp byte [0x463dcd], 0
je 0x40bad4
cmp byte [0x463dc9], 0
je 0x40baac
test eax, eax
jbe 0x40ba84
mov eax, dword [0x463db4]
push dword [eax + esi*4]
push dword [0x463dd0]
call fcn.00453b90
test eax, eax
pop ecx
pop ecx
jne 0x40bb36
inc esi
cmp esi, dword [0x463db8]
jb 0x40ba5e
mov eax, dword [0x463dd8]
cmp dword [0x463dd4], eax
jl 0x40ba9b
mov dword [0x463da0], 5
mov al, byte [ebp - 1]
pop edi
pop ebx
pop esi
leave
ret
xor bl, bl
xor edi, edi
jmp 0x40b961
test eax, eax
jbe 0x40ba84
mov eax, dword [0x463db4]
push dword [eax + esi*4]
push dword [0x463dd0]
call fcn.004389f6
test eax, eax
pop ecx
pop ecx
jne 0x40bb36
inc esi
cmp esi, dword [0x463db8]
jb 0x40bab0
jmp 0x40ba84
cmp byte [0x463dc9], 0
je 0x40bb08
test eax, eax
jbe 0x40ba84
mov eax, dword [0x463db4]
push dword [eax + esi*4]
push dword [0x463dd0]
call fcn.00453840
test eax, eax
pop ecx
pop ecx
je 0x40bb36
inc esi
cmp esi, dword [0x463db8]
jb 0x40bae1
jmp 0x40ba84
test eax, eax
jbe 0x40ba84
mov eax, dword [0x463db4]
push dword [eax + esi*4]
push dword [0x463dd0]
call dword [sym.imp.KERNEL32.DLL_lstrcmpiA]
test eax, eax
je 0x40bb36
inc esi
cmp esi, dword [0x463db8]
jb 0x40bb10
jmp 0x40ba84
mov dword [0x463da0], 3
jmp 0x40ba9b