Function at 0x40df40
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]
mov byte [esp + 0xc], al
lea eax, [ebx - 1]
push ebp
push esi
cmp al, 5
ja 0x40df5e
cmp bl, 3
jne 0x40df66
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40df6d
mov byte [esp + 0xf], 1
jmp 0x40df72
mov byte [esp + 0xf], 0
mov esi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
test ecx, ecx
jle 0x40e192
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
cmp dword [0x4a4590], 0
jne 0x40dfed
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x4a5294]
mov ecx, dword [0x49f430]
cmp eax, dword [ecx + 0xb0]
jbe 0x40dfed
push 0
push 0
push 0
push 0
lea edx, [esp + 0x28]
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40dfe2
push 1
push 0xffffffffffffffff
mov dword [0x49f394], 0
call fcn.004012a0
add esp, 8
mov dword [0x49f394], 1
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x4a5294], eax
cmp byte [esp + 0x44], 0
jne 0x40e124
cmp dword [0x4a4590], 0
je 0x40e00c
mov cl, byte [0x4a1b55]
jmp 0x40e0fe
cmp dword [0x4a2d60], 0
je 0x40e020
mov cl, byte [0x4a2c2d]
jmp 0x40e0fe
push 0xa0
xor bl, bl
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e035
mov bl, 0x10
push 0xa1
call esi
mov edx, 0x8000
test dx, ax
je 0x40e049
or bl, 0x20
push 0xa2
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e05d
or bl, 1
push 0xa3
call esi
mov edx, 0x8000
test dx, ax
je 0x40e071
or bl, 2
push 0xa4
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e085
or bl, 4
push 0xa5
call esi
mov edx, 0x8000
test dx, ax
je 0x40e099
or bl, 8
push 0x5b
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e0aa
or bl, 0x40
push 0x5c
call esi
mov edx, 0x8000
test dx, ax
je 0x40e0bb
or bl, 0x80
cmp dword [0x4a2d60], 0
je 0x40e0f8
mov al, bl
not al
and al, byte [0x4a2c2d]
je 0x40e0f8
mov cl, byte [0x4a2c2f]
not al
and byte [0x4a2c2d], al
and byte [0x4a2c2e], al
and cl, al
mov al, cl
mov byte [0x4a2c2f], cl
mov ecx, 0x4a2c50
call fcn.00410ea0
mov cl, bl
mov ebx, dword [esp + 0x38]
mov eax, dword [0x49f430]
movzx edx, byte [eax + 0xce]
push 1
mov eax, 0xffc3d44d
sub eax, edx
mov edx, dword [esp + 0x4c]
push 0
push edx
push ecx
push ebp
call fcn.004106a0
add esp, 0x14
cmp byte [esp + 0xf], 0
je 0x40e15d
cmp dword [esp + 0x48], 0
jne 0x40e15d
mov eax, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
mov ecx, dword [0x49f430]
movzx ecx, byte [ecx + 0xc7]
push eax
mov eax, dword [esp + 0x50]
push edi
push 1
push edx
push eax
mov al, bl
call fcn.0040f790
add esp, 0x14
jmp 0x40e188
mov ecx, dword [0x49f430]
movzx edx, byte [ecx + 0xce]
mov ecx, dword [esp + 0x48]
mov eax, 0xffc3d44d
sub eax, edx
mov edx, dword [esp + 0x3c]
push eax
push 1
push ecx
push edx
push ebx
push edi
call fcn.0040e7b0
add esp, 0x18
dec dword [esp + 0x10]
jne 0x40df88
cmp byte [esp + 0x44], 0
jne 0x40e2d2
cmp dword [0x4a4590], 0
je 0x40e1b1
mov bl, byte [0x4a1b55]
jmp 0x40e29d
cmp dword [0x4a2d60], 0
je 0x40e1c5
mov bl, byte [0x4a2c2d]
jmp 0x40e29d
push 0xa0
xor bl, bl
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e1da
mov bl, 0x10
push 0xa1
call esi
mov edx, 0x8000
test dx, ax
je 0x40e1ee
or bl, 0x20
push 0xa2
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e202
or bl, 1
push 0xa3
call esi
mov edx, 0x8000
test dx, ax
je 0x40e216
or bl, 2
push 0xa4
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e22a
or bl, 4
push 0xa5
call esi
mov edx, 0x8000
test dx, ax
je 0x40e23e
or bl, 8
push 0x5b
call esi
mov ecx, 0x8000
test cx, ax
je 0x40e24f
or bl, 0x40
push 0x5c
call esi
mov edx, 0x8000
test dx, ax
je 0x40e260
or bl, 0x80
cmp dword [0x4a2d60], 0
je 0x40e29d
mov al, bl
not al
and al, byte [0x4a2c2d]
je 0x40e29d
mov cl, byte [0x4a2c2f]
not al
and byte [0x4a2c2d], al
and byte [0x4a2c2e], al
and cl, al
mov al, cl
mov byte [0x4a2c2f], cl
mov ecx, 0x4a2c50
call fcn.00410ea0
mov cl, bl
mov al, cl
xor al, byte [esp + 0x40]
mov byte [esp + 0x44], cl
and al, cl
and al, 0xcc
je 0x40e2d2
mov edx, dword [esp + 0x48]
push 0
not al
push 1
push edx
mov edx, dword [esp + 0x50]
and al, cl
movzx eax, al
push edx
push eax
mov eax, 0xffc3d44d
call fcn.004106a0
add esp, 0x14
pop esi
pop ebp
pop ebx
add esp, 0x28
ret