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

Disassembly:
mov eax, 0x2009eb7d
call fcn.2007d394
sub esp, 0x114
mov eax, dword [0x200cc84c]
push ebx
xor eax, ebp
push esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0x10], eax
mov ebx, ecx
and dword [ebp - 4], 0
test esi, esi
je 0x20041329
mov eax, dword [ebp + 8]
test eax, eax
je 0x20041329
cmp byte [eax + 0x1e4], 0
jne 0x20041325
lea ecx, [eax + 0xb4]
call fcn.200342ea
test eax, eax
je 0x20041325
mov eax, dword [ebp + 8]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0xe0], eax
call edi
mov ecx, dword [ebp - 0xe0]
sub eax, dword [ecx + 0x214]
cmp eax, 0x3e8
jae 0x20040f02
xor esi, esi
jmp 0x20041314
call edi
sub eax, dword [esi + 0x88]
cmp eax, 0xea60
jbe 0x20040f17
cmp dword [ebp + 0x14], 0
jne 0x20040efb
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x21c]
cmp ecx, dword [esi + 0x18]
jne 0x20040f5e
mov ecx, esi
mov dword [ebp - 0xe0], eax
call fcn.2001a4f4
mov ecx, dword [ebp - 0xe0]
cmp eax, dword [ecx + 0x214]
jae 0x20040f5e
mov eax, dword [ebp + 8]
mov dword [ebp - 0xe0], eax
call edi
mov ecx, dword [ebp - 0xe0]
sub eax, dword [ecx + 0x214]
cmp eax, 0x1770
jb 0x20040efb
push 0xc8
lea eax, [ebp - 0xd8]
push eax
lea ecx, [ebp - 0xfc]
call fcn.200030b0
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0xf8]
xor edi, edi
mov dword [ebp - 0xf4], eax
push edi
lea ecx, [ebp - 0xfc]
mov byte [eax], 0
call fcn.200012d7
push 0x43
lea ecx, [ebp - 0xfc]
call fcn.20001294
push edi
lea ecx, [ebp - 0xfc]
call fcn.200012d7
push 0x89
lea ecx, [ebp - 0xfc]
call fcn.20001294
mov eax, dword [ebp - 0xf4]
push edi
lea ecx, [ebp - 0xfc]
mov dword [ebp - 0x120], eax
call fcn.200012d7
mov eax, dword [ebp - 0xf4]
push dword [ebx + 0x10b14]
lea ecx, [ebp - 0xfc]
mov dword [ebp - 0xe0], eax
call fcn.2000133b
cmp dword [ebx + 0x2a0], edi
mov byte [ebp - 0xdc], 0
je 0x2004100a
mov byte [ebp - 0xdc], 0x80
mov eax, dword [ebx + 0x548]
cmp eax, edi
je 0x2004101b
or byte [ebp - 0xdc], 0x40
cmp byte [ebx + 0x10e58], 1
jne 0x2004102b
or byte [ebp - 0xdc], 0x20
cmp dword [ebx + 0x2a4], 2
jl 0x2004103b
or byte [ebp - 0xdc], 0x10
push dword [ebp - 0xdc]
lea ecx, [ebp - 0xfc]
call fcn.20001294
xor al, al
cmp dword [ebp + 0x14], edi
je 0x20041055
mov al, 0x80
cmp byte [esi + 0x21], 0
je 0x2004105d
or al, 0x40
or al, 2
mov byte [ebp - 0xdc], al
push dword [ebp - 0xdc]
lea ecx, [ebp - 0xfc]
call fcn.20001294
lea eax, [ebp - 0x118]
push eax
lea eax, [ebp - 0xdc]
push eax
lea eax, [ebp - 0x10c]
push eax
lea eax, [ebp - 0x104]
push eax
mov ecx, ebx
call fcn.2003aeb9
lea eax, [ebp - 0x114]
push eax
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x11c]
push eax
mov ecx, ebx
call fcn.2003c6df
mov eax, dword [esi + 8]
inc dword [eax + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [esi + 0x18]
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push dword [esi + 0x10]
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push dword [esi + 0xc]
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push dword [ebx + 0x10f8c]
lea ecx, [ebp - 0xfc]
call fcn.2000133b
mov eax, dword [ebp + 8]
cmp word [eax + 0x1dc], 1
ja 0x20041159
cmp word [eax + 0x1de], di
ja 0x20041159
cmp word [eax + 0x1e0], di
ja 0x20041159
cmp word [eax + 0x1e2], 0x86e
ja 0x20041159
push edi
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push edi
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push edi
lea ecx, [ebp - 0xfc]
call fcn.2000133b
push edi
lea ecx, [ebp - 0xfc]
call fcn.2000133b
jmp 0x2004116a
push 0x10
lea eax, [esi + 0x44]
push eax
lea ecx, [ebp - 0xfc]
call fcn.20001383
mov eax, dword [ebp - 0xdc]
shr eax, 0xa
push eax
lea ecx, [ebp - 0xfc]
call fcn.200012d7
mov eax, dword [ebp - 0x118]
shr eax, 0xa
push eax
lea ecx, [ebp - 0xfc]
call fcn.200012d7
push edi
mov edi, 0x400
push edi
push dword [ebp - 0x100]
push dword [ebp - 0x104]
call fcn.2007c9c0
mov dword [ebp - 0x104], eax
mov dword [ebp - 0x100], edx
fild qword [ebp - 0x104]
push ecx
lea ecx, [ebp - 0xfc]
fstp dword [esp]
call fcn.2000133b
push 0
push edi
push dword [ebp - 0x108]
push dword [ebp - 0x10c]
call fcn.2007c9c0
mov dword [ebp - 0x10c], eax
mov dword [ebp - 0x108], edx
fild qword [ebp - 0x10c]
push ecx
lea ecx, [ebp - 0xfc]
fstp dword [esp]
call fcn.2000133b
push dword [ebp - 0x11c]
lea ecx, [ebp - 0xfc]
call fcn.20001294
push dword [ebp - 0x114]
lea ecx, [ebp - 0xfc]
call fcn.20001294
push dword [ebp - 0x110]
lea ecx, [ebp - 0xfc]
call fcn.20001294
xor eax, eax
mov al, byte [esi + 0x78]
lea ecx, [ebp - 0xfc]
push eax
call fcn.20001294
push 0xff
lea ecx, [ebp - 0xfc]
call fcn.200012d7
push dword [esi + 0xb0]
lea ecx, [ebp - 0xfc]
call fcn.2000133b
mov edi, dword [esi + 8]
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
dec dword [edi + 0x18]
mov eax, dword [ebp - 0xf4]
sub eax, dword [ebp - 0xe0]
push 0x18
push eax
push dword [ebp - 0xe0]
call fcn.2001762c
mov ecx, dword [ebp - 0x120]
mov word [ecx], ax
mov ecx, dword [ebp - 0xf8]
mov eax, dword [ebp - 0xf4]
sub eax, ecx
add esp, 0xc
lea edx, [eax - 4]
mov word [ecx], dx
movzx edi, ax
mov eax, dword [ebp + 8]
xor ecx, ecx
mov cx, word [eax + 0xb8]
push ecx
push dword [eax + 0xb4]
push edi
push dword [ebp - 0xf8]
lea ecx, [ebx + 0x10b5c]
call fcn.2007625c
test eax, eax
je 0x20041303
mov ebx, dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebx + 0x214], eax
mov ecx, dword [ebp + 8]
mov eax, dword [esi + 0x18]
mov dword [ecx + 0x21c], eax
mov ecx, dword [ebp + 8]
push edi
call fcn.20020954
xor esi, esi
inc esi
jmp 0x20041305
xor esi, esi
mov byte [ebp - 4], 0
lea ecx, [ebp - 0xfc]
call fcn.200030f4
pop edi
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.20001efb
mov eax, esi
jmp 0x20041337
xor esi, esi
jmp 0x20041315
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 8]
call fcn.20001efb
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop esi
xor ecx, ebp
pop ebx
call fcn.2007c9ae
leave
ret 0x10