Function at 0x40f460
Capabilities:
Check for time delay via gettickcount
Log keystrokes via polling

Disassembly:
sub esp, 0x28
or al, byte [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x30]
push ebp
mov ebp, dword [esp + 0x40]
mov byte [esp + 0x10], al
lea eax, [ebx - 1]
push esi
push edi
cmp al, 5
ja 0x40f483
cmp bl, 3
jne 0x40f48b
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40f492
mov byte [esp + 0x13], 1
jmp 0x40f497
mov byte [esp + 0x13], 0
mov esi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
test ecx, ecx
jle 0x40f6c2
mov dword [esp + 0x14], ecx
cmp dword [0x4f1554], 0
jne 0x40f50c
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
sub eax, dword [0x4f2304]
mov ecx, dword [0x4ec48c]
cmp eax, dword [ecx + 0xb8]
jbe 0x40f50c
push 0
push 0
push 0
push 0
lea edx, [esp + 0x2c]
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40f505
push 1
push 0xffffffffffffffff
mov dword [0x4ec46c], 0
call fcn.00401910
add esp, 8
mov dword [0x4ec46c], 1
call edi
mov dword [0x4f2304], eax
cmp byte [esp + 0x4c], 0
jne 0x40f655
mov eax, dword [0x4ec48c]
mov al, byte [eax + 0xd6]
test al, al
je 0x40f532
movzx ecx, al
mov edi, 0xffc3d44d
sub edi, ecx
jmp 0x40f537
mov edi, 0xffc3d44f
cmp dword [0x4f1554], 0
je 0x40f54a
mov al, byte [0x4efae4]
jmp 0x40f63c
cmp dword [0x4f0d08], 0
je 0x40f55d
mov al, byte [0x4f0bd5]
jmp 0x40f63c
push 0xa0
xor bl, bl
call esi
mov edx, 0x8000
test dx, ax
je 0x40f572
mov bl, 0x10
push 0xa1
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f586
or bl, 0x20
push 0xa2
call esi
mov edx, 0x8000
test dx, ax
je 0x40f59a
or bl, 1
push 0xa3
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f5ae
or bl, 2
push 0xa4
call esi
mov edx, 0x8000
test dx, ax
je 0x40f5c2
or bl, 4
push 0xa5
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f5d6
or bl, 8
push 0x5b
call esi
mov edx, 0x8000
test dx, ax
je 0x40f5e7
or bl, 0x40
push 0x5c
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f5f8
or bl, 0x80
cmp dword [0x4f0d08], 0
je 0x40f635
mov al, bl
not al
and al, byte [0x4f0bd5]
je 0x40f635
mov cl, byte [0x4f0bd7]
not al
and byte [0x4f0bd5], al
and byte [0x4f0bd6], al
and cl, al
mov al, cl
mov byte [0x4f0bd7], cl
mov ecx, 0x4f0bf8
call fcn.00412300
movzx eax, bl
mov ebx, dword [esp + 0x3c]
mov edx, dword [esp + 0x50]
push 1
push 0
push edx
push eax
mov eax, dword [esp + 0x28]
push eax
mov eax, edi
call fcn.00411b90
add esp, 0x14
cmp byte [esp + 0x13], 0
je 0x40f68e
cmp dword [esp + 0x50], 0
jne 0x40f68e
mov ecx, dword [esp + 0x5c]
mov edx, dword [0x4ec48c]
mov eax, dword [esp + 0x58]
push ecx
movzx ecx, byte [edx + 0xcf]
mov edx, dword [esp + 0x58]
push ebp
push 1
push eax
push edx
mov al, bl
call fcn.00410d10
add esp, 0x14
jmp 0x40f6b8
mov eax, dword [0x4ec48c]
movzx ecx, byte [eax + 0xd6]
mov eax, dword [esp + 0x50]
mov edx, 0xffc3d44d
sub edx, ecx
mov ecx, dword [esp + 0x40]
push edx
push 1
push eax
push ecx
push ebx
push ebp
call fcn.0040fd20
add esp, 0x18
dec dword [esp + 0x14]
jne 0x40f4a9
cmp byte [esp + 0x4c], 0
jne 0x40f802
cmp dword [0x4f1554], 0
je 0x40f6e1
mov bl, byte [0x4efae4]
jmp 0x40f7cd
cmp dword [0x4f0d08], 0
je 0x40f6f5
mov bl, byte [0x4f0bd5]
jmp 0x40f7cd
push 0xa0
xor bl, bl
call esi
mov edx, 0x8000
test dx, ax
je 0x40f70a
mov bl, 0x10
push 0xa1
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f71e
or bl, 0x20
push 0xa2
call esi
mov edx, 0x8000
test dx, ax
je 0x40f732
or bl, 1
push 0xa3
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f746
or bl, 2
push 0xa4
call esi
mov edx, 0x8000
test dx, ax
je 0x40f75a
or bl, 4
push 0xa5
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f76e
or bl, 8
push 0x5b
call esi
mov edx, 0x8000
test dx, ax
je 0x40f77f
or bl, 0x40
push 0x5c
call esi
mov ecx, 0x8000
test cx, ax
je 0x40f790
or bl, 0x80
cmp dword [0x4f0d08], 0
je 0x40f7cd
mov al, bl
not al
and al, byte [0x4f0bd5]
je 0x40f7cd
mov cl, byte [0x4f0bd7]
not al
and byte [0x4f0bd5], al
and byte [0x4f0bd6], al
and cl, al
mov al, cl
mov byte [0x4f0bd7], cl
mov ecx, 0x4f0bf8
call fcn.00412300
mov cl, bl
mov al, cl
xor al, byte [esp + 0x44]
mov byte [esp + 0x4c], cl
and al, cl
and al, 0xcc
je 0x40f802
mov edx, dword [esp + 0x50]
push 0
not al
push 1
push edx
mov edx, dword [esp + 0x58]
and al, cl
movzx eax, al
push edx
push eax
mov eax, 0xffc3d44d
call fcn.00411b90
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret