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

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0xc]
test eax, eax
mov dword [esp + 0x10], eax
jne 0x101585b5
mov dword [esi + 0x34], 0xf0000001
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0xc
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
lea ecx, [esi + 0x10]
call fcn.10187f90
cmp eax, 0x24
jae 0x101585dc
mov dword [esi + 0x34], 0xf0000005
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret 0xc
mov eax, dword [esi + 0x2c]
push 2
push eax
call fcn.10157140
mov ebp, eax
add esp, 8
test ebp, ebp
jne 0x10158601
mov dword [esi + 0x34], 0xf0000002
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0xc
mov ecx, dword [esi + 0x28]
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], ebp
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [esp + 0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov dword [esp + 0x14], eax
mov edx, dword [esi + 4]
push edi
lea eax, [esp + 0x1c]
push 0
push eax
push 3
mov dword [esp + 0x30], edx
call ebx
cmp eax, 2
jne 0x1015869d
mov ecx, dword [esp + 0x10]
push edi
lea edx, [esp + 0x1c]
push 0
push edx
push 3
mov dword [esp + 0x30], ecx
call ebx
cmp eax, 2
jne 0x101586e9
lea ecx, [esi + 0x10]
call fcn.10187fa0
cmp eax, 0x24
jae 0x1015875f
mov eax, dword [esi + 4]
test eax, eax
je 0x1015867e
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x14]
cmp eax, edi
ja 0x1015873e
jmp 0x1015862a
cmp eax, 1
mov ebx, 0xf0000003
jne 0x101586b0
mov dword [esi + 0x34], 0xf0000002
jmp 0x101586c3
cmp eax, 0x102
jne 0x101586bc
mov dword [esi + 0x34], ebx
jmp 0x101586c3
mov dword [esi + 0x34], 0xf0000001
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esi + 0x34], ebx
je 0x10158732
mov ecx, esi
call fcn.10158510
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret 0xc
cmp eax, 1
mov ebx, 0xf0000003
jne 0x101586fc
mov dword [esi + 0x34], 0xf0000002
jmp 0x1015870f
cmp eax, 0x102
jne 0x10158708
mov dword [esi + 0x34], ebx
jmp 0x1015870f
mov dword [esi + 0x34], 0xf0000001
mov edi, dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x10]
push ecx
call edi
cmp dword [esi + 0x34], ebx
je 0x10158732
mov ecx, esi
call fcn.10158510
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret 0xc
push ebp
mov dword [esi + 0x34], 0xf0000003
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x28]
lea ebp, [esi + 0x10]
push 0x24
push edi
mov ecx, ebp
call fcn.10187de0
mov ecx, ebp
mov dword [esp + 0x30], eax
call fcn.10187fa0
cmp dword [edi + 0x20], eax
jbe 0x10158798
mov ecx, ebp
call fcn.10187fa0
mov dword [edi + 0x20], eax
mov eax, dword [edi + 0x20]
test eax, eax
jbe 0x101587ca
mov ebx, dword [esp + 0x2c]
test ebx, ebx
je 0x101587bd
push eax
call fcn.1006390e
add esp, 4
mov dword [ebx], eax
test eax, eax
je 0x101587bd
mov edx, dword [edi + 0x20]
push edx
push eax
jmp 0x101587c3
mov eax, dword [edi + 0x20]
push eax
push 0
mov ecx, ebp
call fcn.10187de0
mov edi, dword [esp + 0x30]
test edi, edi
jle 0x101587e0
mov eax, dword [esi + 8]
test eax, eax
je 0x101587e0
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, ebp
call fcn.10187fa0
test eax, eax
jne 0x101587f9
mov eax, dword [esi + 4]
test eax, eax
je 0x101587f9
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
mov dword [esi + 0x34], 0
test edi, edi
pop edi
pop esi
pop ebp
pop ebx
setg al
add esp, 0x14
ret 0xc