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

Disassembly:
push 0xffffffffffffffff
push 0x598a8b
mov eax, dword fs:[0]
push eax
sub esp, 0x388
mov eax, dword [0x5e173c]
xor eax, esp
mov dword [esp + 0x380], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5e173c]
xor eax, esp
push eax
lea eax, [esp + 0x39c]
mov dword fs:[0], eax
mov ebp, ecx
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x3ac]
lea ebx, [ebp + 0x10]
mov dword [esp + 0xf8], eax
mov edi, ebx
mov eax, dword [esp + 0x3b0]
mov dword [esp + 0xf0], eax
mov eax, dword [esp + 0x3c0]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x3c4]
mov dword [esp + 0x20], eax
mov dword [ebp + 0xc], 0
mov dword [esp + 0x2c], ebx
mov dword [esp + 0xf4], edi
test edi, edi
je 0x522f9b
mov eax, dword [edi]
test eax, eax
je 0x522f9b
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x3a4], 0
mov eax, dword [ebp + 4]
mov dword [esp + 0x18], eax
test eax, eax
je 0x523968
test edi, edi
je 0x522fcf
mov eax, dword [edi]
test eax, eax
je 0x522fc6
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor edi, edi
mov dword [esp + 0xf4], edi
lea esi, [ebp + 0x14]
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebp, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push eax
push esi
call ebp
mov byte [esp + 0x3a4], 1
sub esp, 0x14
push dword [esp + 0x10c]
push ecx
push dword [esp + 0x34]
call fcn.004bacc0
mov ecx, eax
call fcn.004badb0
mov dword [esp + 0x18], eax
mov byte [esp + 0x3a4], 0
push 0
push esi
call ebp
cmp dword [esp + 0x18], 0
jne 0x52304b
mov dword [esp + 0x3a4], 0xffffffff
test edi, edi
je 0x52398f
mov eax, dword [edi]
test eax, eax
je 0x523984
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
jmp 0x523984
mov dword [esp + 0xf8], ebx
test ebx, ebx
je 0x523063
mov eax, dword [ebx]
test eax, eax
je 0x523063
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x3a4], 2
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x18]
mov dword [eax + 8], ecx
test ebx, ebx
je 0x523095
mov eax, dword [ebx]
test eax, eax
je 0x523088
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
xor ebx, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0xf8], ebx
push 0x5bf560
lea ecx, [esp + 0x100]
call fcn.00403a70
mov byte [esp + 0x3a4], 3
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx]
cmp eax, dword [ecx + 4]
je 0x523196
push 0x5a8400
lea ecx, [esp + 0x100]
call fcn.00403b70
push 0x5a8408
lea ecx, [esp + 0x100]
call fcn.00403b70
mov eax, dword [esp + 0x20]
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
mov eax, 0x2aaaaaab
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
je 0x523196
mov ebx, dword [esp + 0x20]
xor edi, edi
xor esi, esi
mov eax, dword [ebx]
add eax, edi
cmp dword [eax + 0x10], 0
lea ecx, [eax + 0x18]
mov dword [esp + 0x34], ecx
je 0x523169
cmp dword [ecx + 0x10], 0
je 0x523169
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x108]
call fcn.004047c0
push 1
push 0x5a841c
lea ecx, [esp + 0x104]
call fcn.00404880
push 0xffffffffffffffff
push 0
push dword [esp + 0x3c]
lea ecx, [esp + 0x108]
call fcn.004047c0
push 1
push 0x5a8420
lea ecx, [esp + 0x104]
call fcn.00404880
mov ecx, dword [ebx + 4]
mov eax, 0x2aaaaaab
sub ecx, dword [ebx]
inc esi
imul ecx
add edi, 0x30
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jb 0x523107
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0xf4]
mov ebx, dword [esp + 0x2c]
push 4
push 0x5a8424
lea ecx, [esp + 0x104]
call fcn.00404880
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push esi
call ebp
mov byte [esp + 0x3a4], 4
lea eax, [esp + 0xfc]
push dword [esp + 0x3b4]
cmp dword [esp + 0x114], 8
push dword [esp + 0xf4]
cmovae eax, dword [esp + 0x104]
push dword [esp + 0x114]
push eax
push dword [esp + 0x28]
call fcn.004bacc0
mov ecx, eax
call fcn.004baf00
test eax, eax
je 0x5238ee
mov byte [esp + 0x3a4], 3
push 0
push esi
call ebp
mov eax, dword [esp + 0x28]
cmp dword [eax + 0x14], 0x10
mov dword [eax + 0x10], 0
jb 0x523224
mov eax, dword [eax]
mov byte [eax], 0
jmp 0x523230
mov dword [esp + 0x114], 0
mov dword [esp + 0xf0], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push esi
call ebp
mov byte [esp + 0x3a4], 7
lea eax, [esp + 0x114]
push eax
push ecx
lea eax, [esp + 0x19c]
push eax
push dword [esp + 0x24]
call fcn.004bacc0
mov ecx, eax
call fcn.004bb340
test eax, eax
je 0x5238ee
push 0
push esi
call ebp
mov eax, dword [esp + 0x114]
cmp eax, 0x200
jae 0x5238fb
test eax, eax
je 0x5232b2
mov ecx, dword [esp + 0x28]
push eax
mov byte [esp + eax + 0x198], 0
lea eax, [esp + 0x198]
push eax
call fcn.00403f10
mov byte [esp + 0x3a4], 3
push 0
push esi
call ebp
cmp dword [esp + 0x114], 0
ja 0x523230
mov ebx, dword [esp + 0x20]
push dword [esp + 0xf0]
push ecx
mov edx, dword [ebx + 4]
mov ecx, dword [ebx]
call fcn.004057e0
mov eax, dword [ebx]
xor ecx, ecx
mov dword [ebx + 4], eax
mov edx, 2
mov eax, 0x201
mov ebx, 0x200
mul edx
mov dword [esp + 0xb8], ebx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00560e4f
add esp, 0xc
mov dword [esp + 0x118], 0
mov edi, eax
nop
xor eax, eax
mov word [edi], ax
mov eax, dword [esp + 0x118]
mov dword [esp + 0xb0], ebx
mov dword [esp + 0xf0], eax
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push esi
call ebp
mov byte [esp + 0x3a4], 9
lea eax, [esp + 0x118]
push eax
lea eax, [esp + 0xb4]
push eax
push edi
push ecx
push dword [esp + 0x28]
call fcn.004bacc0
mov ecx, eax
call fcn.004bae60
test eax, eax
setne byte [esp + 0x1f]
mov byte [esp + 0x3a4], 3
push 0
push esi
call ebp
cmp byte [esp + 0x1f], 0
jne 0x5233eb
cmp dword [esp + 0xb0], ebx
jbe 0x52386f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x52386f
mov ebx, dword [esp + 0xb0]
push edi
inc ebx
call fcn.0056503c
xor ecx, ecx
lea eax, [ebx + 1]
add esp, 4
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00560e4f
mov edi, eax
add esp, 4
mov eax, dword [esp + 0xf0]
mov dword [esp + 0x118], eax
jmp 0x523320
mov eax, dword [esp + 0xb0]
cmp eax, ebx
ja 0x523320
xor ecx, ecx
mov word [edi + eax*2], cx
lea ecx, [esp + 0x11c]
push edi
call fcn.00403a70
mov byte [esp + 0x3a4], 0xa
cmp dword [esp + 0x12c], 0
je 0x523829
xor eax, eax
mov dword [esp + 0x15c], 0
mov dword [esp + 0x160], 0
mov dword [esp + 0x160], 7
mov dword [esp + 0x15c], 0
mov word [esp + 0x14c], ax
mov byte [esp + 0x3a4], 0xb
mov dword [esp + 0x144], eax
mov dword [esp + 0x148], eax
mov dword [esp + 0x148], 7
mov dword [esp + 0x144], eax
mov word [esp + 0x134], ax
mov byte [esp + 0x3a4], 0xc
lea ecx, [esp + 0x11c]
push 1
push eax
lea eax, [esp + 0xf8]
mov dword [esp + 0xf8], 0x3d
push eax
call fcn.00404390
mov dword [esp + 0xf0], eax
cmp eax, 0xffffffff
je 0x523548
push eax
push 0
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x128]
call fcn.00403c50
mov byte [esp + 0x3a4], 0xd
lea ecx, [esp + 0x14c]
push eax
call fcn.00403b00
mov byte [esp + 0x3a4], 0xc
lea ecx, [esp + 0x38]
call fcn.00403b40
mov eax, dword [esp + 0xf0]
inc eax
cmp eax, dword [esp + 0x12c]
jae 0x523548
push 0xffffffffffffffff
push eax
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x128]
call fcn.00403c50
mov byte [esp + 0x3a4], 0xe
lea ecx, [esp + 0x11c]
push eax
call fcn.00403b00
mov byte [esp + 0x3a4], 0xc
lea ecx, [esp + 0x50]
call fcn.00403b40
push 1
push 0
lea eax, [esp + 0xf8]
mov dword [esp + 0xf8], 0x3b
push eax
lea ecx, [esp + 0x128]
call fcn.00404390
cmp eax, 0xffffffff
je 0x5235ac
push eax
push 0
lea eax, [esp + 0x70]
push eax
lea ecx, [esp + 0x128]
call fcn.00403c50
mov byte [esp + 0x3a4], 0xf
lea ecx, [esp + 0x134]
push eax
call fcn.00403b00
mov byte [esp + 0x3a4], 0xc
lea ecx, [esp + 0x68]
call fcn.00403b40
jmp 0x5235c4
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x124]
push eax
lea ecx, [esp + 0x140]
call fcn.00404960
mov edx, 0x5a8430
lea ecx, [esp + 0x14c]
call fcn.004afdd0
mov edx, 0x5a8430
lea ecx, [esp + 0x14c]
call fcn.004afe40
mov edx, 0x5a8430
lea ecx, [esp + 0x134]
call fcn.004afdd0
mov edx, 0x5a8430
lea ecx, [esp + 0x134]
call fcn.004afe40
cmp dword [esp + 0x15c], 0
je 0x523801
cmp dword [esp + 0x144], 0
je 0x523801
push 0x5bf5e0
lea ecx, [esp + 0x180]
call fcn.00403a70
mov byte [esp + 0x3a4], 0x10
lea eax, [esp + 0x134]
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x188]
call fcn.004047c0
push 0x3c
lea eax, [esp + 0xb8]
push 0
push eax
call fcn.0056cbb0
mov ebp, dword [esp + 0x198]
xor ecx, ecx
add esp, 0xc
mov dword [esp + 0xb4], 0x3c
mov edx, 2
lea eax, [ebp + 0x20]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00560e4f
add esp, 4
mov dword [esp + 0xe8], eax
lea ecx, [ebp*2 + 0x40]
push ecx
push 0
push eax
call fcn.0056cbb0
add esp, 0xc
mov dword [esp + 0x34], esi
lea eax, [ebp + 0x1f]
mov dword [esp + 0xec], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov byte [esp + 0x3a4], 0x11
lea ecx, [esp + 0xb4]
cmp dword [esp + 0x190], 8
lea eax, [esp + 0x17c]
push ecx
cmovae eax, dword [esp + 0x180]
push ecx
push dword [esp + 0x194]
push eax
call fcn.004bacc0
mov ecx, eax
call fcn.004bb0c0
mov ebp, eax
mov byte [esp + 0x3a4], 0x10
push 0
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test ebp, ebp
je 0x523796
push dword [esp + 0xe8]
lea ecx, [esp + 0x168]
call fcn.00403a70
mov byte [esp + 0x3a4], 0x12
cmp dword [esp + 0x174], 0
je 0x523782
cmp dword [esp + 0x178], 8
lea eax, [esp + 0x164]
lea ecx, [esp + 0x164]
cmovae eax, dword [esp + 0x164]
push eax
lea eax, [esp + 0x2c]
push eax
call fcn.00403bb0
lea eax, [esp + 0x164]
push eax
lea ecx, [esp + 0x138]
call fcn.00403c20
mov byte [esp + 0x3a4], 0x10
lea ecx, [esp + 0x164]
call fcn.00403b40
push dword [esp + 0xe8]
call fcn.0056503c
add esp, 4
lea eax, [esp + 0x134]
lea ecx, [esp + 0x80]
push eax
lea eax, [esp + 0x150]
push eax
call fcn.004050e0
mov byte [esp + 0x3a4], 0x13
mov ecx, dword [esp + 0x20]
push eax
call fcn.00403cd0
mov byte [esp + 0x3a4], 0x10
lea ecx, [esp + 0x80]
call fcn.00402bd0
mov byte [esp + 0x3a4], 0xc
lea ecx, [esp + 0x17c]
call fcn.00403b40
mov ebp, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov byte [esp + 0x3a4], 0xb
lea ecx, [esp + 0x134]
call fcn.00403b40
mov byte [esp + 0x3a4], 0xa
lea ecx, [esp + 0x14c]
call fcn.00403b40
mov byte [esp + 0x3a4], 3
cmp dword [esp + 0x130], 8
jb 0x52384a
push dword [esp + 0x11c]
call fcn.00564de3
add esp, 4
xor eax, eax
mov dword [esp + 0x130], 7
mov dword [esp + 0x12c], 0
mov word [esp + 0x11c], ax
jmp 0x523320
xor eax, eax
push edi
mov word [edi], ax
call fcn.0056503c
add esp, 4
mov byte [esp + 0x3a4], 2
lea ecx, [esp + 0xfc]
call fcn.00403b40
mov byte [esp + 0x3a4], 0
mov ebx, dword [esp + 0x2c]
mov edi, dword [esp + 0xf4]
test ebx, ebx
je 0x5238c0
mov eax, dword [ebx]
test eax, eax
je 0x5238b5
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0xf8], 0
mov dword [esp + 0x3a4], 0xffffffff
test edi, edi
je 0x5238e7
mov eax, dword [edi]
test eax, eax
je 0x5238dc
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0xf4], 0
mov al, 1
jmp 0x523991
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x30]
mov dword [ecx + 0xc], eax
mov byte [esp + 0x3a4], 3
push 0
push esi
call ebp
mov byte [esp + 0x3a4], 2
cmp dword [esp + 0x110], 8
jb 0x523929
push dword [esp + 0xfc]
call fcn.00564de3
add esp, 4
xor eax, eax
mov dword [esp + 0x110], 7
mov dword [esp + 0x10c], eax
mov word [esp + 0xfc], ax
mov byte [esp + 0x3a4], al
test ebx, ebx
je 0x523968
mov eax, dword [ebx]
test eax, eax
je 0x52395d
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0xf8], 0
mov dword [esp + 0x3a4], 0xffffffff
test edi, edi
je 0x52398f
mov eax, dword [edi]
test eax, eax
je 0x523984
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0xf4], 0
xor al, al
mov ecx, dword [esp + 0x39c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x380]
xor ecx, esp
call fcn.00564de8
add esp, 0x394
ret 0x1c