Function at 0x4159a0
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 0x4159c5
cmp bl, 3
jne 0x4159cc
lea eax, [ebx + 0x66]
cmp al, 5
ja 0x4159d3
mov byte [esp + 0x13], 1
jmp 0x4159d8
mov byte [esp + 0x13], 0
mov edi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
test ecx, ecx
jle 0x415c37
mov dword [esp + 0x14], ecx
cmp dword [0x4d8f78], 0
jne 0x415a4d
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
sub eax, dword [0x4da1dc]
mov ecx, dword [0x4d4b04]
cmp eax, dword [ecx + 0xd8]
jbe 0x415a4d
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 0x415a46
push 1
push 0xffffffffffffffff
mov dword [0x4d4a0c], 0
call fcn.004014c0
add esp, 8
mov dword [0x4d4a0c], 1
call esi
mov dword [0x4da1dc], eax
cmp byte [esp + 0x4c], 0
jne 0x415bc6
mov eax, dword [0x4d4b04]
mov al, byte [eax + 0xf6]
test al, al
je 0x415a73
movzx ecx, al
mov esi, 0xffc3d44d
sub esi, ecx
jmp 0x415a78
mov esi, 0xffc3d44f
cmp dword [0x4d8f78], 0
je 0x415a8b
mov al, byte [0x4d75b3]
jmp 0x415baf
cmp dword [0x4d87d0], 0
je 0x415a9e
mov al, byte [0x4d869d]
jmp 0x415baf
push 0xa0
mov byte [esp + 0x16], 0
call edi
mov edx, 0x8000
test dx, ax
je 0x415ab9
mov byte [esp + 0x12], 0x10
push 0xa1
call edi
mov ecx, 0x8000
test cx, ax
je 0x415acf
or byte [esp + 0x12], 0x20
push 0xa2
call edi
mov edx, 0x8000
test dx, ax
je 0x415ae5
or byte [esp + 0x12], 1
push 0xa3
call edi
mov ecx, 0x8000
test cx, ax
je 0x415afb
or byte [esp + 0x12], 2
push 0xa4
call edi
mov edx, 0x8000
test dx, ax
je 0x415b11
or byte [esp + 0x12], 4
push 0xa5
call edi
mov ecx, 0x8000
test cx, ax
je 0x415b27
or byte [esp + 0x12], 8
push 0x5b
call edi
mov edx, 0x8000
test dx, ax
je 0x415b3a
or byte [esp + 0x12], 0x40
push 0x5c
call edi
mov ecx, 0x8000
test cx, ax
je 0x415b4d
or byte [esp + 0x12], 0x80
cmp dword [0x4d87d0], 0
je 0x415baa
mov bl, byte [esp + 0x12]
not bl
and bl, byte [0x4d869d]
je 0x415ba6
mov cl, byte [0x4d869f]
mov al, bl
not al
and byte [0x4d869d], al
and byte [0x4d869e], al
and cl, al
mov al, cl
mov byte [0x4d869f], cl
mov ecx, 0x4d86c8
call fcn.004188c0
mov eax, dword [0x4d75a4]
test eax, eax
je 0x415ba6
test byte [eax + 8], bl
je 0x415ba6
mov dword [0x4d75a4], 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
call fcn.004180e0
add esp, 0x14
cmp byte [esp + 0x13], 0
je 0x415bff
cmp dword [esp + 0x50], 0
jne 0x415bff
mov ecx, dword [esp + 0x5c]
mov edx, dword [0x4d4b04]
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.00417180
add esp, 0x14
jmp 0x415c29
mov eax, dword [0x4d4b04]
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.004162e0
add esp, 0x18
dec dword [esp + 0x14]
jne 0x4159ea
mov dl, byte [esp + 0x44]
cmp byte [esp + 0x4c], 0
jne 0x415da2
cmp dword [0x4d8f78], 0
je 0x415c55
mov al, byte [0x4d75b3]
jmp 0x415d78
cmp dword [0x4d87d0], 0
je 0x415c68
mov al, byte [0x4d869d]
jmp 0x415d78
push 0xa0
mov byte [esp + 0x50], 0
call edi
mov edx, 0x8000
test dx, ax
je 0x415c83
mov byte [esp + 0x4c], 0x10
push 0xa1
call edi
mov ecx, 0x8000
test cx, ax
je 0x415c99
or byte [esp + 0x4c], 0x20
push 0xa2
call edi
mov edx, 0x8000
test dx, ax
je 0x415caf
or byte [esp + 0x4c], 1
push 0xa3
call edi
mov ecx, 0x8000
test cx, ax
je 0x415cc5
or byte [esp + 0x4c], 2
push 0xa4
call edi
mov edx, 0x8000
test dx, ax
je 0x415cdb
or byte [esp + 0x4c], 4
push 0xa5
call edi
mov ecx, 0x8000
test cx, ax
je 0x415cf1
or byte [esp + 0x4c], 8
push 0x5b
call edi
mov edx, 0x8000
test dx, ax
je 0x415d04
or byte [esp + 0x4c], 0x40
push 0x5c
call edi
mov ecx, 0x8000
test cx, ax
je 0x415d17
or byte [esp + 0x4c], 0x80
cmp dword [0x4d87d0], 0
je 0x415d70
mov bl, byte [esp + 0x4c]
not bl
and bl, byte [0x4d869d]
je 0x415d70
mov cl, byte [0x4d869f]
mov al, bl
not al
and byte [0x4d869d], al
and byte [0x4d869e], al
and cl, al
mov al, cl
mov byte [0x4d869f], cl
mov ecx, 0x4d86c8
call fcn.004188c0
mov eax, dword [0x4d75a4]
test eax, eax
je 0x415d70
test byte [eax + 8], bl
je 0x415d70
mov dword [0x4d75a4], 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 0x415da2
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x44]
push 0
push 1
push edx
push eax
push 0
mov esi, 0xffc3d44d
call fcn.004180e0
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret