Function at 0x509b50
Capabilities:
Check for time delay via gettickcount

Disassembly:
push ebp
mov ebp, esp
mov ecx, 5
push 0
push 0
dec ecx
jne 0x509b58
push ebx
push esi
push edi
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x509e5a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
add eax, 0x40
push eax
call sub.kernel32.dll_EnterCriticalSection_1
xor eax, eax
push ebp
push 0x509e38
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x58]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov ecx, dword [eax]
call dword [ecx + 0x40]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x58]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 4]
cmp dword [eax + 0x70], 0
je 0x509c8e
mov eax, dword [ebp - 4]
cmp byte [eax + 0x74], 0
je 0x509c8e
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [eax]
call dword [edx + 0x14]
dec eax
test eax, eax
jl 0x509c8e
inc eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], 0
lea ecx, [ebp - 0x10]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
cmp dword [ebp - 0x10], 0
je 0x509c82
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x18]
push eax
call sub.kernel32.dll_GetTickCount_1
pop edx
sub eax, edx
cmp eax, 0x64
jae 0x509c82
lea ecx, [ebp - 0x14]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov eax, dword [ebp - 0x14]
call fcn.00409cd4
test al, al
je 0x509c82
xor eax, eax
push ebp
push 0x509c78
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
lea ecx, [ebp - 0x18]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x5c]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x70]
xor ecx, ecx
call fcn.00489d84
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x509c82
inc dword [ebp - 8]
dec dword [ebp - 0xc]
jne 0x509bed
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 4]
mov edx, dword [eax + 0x60]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov ecx, dword [eax]
call dword [ecx + 0x40]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x60]
mov edx, dword [eax]
call dword [edx + 0x44]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [eax]
call dword [edx + 0x14]
dec eax
test eax, eax
jl 0x509e1e
inc eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], 0
lea ecx, [ebp - 0x1c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
cmp dword [ebp - 0x1c], 0
je 0x509e12
cmp byte [0x53cc40], 0
je 0x509db7
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x18]
push eax
call sub.kernel32.dll_GetTickCount_1
pop edx
sub eax, edx
cmp eax, 0xbb8
jbe 0x509d84
mov byte [0x53cc40], 0
xor eax, eax
push ebp
push 0x509d75
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x53eb20]
cmp dword [eax + 0xd8], 0
je 0x509d68
push 1
push 0
lea ecx, [ebp - 0x20]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov eax, dword [ebp - 0x20]
call fcn.0040520c
push eax
mov eax, dword [0x53eb20]
mov eax, dword [eax + 0xd8]
call eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x509e12
lea ecx, [ebp - 0x24]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x18]
mov ecx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x60]
pop edx
mov ebx, dword [eax]
call dword [ebx + 0x3c]
jmp 0x509e12
xor eax, eax
push ebp
push 0x509e08
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x53eb20]
cmp dword [eax + 0xd8], 0
je 0x509dfe
push 1
push 0
lea ecx, [ebp - 0x28]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x64]
mov edx, dword [ebp - 8]
mov ebx, dword [eax]
call dword [ebx + 0xc]
mov eax, dword [ebp - 0x28]
call fcn.0040520c
push eax
mov eax, dword [0x53eb20]
mov eax, dword [eax + 0xd8]
call eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x509e12
inc dword [ebp - 8]
dec dword [ebp - 0xc]
jne 0x509cd4
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x509e3f
mov eax, dword [ebp - 4]
add eax, 0x40
push eax
call sub.kernel32.dll_LeaveCriticalSection_1
ret