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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 4], edx
mov esi, eax
xor eax, eax
push ebp
push 0x5109e1
push dword fs:[eax]
mov dword fs:[eax], esp
xor ecx, ecx
push ebp
push 0x510994
push dword fs:[ecx]
mov dword fs:[ecx], esp
call fcn.0040dc20
add esp, 0xfffffff8
fstp qword [esp]
wait
lea ecx, [ebp - 0xa]
lea edx, [ebp - 8]
lea eax, [ebp - 6]
call fcn.0040db78
push dword [esi + 0x23c]
push dword [esi + 0x238]
lea ecx, [ebp - 0x18]
lea edx, [ebp - 0x16]
lea eax, [ebp - 0x14]
call fcn.0040db78
movzx eax, word [ebp - 6]
cmp ax, word [ebp - 0x14]
jne 0x510677
movzx eax, word [ebp - 8]
cmp ax, word [ebp - 0x16]
jne 0x510677
movzx eax, word [ebp - 0xa]
cmp ax, word [ebp - 0x18]
je 0x51068f
xor eax, eax
mov dword [esi + 0x244], eax
call fcn.0040dc20
fstp qword [esi + 0x238]
wait
mov byte [esi + 0x40], 0
cmp byte [esi + 0x40], 0
jne 0x5107e4
cmp byte [esi + 0x41], 0
jne 0x5107e4
call fcn.0040dbec
add esp, 0xfffffff8
fstp qword [esp]
wait
lea eax, [ebp - 0x12]
push eax
lea ecx, [ebp - 0x10]
lea edx, [ebp - 0xe]
lea eax, [ebp - 0xc]
call fcn.0040d898
movzx eax, word [ebp - 0xc]
mov edx, dword [0x7070f8]
cmp eax, dword [edx + 0x1a28]
jne 0x5107e4
mov byte [esi + 0x40], 1
mov eax, dword [esi + 0x50]
mov ebx, dword [eax + 8]
dec ebx
cmp ebx, 0
jl 0x51077a
mov eax, dword [esi + 0x50]
cmp dword [eax + 8], 0
jle 0x51077a
mov edx, ebx
call fcn.00420a68
mov edi, eax
push dword [edi + 4]
push dword [edi]
lea ecx, [ebp - 0x18]
lea edx, [ebp - 0x16]
lea eax, [ebp - 0x14]
call fcn.0040db78
movzx eax, word [ebp - 6]
cmp ax, word [ebp - 0x14]
jne 0x510770
movzx eax, word [ebp - 8]
cmp ax, word [ebp - 0x16]
jne 0x510770
movzx eax, word [ebp - 0xa]
cmp ax, word [ebp - 0x18]
jne 0x510770
mov byte [esi + 0x41], 1
mov byte [esi + 0x42], 0
call fcn.0040dc20
fstp qword [esi + 0x38]
wait
call sub.kernel32.dll_GetTickCount_1
mov dword [esi + 0x44], eax
call sub.kernel32.dll_GetTickCount_1
mov dword [esi + 0x48], eax
mov eax, dword [edi + 0xc]
mov dword [eax + 0x34], esi
mov edx, dword [0x50e04c]
mov eax, edi
call fcn.00406784
mov eax, dword [esi + 0x50]
mov edx, ebx
call fcn.0042090c
dec ebx
cmp ebx, 0xffffffff
jne 0x5106eb
cmp byte [esi + 0x41], 0
je 0x5107e4
mov eax, dword [esi + 0x20]
test eax, eax
je 0x51078a
mov dword [eax + 0x34], esi
mov eax, esi
call fcn.00510bf4
mov eax, esi
call fcn.005103e0
lea eax, [ebp - 4]
push eax
lea edx, [ebp - 0x1c]
mov eax, 0x5105d8
call fcn.00407bd4
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x24], eax
mov byte [ebp - 0x20], 0xb
lea edx, [ebp - 0x24]
xor ecx, ecx
pop eax
call fcn.0040bf74
mov eax, dword [0x707bc4]
mov eax, dword [eax]
mov cl, 2
mov edx, dword [ebp - 4]
call fcn.00632524
mov eax, dword [ebp - 4]
call fcn.004e0c68
mov dl, 1
mov eax, esi
call fcn.005117c0
xor ebx, ebx
lea edx, [ebx + ebx*2]
mov eax, dword [esi + edx*8 + 0xcc]
test eax, eax
je 0x510806
cmp byte [eax + 0x370], 0
je 0x510806
xor eax, eax
mov dword [esi + edx*8 + 0xcc], eax
inc ebx
cmp ebx, 4
jne 0x5107e6
xor ebx, ebx
lea edx, [ebx + ebx*2]
mov eax, dword [esi + edx*8 + 0x12c]
test eax, eax
je 0x51082e
cmp byte [eax + 0x370], 0
je 0x51082e
xor eax, eax
mov dword [esi + edx*8 + 0x12c], eax
inc ebx
cmp ebx, 0xc
jne 0x51080e
cmp byte [esi + 0x41], 0
je 0x510957
mov eax, dword [esi + 0x84]
test eax, eax
je 0x51084f
mov byte [eax + 0x3a6], 0
mov eax, dword [esi + 0x9c]
test eax, eax
je 0x510860
mov byte [eax + 0x3a6], 0
mov eax, dword [esi + 0xb4]
test eax, eax
je 0x510871
mov byte [eax + 0x3a6], 0
cmp byte [esi + 0x42], 0
jne 0x510904
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [esi + 0x44]
mov edx, dword [0x7070f8]
mov edx, dword [edx + 0x1a30]
mov ecx, dword [0x7070f8]
sub edx, dword [ecx + 0x1a2c]
cmp eax, edx
jbe 0x510904
mov byte [esi + 0x42], 1
lea eax, [ebp - 4]
push eax
lea edx, [ebp - 0x28]
mov eax, 0x5105e0
call fcn.00407bd4
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x38], eax
mov byte [ebp - 0x34], 0xb
mov eax, dword [0x7070f8]
mov eax, dword [eax + 0x1a2c]
mov ecx, 0xea60
xor edx, edx
div ecx
mov dword [ebp - 0x30], eax
mov byte [ebp - 0x2c], 0
lea edx, [ebp - 0x38]
mov ecx, 1
pop eax
call fcn.0040bf74
mov eax, dword [0x707bc4]
mov eax, dword [eax]
mov cl, 2
mov edx, dword [ebp - 4]
call fcn.00632524
mov eax, dword [ebp - 4]
call fcn.004e0c68
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [esi + 0x44]
mov edx, dword [0x7070f8]
cmp eax, dword [edx + 0x1a34]
jbe 0x510938
call sub.kernel32.dll_GetTickCount_1
cmp eax, dword [esi + 0x48]
jbe 0x510938
call sub.kernel32.dll_GetTickCount_1
add eax, 0x3e8
mov dword [esi + 0x48], eax
mov eax, esi
call fcn.0051118c
call sub.kernel32.dll_GetTickCount_1
sub eax, dword [esi + 0x44]
mov edx, dword [0x7070f8]
cmp eax, dword [edx + 0x1a30]
jbe 0x51098a
mov eax, esi
call fcn.00510fa4
jmp 0x51098a
mov eax, dword [esi + 0x84]
test eax, eax
je 0x510968
mov byte [eax + 0x3a6], 1
mov eax, dword [esi + 0x9c]
test eax, eax
je 0x510979
mov byte [eax + 0x3a6], 1
mov eax, dword [esi + 0xb4]
test eax, eax
je 0x51098a
mov byte [eax + 0x3a6], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x5109b3
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5109e8
lea eax, [ebp - 0x3c]
call fcn.004054d0
lea eax, [ebp - 0x28]
call fcn.004054d0
lea eax, [ebp - 0x1c]
call fcn.004054d0
lea eax, [ebp - 4]
call fcn.004054d0
ret