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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dabb8
mov eax, dword fs:[0]
push eax
sub esp, 0x38
push ebx
push esi
push edi
mov eax, dword [0x5181f4]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, ecx
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov dword [ebp - 0x44], eax
push 1
lea eax, [esi + 0x14]
push eax
mov ebx, 0x4e20
mov byte [ebp - 0x11], 0
call edi
mov ecx, dword [esi]
test ecx, ecx
je 0x4979c5
mov edx, dword [esi]
mov eax, dword [edx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 1
lea eax, [esi + 8]
push eax
call edi
mov ecx, dword [esi]
test ecx, ecx
je 0x4979b0
mov edx, dword [esi]
mov eax, dword [edx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0
push 1
mov ecx, esi
call fcn.00496710
test al, al
je 0x49775f
cmp byte [ebp - 0x11], 0
jne 0x49775f
push 1
lea edi, [esi + 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [esi]
test eax, eax
je 0x4978ca
mov ecx, dword [esi]
mov eax, dword [ecx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 2
lea edx, [esi + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [esi]
test eax, eax
je 0x4978b5
mov ecx, dword [esi]
mov eax, dword [ecx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x4e20
push 3
mov ecx, esi
call fcn.00496710
test al, al
jne 0x49779f
push 0
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov edx, dword [esi]
test edx, edx
je 0x49778a
mov eax, dword [esi]
mov eax, dword [eax]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp ebx, 0xffffffff
je 0x4978eb
test ebx, ebx
je 0x4978eb
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x44]
sub eax, ecx
cmp eax, ebx
jb 0x4978df
xor ecx, ecx
jmp 0x4978ed
push 0x50e8bc
lea edx, [ebp - 0x20]
push edx
mov dword [ebp - 0x20], str.uninitialized_holder_used
call fcn.0044661f
xor ebx, ebx
push 4
mov dword [ebp - 4], ebx
call fcn.00441e44
add esp, 4
cmp eax, ebx
je 0x4977b8
mov dword [eax], esi
mov edi, eax
jmp 0x4977ba
xor edi, edi
cmp edi, ebx
mov dword [ebp - 0x1c], ebx
je 0x4977df
push 8
call fcn.00441e44
add esp, 4
cmp eax, ebx
je 0x4977da
mov dword [eax], edi
mov dword [eax + 4], 1
jmp 0x4977dc
xor eax, eax
mov dword [ebp - 0x1c], eax
push ebx
push 1
lea eax, [esi + 0x14]
push eax
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, ebx
jne 0x497807
mov ecx, dword [esi]
test ecx, ecx
je 0x497845
mov edx, dword [esi]
mov eax, dword [edx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [esi + 0x18]
test ecx, ecx
je 0x497820
mov edx, dword [esi + 0x18]
cmp dword [edx], ebx
je 0x497820
mov eax, dword [esi + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx]
mov eax, dword [edx]
call eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 0
call fcn.004972f0
mov dword [ebp - 4], 0xffffffff
jmp 0x497895
push 0x50e8bc
lea eax, [ebp - 0x24]
push eax
mov dword [ebp - 0x24], str.uninitialized_holder_used
call fcn.0044661f
mov byte [ebp - 0x11], 1
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x18]
push 0
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], 0
call fcn.004966c0
mov dword [ebp - 4], 0xffffffff
mov eax, 0x4978e5
ret
push 0
push 0
lea ecx, [esi + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x44], eax
mov ebx, edi
jmp 0x49775f
push 0x50e8bc
lea edx, [ebp - 0x28]
push edx
mov dword [ebp - 0x28], str.uninitialized_holder_used
call fcn.0044661f
push 0x50e8bc
lea eax, [ebp - 0x2c]
push eax
mov dword [ebp - 0x2c], str.uninitialized_holder_used
call fcn.0044661f
mov ecx, ebx
sub ecx, eax
jmp 0x4978ed
mov ecx, ebx
push 1
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
cmp eax, 0xc0
je 0x4976d6
push 1
push 0
lea ecx, [esi + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, 1
jne 0x497945
mov edx, dword [esi]
test edx, edx
je 0x497930
mov eax, dword [esi]
mov eax, dword [eax]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x49794e
push 0x50e8bc
lea edx, [ebp - 0x30]
push edx
mov dword [ebp - 0x30], str.uninitialized_holder_used
call fcn.0044661f
cmp eax, 2
je 0x4976d6
push 1
push 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObjectEx]
cmp eax, 0xc0
je 0x4976d6
push 0
lea eax, [esi + 8]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov ecx, dword [esi]
test ecx, ecx
je 0x49799b
mov edx, dword [esi]
mov eax, dword [edx]
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x50e8bc
lea ecx, [ebp - 0x34]
push ecx
mov dword [ebp - 0x34], str.uninitialized_holder_used
call fcn.0044661f
push 0x50e8bc
lea edx, [ebp - 0x38]
push edx
mov dword [ebp - 0x38], str.uninitialized_holder_used
call fcn.0044661f
push 0x50e8bc
lea eax, [ebp - 0x3c]
push eax
mov dword [ebp - 0x3c], str.uninitialized_holder_used
call fcn.0044661f
int3