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

Disassembly:
sub esp, 0xb4
push ebx
push ebp
push esi
push edi
xor edi, edi
xor ebp, ebp
mov dword [esp + 0x1c], edi
mov byte [esp + 0x13], 0
mov dword [esp + 0x20], edi
call fcn.0048d790
xor esi, esi
mov eax, 0x6b2440
mov dword [esp + 0x18], esi
cmp byte [eax], 0
je 0x50979b
add eax, 0x44
inc esi
cmp eax, 0x6b2ee0
jl 0x50978b
cmp esi, edi
mov dword [esp + 0x18], esi
jle 0x509bfd
lea edx, [esp + 0x24]
mov ecx, 0x6b2458
mov ebx, esi
mov eax, dword [ecx]
add ecx, 0x44
add edx, 4
mov eax, dword [eax + 8]
mov dword [edx - 4], eax
add ebp, eax
dec ebx
jne 0x5097b2
test ebp, ebp
je 0x509bfd
test esi, esi
je 0x509bfd
push 0xff800080
mov dword [0xac08c8], 0xff800080
call fcn.00502f90
add esp, 4
mov dword [esp + 0x14], 0
xor esi, esi
mov ebp, 0x6b2450
lea ebx, [esp + 0x24]
mov ecx, dword [ebx]
xor eax, eax
cmp ecx, eax
jle 0x50981e
mov cl, byte [ebp - 7]
test cl, cl
je 0x509833
mov ecx, dword [ebp]
push ecx
call fcn.00509c10
add esp, 4
mov edi, eax
xor eax, eax
mov ecx, dword [esp + 0x18]
inc esi
add ebx, 4
add ebp, 0x44
cmp esi, ecx
jl 0x5097ff
mov ebx, dword [esp + 0x1c]
jmp 0x509847
mov edx, esi
shl edx, 4
add edx, esi
mov edi, dword [edx*4 + 0x6b2450]
mov ebx, dword [edi + 0x20]
mov dword [edi + 0x20], eax
mov ecx, dword [edi + 8]
sar ecx, 0xc
mov dword [0x56f1b4], ecx
mov edx, dword [edi + 0xc]
sar edx, 0xc
mov dword [0x56f1b8], edx
mov ecx, dword [edi + 0x10]
sar ecx, 0xc
dec ecx
mov word [0x56f1dc], ax
mov dword [0x56f1bc], ecx
mov word [0x56f1de], ax
mov word [0x56f1e0], ax
mov dword [0x56f1b0], eax
call fcn.00505720
mov al, byte [0x661180]
test al, al
je 0x5098ab
mov dx, word [0x56f1de]
sub dx, 0x10
and edx, 0xfff
mov word [0x56f1de], dx
jmp 0x5098c9
mov al, byte [0x661190]
test al, al
je 0x5098c9
mov ax, word [0x56f1de]
add ax, 0x10
and eax, 0xfff
mov word [0x56f1de], ax
mov al, byte [0x6611a0]
test al, al
je 0x50997c
xor ebp, ebp
push ebp
push 0x2a
call fcn.0050a650
add esp, 8
test eax, eax
jne 0x509961
push ebp
push 0x36
call fcn.0050a650
add esp, 8
test eax, eax
jne 0x509961
mov ax, word [0x56f1de]
mov edx, dword [0x56f1b4]
and eax, 0xfff
shl eax, 2
movsx ecx, word [eax + 0x610c48]
shl ecx, 5
sar ecx, 0xc
add edx, ecx
mov dword [0x56f1b4], edx
movsx edx, word [eax + 0x610c4a]
mov eax, dword [0x56f1bc]
shl edx, 5
sar edx, 0xc
add eax, edx
mov dword [0x56f1bc], eax
mov eax, dword [0x56f1dc]
and eax, 0xfff
movsx ecx, word [eax*4 + 0x610c48]
mov eax, dword [0x56f1b8]
shl ecx, 5
sar ecx, 0xc
sub eax, ecx
mov dword [0x56f1b8], eax
jmp 0x509a2a
mov edx, dword [0x56f1dc]
add edx, 0x10
and edx, 0xfff
mov word [0x56f1dc], dx
jmp 0x509a2a
mov al, byte [0x6611b0]
test al, al
je 0x509a28
push 0
push 0x2a
call fcn.0050a650
add esp, 8
test eax, eax
jne 0x509a12
push eax
push 0x36
call fcn.0050a650
add esp, 8
test eax, eax
jne 0x509a12
mov ax, word [0x56f1de]
mov edx, dword [0x56f1b4]
and eax, 0xfff
mov ebp, dword [0x56f1bc]
shl eax, 2
movsx ecx, word [eax + 0x610c48]
shl ecx, 5
sar ecx, 0xc
sub edx, ecx
mov dword [0x56f1b4], edx
movsx edx, word [eax + 0x610c4a]
mov eax, dword [0x56f1dc]
and eax, 0xfff
shl edx, 5
movsx ecx, word [eax*4 + 0x610c48]
mov eax, dword [0x56f1b8]
shl ecx, 5
sar edx, 0xc
sar ecx, 0xc
sub ebp, edx
add eax, ecx
mov dword [0x56f1bc], ebp
mov dword [0x56f1b8], eax
jmp 0x509a28
mov edx, dword [0x56f1dc]
add edx, 0xfffffff0
and edx, 0xfff
mov word [0x56f1dc], dx
xor ebp, ebp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x20]
cmp eax, 0xfa
jbe 0x509ad9
mov al, byte [0x661110]
test al, al
je 0x509a95
mov eax, esi
mov ecx, dword [esp + 0x14]
shl eax, 4
add eax, esi
mov dl, byte [eax*4 + 0x6b2449]
test dl, dl
setne al
cmp ecx, ebp
je 0x509a70
test al, al
jne 0x509a70
mov eax, ecx
dec eax
mov dword [esp + 0x14], eax
jmp 0x509ad4
dec esi
jns 0x509a7a
mov ecx, dword [esp + 0x18]
lea esi, [ecx - 1]
cmp dword [esp + esi*4 + 0x24], ebp
jle 0x509a70
test al, al
je 0x509a8a
mov dword [esp + 0x14], ebp
jmp 0x509ad4
mov eax, dword [esp + esi*4 + 0x24]
dec eax
mov dword [esp + 0x14], eax
jmp 0x509ad4
mov al, byte [0x661120]
test al, al
je 0x509ad9
mov edx, dword [esp + 0x14]
lea eax, [edx + 1]
cdq
idiv dword [esp + esi*4 + 0x24]
cmp edx, ebp
mov dword [esp + 0x14], edx
je 0x509ac4
mov eax, esi
shl eax, 4
add eax, esi
mov cl, byte [eax*4 + 0x6b2449]
test cl, cl
je 0x509ad4
lea eax, [esi + 1]
cdq
idiv dword [esp + 0x18]
mov esi, edx
cmp dword [esp + esi*4 + 0x24], ebp
jle 0x509ac4
mov byte [esp + 0x13], 1
push ebp
push 0x10
call fcn.0050a650
add esp, 8
test eax, eax
jne 0x509bd1
mov al, byte [esp + 0x13]
test al, al
je 0x509baf
xor eax, eax
mov al, byte [edi + 0x1f]
mov ecx, eax
shl ecx, 4
add ecx, eax
mov al, byte [ecx*4 + 0x6b2449]
test al, al
je 0x509b1d
cmp edi, ebp
je 0x509b20
mov edx, dword [edi]
push 1
mov ecx, edi
call dword [edx]
jmp 0x509b20
mov dword [edi + 0x20], ebx
mov eax, esi
shl eax, 4
add eax, esi
shl eax, 2
mov cl, byte [eax + 0x6b2449]
test cl, cl
mov ecx, dword [esp + 0x14]
je 0x509b50
mov edx, dword [eax + 0x6b2450]
shl ecx, 6
add edx, ecx
push edx
call fcn.00509c10
add esp, 4
mov edi, eax
jmp 0x509b67
mov edi, dword [eax + 0x6b2450]
shl ecx, 6
add edi, ecx
mov edx, dword [edi + 0x20]
mov dword [edi + 0x20], ebp
mov dword [esp + 0x1c], edx
mov ebx, edx
mov eax, dword [edi + 8]
sar eax, 0xc
mov dword [0x56f1b4], eax
mov ecx, dword [edi + 0xc]
sar ecx, 0xc
mov dword [0x56f1b8], ecx
mov edx, dword [edi + 0x10]
sar edx, 0xc
dec edx
mov word [0x56f1dc], bp
mov dword [0x56f1bc], edx
mov word [0x56f1de], bp
mov word [0x56f1e0], bp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x20], eax
mov byte [esp + 0x13], 0
mov eax, dword [esp + 0x14]
mov ecx, esi
shl ecx, 4
add ecx, esi
push eax
lea edx, [ecx*4 + 0x6b2440]
push edx
push edi
call fcn.00509580
add esp, 0xc
jmp 0x509883
mov eax, esi
shl eax, 4
add eax, esi
mov cl, byte [eax*4 + 0x6b2449]
test cl, cl
je 0x509bfa
cmp edi, ebp
je 0x509bfd
mov edx, dword [edi]
push 1
mov ecx, edi
call dword [edx]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb4
ret
mov dword [edi + 0x20], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xb4
ret