Function at 0x40f500
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 byte [esp + 0x10], al
push esi
lea eax, [ebx - 1]
push edi
mov esi, ecx
cmp al, 5
ja 0x40f521
cmp bl, 3
jne 0x40f529
lea ecx, [ebx + 0x66]
cmp cl, 5
ja 0x40f530
mov byte [esp + 0x13], 1
jmp 0x40f535
mov byte [esp + 0x13], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
mov ebp, eax
test esi, esi
jle 0x40f774
mov dword [esp + 0x14], esi
cmp dword [0x4bd0d0], 0
jne 0x40f5c4
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
sub eax, dword [0x4bddf4]
mov edx, dword [0x4b7468]
cmp eax, dword [edx + 0xb4]
jbe 0x40f5c4
push 0
push 0
push 0
push 0
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40f5bd
mov dword [0x4b73c8], 0
cmp dword [0x4bd780], ebp
jne 0x40f5ab
push 1
push 0xffffffffffffffff
call fcn.00401280
add esp, 8
jmp 0x40f5b3
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [0x4b73c8], 1
call esi
mov dword [0x4bddf4], eax
cmp byte [esp + 0x4c], 0
jne 0x40f701
cmp dword [0x4bd0d0], 0
je 0x40f5e3
mov cl, byte [0x4ba684]
jmp 0x40f6d5
cmp dword [0x4bb8a0], 0
je 0x40f5f7
mov cl, byte [0x4bb76b]
jmp 0x40f6d5
push 0xa0
xor bl, bl
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f60c
mov bl, 0x10
push 0xa1
call edi
mov edx, 0x8000
test dx, ax
je 0x40f620
or bl, 0x20
push 0xa2
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f634
or bl, 1
push 0xa3
call edi
mov edx, 0x8000
test dx, ax
je 0x40f648
or bl, 2
push 0xa4
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f65c
or bl, 4
push 0xa5
call edi
mov edx, 0x8000
test dx, ax
je 0x40f670
or bl, 8
push 0x5b
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f681
or bl, 0x40
push 0x5c
call edi
mov edx, 0x8000
test dx, ax
je 0x40f692
or bl, 0x80
cmp dword [0x4bb8a0], 0
je 0x40f6cf
mov al, bl
not al
and al, byte [0x4bb76b]
je 0x40f6cf
mov cl, byte [0x4bb76f]
not al
and byte [0x4bb76b], al
and byte [0x4bb76e], al
and cl, al
mov al, cl
mov byte [0x4bb76f], cl
mov ecx, 0x4bb790
call fcn.00412630
mov cl, bl
mov ebx, dword [esp + 0x3c]
mov eax, dword [0x4b7468]
mov esi, dword [esp + 0x50]
movzx edx, byte [eax + 0xd2]
push 1
push 0
push esi
push ecx
mov ecx, dword [esp + 0x28]
mov eax, 0xffc3d44d
sub eax, edx
push ecx
call fcn.00411de0
add esp, 0x14
jmp 0x40f705
mov esi, dword [esp + 0x50]
cmp byte [esp + 0x13], 0
je 0x40f73f
test esi, esi
jne 0x40f73f
mov edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x48]
mov ecx, dword [0x4b7468]
movzx ecx, byte [ecx + 0xcb]
push edx
mov edx, dword [esp + 0x5c]
push eax
mov eax, dword [esp + 0x5c]
push 1
push edx
push eax
mov al, bl
call fcn.00410d80
add esp, 0x14
jmp 0x40f76a
mov ecx, dword [0x4b7468]
movzx edx, byte [ecx + 0xd2]
mov ecx, dword [esp + 0x40]
mov eax, 0xffc3d44d
sub eax, edx
mov edx, dword [esp + 0x48]
push eax
push 1
push esi
push ecx
push ebx
push edx
call fcn.0040fda0
add esp, 0x18
dec dword [esp + 0x14]
jne 0x40f54f
cmp byte [esp + 0x4c], 0
jne 0x40f8b4
cmp dword [0x4bd0d0], 0
je 0x40f793
mov bl, byte [0x4ba684]
jmp 0x40f87f
cmp dword [0x4bb8a0], 0
je 0x40f7a7
mov bl, byte [0x4bb76b]
jmp 0x40f87f
push 0xa0
xor bl, bl
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f7bc
mov bl, 0x10
push 0xa1
call edi
mov edx, 0x8000
test dx, ax
je 0x40f7d0
or bl, 0x20
push 0xa2
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f7e4
or bl, 1
push 0xa3
call edi
mov edx, 0x8000
test dx, ax
je 0x40f7f8
or bl, 2
push 0xa4
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f80c
or bl, 4
push 0xa5
call edi
mov edx, 0x8000
test dx, ax
je 0x40f820
or bl, 8
push 0x5b
call edi
mov ecx, 0x8000
test cx, ax
je 0x40f831
or bl, 0x40
push 0x5c
call edi
mov edx, 0x8000
test dx, ax
je 0x40f842
or bl, 0x80
cmp dword [0x4bb8a0], 0
je 0x40f87f
mov al, bl
not al
and al, byte [0x4bb76b]
je 0x40f87f
mov cl, byte [0x4bb76f]
not al
and byte [0x4bb76b], al
and byte [0x4bb76e], al
and cl, al
mov al, cl
mov byte [0x4bb76f], cl
mov ecx, 0x4bb790
call fcn.00412630
mov cl, bl
mov al, cl
xor al, byte [esp + 0x44]
mov byte [esp + 0x4c], cl
and al, cl
and al, 0xcc
je 0x40f8b4
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.00411de0
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret