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

Disassembly:
sub esp, 0x28
mov dl, byte [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x30]
or al, dl
push ebp
mov ebp, dword [esp + 0x40]
mov byte [esp + 0x10], al
lea eax, [ebx - 1]
push esi
push edi
cmp al, 5
ja 0x4108d5
cmp bl, 3
jne 0x4108dc
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x4108e3
mov byte [esp + 0x13], 1
jmp 0x4108e8
mov byte [esp + 0x13], 0
mov esi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
test ecx, ecx
jle 0x410b49
mov dword [esp + 0x14], ecx
cmp dword [0x51675c], 0
jne 0x41095d
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
sub eax, dword [0x5179a4]
mov ecx, dword [0x51161c]
cmp eax, dword [ecx + 0xd8]
jbe 0x41095d
push 0
push 0
push 0
push 0
lea edx, [esp + 0x2c]
push edx
call dword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x410956
push 1
push 0xffffffffffffffff
mov dword [0x511524], 0
call fcn.00401930
add esp, 8
mov dword [0x511524], 1
call edi
mov dword [0x5179a4], eax
cmp byte [esp + 0x4c], 0
jne 0x410ad8
mov eax, dword [0x51161c]
mov al, byte [eax + 0xf6]
test al, al
je 0x410983
movzx ecx, al
mov edi, 0xffc3d44d
sub edi, ecx
jmp 0x410988
mov edi, 0xffc3d44f
cmp dword [0x51675c], 0
je 0x41099b
mov al, byte [0x514de3]
jmp 0x410abf
cmp dword [0x51600c], 0
je 0x4109ae
mov al, byte [0x515ed9]
jmp 0x410abf
push 0xa0
mov byte [esp + 0x16], 0
call esi
mov edx, 0x8000
test dx, ax
je 0x4109c9
mov byte [esp + 0x12], 0x10
push 0xa1
call esi
mov ecx, 0x8000
test cx, ax
je 0x4109df
or byte [esp + 0x12], 0x20
push 0xa2
call esi
mov edx, 0x8000
test dx, ax
je 0x4109f5
or byte [esp + 0x12], 1
push 0xa3
call esi
mov ecx, 0x8000
test cx, ax
je 0x410a0b
or byte [esp + 0x12], 2
push 0xa4
call esi
mov edx, 0x8000
test dx, ax
je 0x410a21
or byte [esp + 0x12], 4
push 0xa5
call esi
mov ecx, 0x8000
test cx, ax
je 0x410a37
or byte [esp + 0x12], 8
push 0x5b
call esi
mov edx, 0x8000
test dx, ax
je 0x410a4a
or byte [esp + 0x12], 0x40
push 0x5c
call esi
mov ecx, 0x8000
test cx, ax
je 0x410a5d
or byte [esp + 0x12], 0x80
cmp dword [0x51600c], 0
je 0x410aba
mov bl, byte [esp + 0x12]
not bl
and bl, byte [0x515ed9]
je 0x410ab6
mov cl, byte [0x515edb]
mov al, bl
not al
and byte [0x515ed9], al
and byte [0x515eda], al
and cl, al
mov al, cl
mov byte [0x515edb], cl
mov ecx, 0x515f00
call fcn.00413870
mov eax, dword [0x514dd4]
test eax, eax
je 0x410ab6
test byte [eax + 8], bl
je 0x410ab6
mov dword [0x514dd4], 0
mov ebx, dword [esp + 0x3c]
movzx eax, byte [esp + 0x12]
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.00413090
add esp, 0x14
cmp byte [esp + 0x13], 0
je 0x410b11
cmp dword [esp + 0x50], 0
jne 0x410b11
mov ecx, dword [esp + 0x5c]
mov edx, dword [0x51161c]
mov eax, dword [esp + 0x58]
push ecx
movzx ecx, byte [edx + 0xef]
mov edx, dword [esp + 0x58]
push ebp
push 1
push eax
push edx
mov al, bl
call fcn.004121e0
add esp, 0x14
jmp 0x410b3b
mov eax, dword [0x51161c]
movzx ecx, byte [eax + 0xf6]
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.00411200
add esp, 0x18
dec dword [esp + 0x14]
jne 0x4108fa
mov dl, byte [esp + 0x44]
cmp byte [esp + 0x4c], 0
jne 0x410cb4
cmp dword [0x51675c], 0
je 0x410b67
mov al, byte [0x514de3]
jmp 0x410c8a
cmp dword [0x51600c], 0
je 0x410b7a
mov al, byte [0x515ed9]
jmp 0x410c8a
push 0xa0
mov byte [esp + 0x50], 0
call esi
mov edx, 0x8000
test dx, ax
je 0x410b95
mov byte [esp + 0x4c], 0x10
push 0xa1
call esi
mov ecx, 0x8000
test cx, ax
je 0x410bab
or byte [esp + 0x4c], 0x20
push 0xa2
call esi
mov edx, 0x8000
test dx, ax
je 0x410bc1
or byte [esp + 0x4c], 1
push 0xa3
call esi
mov ecx, 0x8000
test cx, ax
je 0x410bd7
or byte [esp + 0x4c], 2
push 0xa4
call esi
mov edx, 0x8000
test dx, ax
je 0x410bed
or byte [esp + 0x4c], 4
push 0xa5
call esi
mov ecx, 0x8000
test cx, ax
je 0x410c03
or byte [esp + 0x4c], 8
push 0x5b
call esi
mov edx, 0x8000
test dx, ax
je 0x410c16
or byte [esp + 0x4c], 0x40
push 0x5c
call esi
mov ecx, 0x8000
test cx, ax
je 0x410c29
or byte [esp + 0x4c], 0x80
cmp dword [0x51600c], 0
je 0x410c82
mov bl, byte [esp + 0x4c]
not bl
and bl, byte [0x515ed9]
je 0x410c82
mov cl, byte [0x515edb]
mov al, bl
not al
and byte [0x515ed9], al
and byte [0x515eda], al
and cl, al
mov al, cl
mov byte [0x515edb], cl
mov ecx, 0x515f00
call fcn.00413870
mov eax, dword [0x514dd4]
test eax, eax
je 0x410c82
test byte [eax + 8], bl
je 0x410c82
mov dword [0x514dd4], 0
mov al, byte [esp + 0x4c]
mov dl, byte [esp + 0x44]
not dl
and dl, al
and dl, 0xcc
mov byte [esp + 0x44], dl
je 0x410cb4
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x44]
push 0
push 1
push edx
push eax
push 0
mov eax, 0xffc3d44d
call fcn.00413090
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret