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

Disassembly:
sub esp, 0x84c
mov ecx, dword [0x985238]
mov eax, dword [0x985240]
push ebx
push ebp
mov ebp, dword [esp + 0x858]
push esi
push edi
xor esi, esi
mov ebx, dword [ebp + 0x18]
push ecx
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x20], eax
call fcn.0051fbb7
mov ecx, dword [ebx + 0x400]
add esp, 4
cmp ecx, esi
mov dword [esp + 0x18], eax
jbe 0x500505
mov eax, ecx
xor edx, edx
mov esi, 0x3e8
push 0xa
div esi
mov eax, 0x10624dd3
mov esi, edx
lea edx, [esp + 0x24]
push edx
mul ecx
shr edx, 6
push edx
call fcn.0051f6f5
lea eax, [esp + 0x1c]
push 0xa
push eax
push esi
call fcn.0051f6f5
or ecx, 0xffffffff
lea edi, [esp + 0x38]
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x44]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x44]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x960ee8
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x44]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x10]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 1
mov dword [esp + 0x10], edi
jmp 0x500530
mov edi, str.0.000
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x44]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 1
mov edx, dword [ebx + 0x3f4]
lea ecx, [esp + 0x44]
push ecx
push ebp
push edx
call fcn.00500b40
mov esi, eax
add esp, 0xc
test esi, esi
je 0x50091d
cmp esi, 0xffffffff
jne 0x5005d9
mov eax, dword [ebp + 8]
test eax, eax
je 0x5009dd
cmp dword [ebx + 4], edi
je 0x5009dd
mov eax, dword [esp + 0x1c]
mov ecx, eax
dec eax
test ecx, ecx
mov dword [esp + 0x1c], eax
je 0x500934
mov eax, dword [ebx + 0x7c]
test eax, eax
je 0x500934
mov ecx, dword [ebx + 0x68]
mov eax, 0x10624dd3
inc ecx
mov dword [ebx + 0x68], ecx
mov ecx, dword [0x98523c]
imul ecx
sar edx, 6
mov eax, edx
lea ecx, [esp + 0x5c]
shr eax, 0x1f
add edx, eax
push edx
push 0x960ed0
push ecx
call fcn.0052106c
lea edx, [esp + 0x68]
push 0
push edx
push ebp
call fcn.004fc140
mov eax, dword [0x98523c]
push eax
push ebp
call fcn.004f7230
add esp, 0x20
jmp 0x500530
push 0
push 0x960ebc
push ebp
call fcn.004fc140
mov ecx, dword [ebx + 0x14]
push 0
push ecx
push ebp
push 3
push 0x15
push ebx
call fcn.004f8110
mov eax, dword [esp + 0x34]
add esp, 0x24
cmp eax, edi
jne 0x500705
lea edx, [ebx + 0x448]
push 0x960eb4
push edx
call fcn.004fc990
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
je 0x50094c
mov ecx, dword [ebx + 0x408]
mov edx, dword [ebx + 0x410]
mov eax, dword [ebx + 0x3fc]
mov edi, dword [ebx + 0x404]
mov dword [esp + 0x34], ecx
mov ecx, dword [esi + 0x1010]
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x18]
push ecx
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x40c]
push edx
push esi
push ebp
mov dword [esp + 0x48], eax
call fcn.00500e00
mov eax, dword [esi + 0x1030]
mov ecx, dword [esp + 0x28]
push eax
push ecx
push esi
push ebp
call fcn.00500e00
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0x40c]
add esp, 0x20
cmp edi, eax
jne 0x500691
mov edi, dword [esp + 0x34]
jmp 0x50069f
cmp dword [esp + 0x38], eax
jne 0x500990
mov edi, dword [esp + 0x3c]
mov edx, dword [esp + 0x14]
push 0x960eb0
push edi
push edx
call fcn.004fc9f0
add esp, 0xc
cmp eax, 0xffffffff
je 0x50097c
mov edx, dword [esp + 0x28]
mov ecx, dword [ebx + 0x3fc]
mov eax, edi
sub eax, edx
add ecx, eax
mov dword [ebx + 0x3fc], ecx
mov ecx, dword [ebx + 0x14]
push ecx
push edi
push ebp
push 7
push 0x15
push ebx
call fcn.004f8110
mov edi, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push edi
push edx
push eax
call fcn.004fc9d0
mov eax, dword [ebx + 0x3f8]
add esp, 0x24
add eax, edi
jmp 0x5007c4
lea edi, [ebx + 0x448]
push edi
call fcn.004fcca0
add esp, 4
test eax, eax
jne 0x50073d
mov ecx, dword [ebx + 0x3f4]
push ecx
call fcn.004f7c00
push edi
push eax
push edi
mov dword [esp + 0x20], eax
call fcn.004fccc0
mov edx, dword [esp + 0x20]
push edx
call fcn.0051face
add esp, 0x14
push ebp
push ebx
call fcn.004f7470
add esp, 8
test eax, eax
je 0x50092d
push 0x960ea8
push edi
call fcn.004fc990
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
je 0x5009a4
mov eax, dword [ebx + 0x14]
push 0
push 1
push 0
lea ecx, [ebx + 0x94]
push eax
push ecx
call fcn.004f8230
mov edx, dword [ebx + 0x14]
push edx
push 0
push ebp
push 6
push 0x15
push ebx
call fcn.004f8110
mov eax, dword [esi + 0x1010]
mov edi, dword [esp + 0x44]
push eax
push edi
push esi
push ebp
call fcn.00500e00
mov ecx, dword [esp + 0x50]
push eax
push edi
push ecx
call fcn.004fc9d0
mov edx, dword [esi + 0x1010]
add esp, 0x48
mov dword [ebx + 0x3fc], edx
mov eax, dword [esi + 0x1010]
mov dword [ebx + 0x3f8], eax
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x5007d6
mov edi, dword [ebx + 0x30]
jmp 0x5007d9
mov edi, dword [ebx + 0x5c]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esp + 0x18]
push edi
push ecx
push esi
push ebp
mov dword [esp + 0x20], eax
call fcn.00500e00
mov edi, eax
add esp, 0x10
test edi, edi
jle 0x500884
push 0
push edi
push ebp
push 0x10
push 0x15
push ebx
call fcn.004f8110
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push edi
push edx
push eax
call fcn.004fc9d0
mov ecx, dword [ebx + 0x3f8]
add esp, 0x24
add ecx, edi
mov dword [ebx + 0x3f8], ecx
mov ecx, dword [esi]
mov eax, dword [ecx + 0x1834]
test eax, eax
je 0x5009d6
mov eax, dword [ebp + 8]
test eax, eax
je 0x5009d6
cmp dword [ebx + 4], 1
je 0x5009d6
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x10]
cmp eax, 0x3e8
jae 0x5007ca
mov ecx, dword [ebx + 0x4c]
test ecx, ecx
je 0x5007ca
mov edx, 0x3e8
sub edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x5007ca
mov eax, dword [esp + 0x14]
mov edi, 1
push eax
mov dword [esp + 0x14], edi
call fcn.004fc9c0
mov ecx, dword [esi]
add esp, 4
mov dword [esp + 0x14], 0
mov eax, dword [ecx + 0x1834]
test eax, eax
je 0x5009e1
test esi, esi
je 0x5008c1
push esi
call fcn.00500ec0
add esp, 4
xor esi, esi
mov eax, dword [ebp + 8]
test eax, eax
je 0x5009e1
cmp dword [ebx + 4], edi
je 0x5009e1
mov ecx, dword [0x98523c]
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
lea ecx, [esp + 0x5c]
shr eax, 0x1f
add edx, eax
push edx
push 0x960ed0
push ecx
call fcn.0052106c
lea edx, [esp + 0x68]
push 0
push edx
push ebp
call fcn.004fc140
mov eax, dword [0x98523c]
push eax
push ebp
call fcn.004f7230
add esp, 0x20
jmp 0x50052b
push 0
push 0x960e94
push ebp
call fcn.004fc140
add esp, 0xc
xor edi, edi
jmp 0x5009e1
xor esi, esi
push esi
push 0x960e84
push ebp
call fcn.004fc140
add esp, 0xc
xor edi, edi
jmp 0x5009e1
lea ecx, [ebx + 0x448]
lea edx, [esp + 0x45c]
push ecx
push 0x960e74
push edx
call fcn.0052106c
lea eax, [esp + 0x468]
push 3
push eax
push ebp
call fcn.004fc140
add esp, 0x18
xor edi, edi
jmp 0x5009f2
push 3
push 0x960e58
push ebp
call fcn.004fc140
add esp, 0xc
xor edi, edi
jmp 0x5009e1
push 3
push 0x960e3c
push ebp
call fcn.004fc140
add esp, 0xc
xor edi, edi
jmp 0x5009e1
lea ecx, [ebx + 0x448]
lea edx, [esp + 0x45c]
push ecx
push 0x960e74
push edx
call fcn.0052106c
lea eax, [esp + 0x468]
push 3
push eax
push ebp
call fcn.004fc140
mov edi, dword [esp + 0x34]
add esp, 0x18
jmp 0x5009f2
mov edi, 1
jmp 0x5009e1
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x5009f2
push eax
call fcn.004fc9c0
add esp, 4
test esi, esi
je 0x5009ff
push esi
call fcn.00500ec0
add esp, 4
mov eax, dword [ebx + 0xa0]
test eax, eax
je 0x500a12
mov ecx, dword [ebx + 0x3fc]
mov dword [eax + 0x14], ecx
cmp edi, 1
push 0
jne 0x500a25
mov edx, dword [ebx + 0x3f8]
push edx
push ebp
push 8
jmp 0x500a2f
mov eax, dword [ebx + 0x3f8]
push eax
push ebp
push 9
push 0x15
push ebx
call fcn.004f8110
mov ecx, dword [ebx + 0x434]
add esp, 0x18
push ecx
call fcn.004fc780
mov edx, dword [ebx + 0x54]
dec edx
mov dword [ebx + 0x54], edx
mov edx, dword [ebx + 0x434]
push edx
call fcn.004fc790
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x84c
ret