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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x65412b
mov eax, dword fs:[0]
push eax
sub esp, 0x160
push ebx
push esi
push edi
mov eax, dword [0x6af168]
xor eax, esp
push eax
lea eax, [esp + 0x170]
mov dword fs:[0], eax
mov ebx, ecx
mov edi, edx
lea eax, [edi + 0x3c]
push eax
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor esi, esi
mov dword [esp + 0x178], esi
cmp byte [edi + 0xcdc], 0
jne 0x5015d9
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [esp + 0x170]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x64
lea ecx, [esp + 0x98]
push esi
push ecx
call fcn.0062a710
add esp, 0xc
cmp byte [edi + 0x38], 0
mov dword [esp + 0x94], 0x64
mov byte [edi + 0x54], 1
je 0x50163e
cmp dword [0x6b3790], esi
je 0x501634
mov edx, dword [esp + 0x24]
push edx
mov byte [edi + 0x54], 0
mov byte [edi + 0x38], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [esp + 0x170]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [edi + 0x30]
call fcn.005075f0
xor esi, esi
cmp ebx, esi
je 0x501686
cmp byte [edi + 0x9c], 0
jne 0x501686
mov ecx, dword [ebx + 4]
mov esi, dword [ebx + 0xc]
mov eax, dword [ebx]
mov edx, dword [ebx + 8]
mov dword [esp + 0x38], esi
add esi, ecx
mov ebx, ecx
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x38]
add edx, eax
mov dword [esp + 0x1c], esi
add ecx, ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], edx
xor esi, esi
jmp 0x5016c9
mov edx, dword [edi + 0xb0]
mov eax, dword [edi + 0xb8]
mov ebx, dword [edi + 0xb4]
mov ecx, dword [edi + 0xbc]
add eax, edx
add ecx, ebx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], eax
mov eax, dword [edi + 0x7c]
xor edx, edx
mov dword [esp + 0x1c], ecx
mov ecx, dword [edi + 0x80]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], eax
mov eax, dword [edi + 0xce0]
lea edx, [esp + 0x54]
push edx
push eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], esi
call dword [sym.imp.USER32.dll_ClientToScreen]
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x54]
push ecx
push edx
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
mov eax, dword [edi + 0x68]
push esi
push 0x11
lea edx, [esp + 0x104]
push edx
mov dword [esp + 0x108], esi
mov dword [esp + 0x108], 0x6c
mov ecx, dword [eax]
push esi
push eax
mov eax, dword [ecx + 0x64]
call eax
mov eax, dword [edi + 0x68]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
push esi
push eax
call edx
cmp byte [edi + 0xce4], 0
je 0x501b47
push 1
call dword [sym.imp.USER32.dll_GetSystemMetrics]
cmp byte [edi + 0xcfc], 0
mov dword [esp + 0x70], eax
jne 0x501acc
cmp dword [edi + 0x6c], esi
mov eax, dword [edi + 0x68]
mov dword [esp + 0x20], eax
lea eax, [edi + 0x6c]
je 0x50187e
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x44], edx
mov edx, dword [esp + 0x1c]
mov esi, eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], edx
xor ebx, ebx
cmp dword [esi], 0
je 0x50185c
cmp ebx, 3
je 0x5017c9
cmp dword [esi + 4], 0
je 0x5017c9
cdq
sub eax, edx
mov ecx, eax
mov eax, dword [esp + 0x34]
cdq
sub eax, edx
sar ecx, 1
sar eax, 1
xor edx, edx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
jmp 0x5017fd
mov ecx, dword [edi + 0xb0]
mov eax, dword [edi + 0xb8]
mov edx, dword [edi + 0xb4]
add eax, ecx
mov ecx, dword [edi + 0xbc]
add ecx, edx
mov edx, dword [edi + 0xb0]
mov dword [esp + 0x10], edx
mov edx, dword [edi + 0xb4]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esi]
mov dword [esp + 0x14], edx
mov ecx, dword [eax]
lea edx, [esp + 0x94]
push edx
push 0x1000000
lea edx, [esp + 0x30]
push edx
mov edx, dword [esp + 0x2c]
push edx
lea edx, [esp + 0x20]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov ecx, dword [esi]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x18]
add ebx, 1
add esi, 4
cmp ebx, 4
mov dword [esp + 0x28], edx
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ecx
jl 0x501795
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
xor esi, esi
mov edx, dword [esp + 0x20]
mov eax, dword [edi + 0xd0c]
mov ecx, dword [edi + 0xd10]
push esi
push edx
mov esi, edi
mov dword [edi + 0xd14], eax
mov dword [edi + 0xd18], ecx
call fcn.00501e00
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x5c8], 0
je 0x501963
cmp byte [eax + 0x5c9], 0
jne 0x501963
cmp dword [edi + 0xcc], 3
jge 0x501954
mov eax, dword [eax + 0xc4]
cdq
sub eax, edx
mov esi, eax
mov eax, dword [esp + 0x14]
sar esi, 1
lea ecx, [eax + esi]
mov dword [esp + 0x38], ecx
mov ecx, dword [edi + 0x80]
add ecx, eax
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x3c], connect
xor bl, bl
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [esp + 0x50], eax
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
mov edx, dword [edx + 0x40]
lea ecx, [esp + 0x3c]
push ecx
push eax
call edx
test eax, eax
jne 0x501931
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x3c]
sub ecx, eax
test ecx, ecx
jle 0x501938
cmp eax, dword [esp + 0x70]
jge 0x501938
mov bl, 1
jmp 0x50193c
cmp eax, 0x88760219
jne 0x50194d
test bl, bl
jne 0x5019b7
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x50]
cmp eax, 0xc8
jb 0x501905
add dword [edi + 0xcc], 1
mov eax, dword [edi + 0x58]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x58]
push 0
push 1
push eax
call edx
lea edx, [esp + 0x94]
push edx
push 0x1000000
lea edx, [esp + 0x30]
push edx
mov edx, dword [esp + 0x2c]
push edx
lea edx, [esp + 0x20]
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
cmp byte [edi + 0xd20], 0
mov ebx, eax
je 0x501b3c
mov ecx, dword [esp + 0x20]
push ecx
mov esi, edi
call fcn.00501ce0
push ebx
mov byte [edi + 0xd20], 1
mov ebx, str.Redraw_Windowed
jmp 0x501caf
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov dword [esp + 0x84], edx
mov edx, dword [esp + 0x38]
mov dword [esp + 0x90], edx
mov edx, dword [esp + 0x30]
mov dword [esp + 0x48], edx
lea edx, [esp + 0x94]
push edx
push 0x1000000
mov dword [esp + 0x90], eax
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x48]
push edx
mov dword [esp + 0x98], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x4c], eax
mov eax, dword [edi + 0x60]
push ebx
lea edx, [esp + 0x94]
mov dword [edi + 0xcc], 0
mov dword [esp + 0x54], ecx
mov dword [esp + 0x5c], esi
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x50], ecx
jmp 0x501a40
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
mov edx, dword [edx + 0x40]
lea ecx, [esp + 0x3c]
push ecx
push eax
call edx
test eax, eax
jl 0x501a40
mov eax, dword [esp + 0x3c]
cmp eax, dword [esp + 0x50]
jb 0x501a68
mov ecx, dword [esp + 0x6c]
sub ecx, eax
test ecx, ecx
jg 0x501a40
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x68], edx
mov edx, dword [esp + 0x34]
mov dword [esp + 0x80], edx
lea edx, [esp + 0x94]
push edx
push 0x1000000
lea edx, [esp + 0x7c]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x6c], ecx
mov ecx, dword [esp + 0x38]
push edx
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], esi
mov dword [esp + 0x88], ecx
push ebx
lea edx, [esp + 0x6c]
jmp 0x50197e
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x5c8], 0
je 0x501aef
cmp byte [eax + 0x5c9], 0
jne 0x501aef
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
push esi
push 1
push eax
mov eax, dword [edx + 0x58]
call eax
mov eax, dword [edi + 0x64]
mov ecx, dword [edi + 0xd0c]
mov edx, dword [edi + 0xd10]
push 1
push eax
mov esi, edi
mov dword [edi + 0xd14], ecx
mov dword [edi + 0xd18], edx
call fcn.00501e00
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
lea edx, [esp + 0x94]
push edx
push 0x1000000
lea edx, [esp + 0x30]
push edx
mov edx, dword [edi + 0x64]
push edx
lea edx, [esp + 0x20]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov ebx, eax
push ebx
mov ebx, str.Redraw_Windowed
jmp 0x501caf
mov eax, dword [edi + 0x2c]
cmp byte [eax + 0x368], 0
jne 0x501c83
cmp byte [eax + 0x369], 0
je 0x501c83
cmp byte [edi + 0xcfc], 0
jne 0x501bb2
mov eax, dword [edi + 0x64]
mov edx, dword [eax]
mov edx, dword [edx + 0x14]
lea ecx, [esp + 0x94]
push ecx
push 0x1000000
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [edi + 0x68]
push ecx
lea ecx, [esp + 0x20]
push ecx
push eax
call edx
cmp eax, esi
jge 0x501bb2
push eax
mov ebx, str.Redraw_FullScreen_Flip__1_
mov byte [edi + 0x54], 0
call fcn.004ff620
test al, al
mov eax, dword [esp + 0x24]
push eax
jmp 0x501cbf
cmp byte [edi + 0x38], 0
je 0x501c37
cmp byte [edi + 0x9c], 0
je 0x501c37
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov eax, dword [edi + 0xa0]
mov ecx, dword [edi + 0xa4]
sub eax, ebx
cmp edx, esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], edx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], esi
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], ecx
jle 0x501c19
mov ecx, dword [edi + 0xcec]
mov edx, dword [ecx]
mov edx, dword [edx + 0x94]
push 0x6bac48
lea eax, [esp + 0x60]
push eax
call edx
mov eax, dword [esp + 0x48]
cmp eax, esi
jle 0x501c37
mov ecx, dword [edi + 0xcec]
mov eax, dword [ecx]
mov eax, dword [eax + 0x94]
push 0x6bac48
lea edx, [esp + 0x44]
push edx
call eax
mov eax, dword [edi + 0x64]
mov ecx, dword [edi + 0xd0c]
mov edx, dword [edi + 0xd10]
push 1
push eax
mov esi, edi
mov dword [edi + 0xd14], ecx
mov dword [edi + 0xd18], edx
call fcn.00501e00
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x2c]
push 1
push 0
push eax
call edx
push eax
mov ebx, str.Redraw_FullScreen_Flip__2_
mov byte [edi + 0x54], 0
call fcn.004ff620
test al, al
mov eax, dword [esp + 0x24]
push eax
jmp 0x501cbf
mov eax, dword [edi + 0x60]
mov ecx, dword [eax]
lea edx, [esp + 0x94]
push edx
push 0x1000000
lea edx, [esp + 0x30]
push edx
mov edx, dword [edi + 0x68]
push edx
lea edx, [esp + 0x20]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
push eax
mov ebx, str.Redraw_FullScreen_Blt
mov byte [edi + 0x54], 0
call fcn.004ff620
mov ecx, dword [esp + 0x24]
test al, al
push ecx
sete bl
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
mov ecx, dword [esp + 0x170]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret