Function at 0x10018620
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0x40], 0
mov ebx, eax
je 0x1001878b
lea esi, [edi + 0x14]
push esi
mov dword [esp + 0x24], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0xc]
cmp ebx, eax
je 0x10018751
mov dword [esp + 0x10], 0
jge 0x100187aa
sub eax, ebx
mov dword [esp + 0x14], eax
test eax, eax
jle 0x10018751
mov eax, dword [edi + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push 1
lea ebx, [edi + 0x38]
push ebx
call esi
mov ecx, dword [edi + 0x40]
push 0xffffffffffffffff
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
mov edx, dword [ebp + 8]
mov eax, dword [edi + 0x3c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x100186d7
push 0
push ebx
call esi
test eax, eax
je 0x100186df
mov eax, 0x102
call fcn.1001bf80
mov ecx, dword [esp + 0x20]
push ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
test eax, eax
jne 0x10018763
mov ecx, dword [edi + 0xc]
xor esi, esi
test ecx, ecx
jle 0x1001873a
mov edx, dword [edi + 0x10]
mov eax, dword [edi + 4]
mov edi, edi
cmp dword [eax], edx
je 0x100186fe
inc esi
add eax, 4
cmp esi, ecx
jl 0x100186f0
jmp 0x1001873a
cmp esi, 0xffffffff
je 0x1001873a
test esi, esi
js 0x10018799
cmp esi, ecx
jge 0x10018799
mov eax, dword [edi + 8]
mov ebx, dword [eax + esi*4]
push 0xea60
push ebx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x10018780
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
lea esi, [edi + 4]
call fcn.10019300
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
cmp eax, dword [esp + 0x14]
jl 0x1001866f
mov esi, dword [esp + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
call fcn.1001bf90
mov edx, dword [esp + 0x20]
push edx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 0x80004005
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0
push 0
push 1
push 0xc000008c
call dword [sym.imp.KERNEL32.dll_RaiseException]
sub ebx, eax
mov dword [esp + 0x1c], ebx
test ebx, ebx
jle 0x10018751
mov ecx, dword [edi + 0x3c]
push ecx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [edi + 0x2c]
lea edx, [esp + 0x18]
push edx
push 0
push edi
push 0x100193b0
push eax
push 0
call fcn.1011d9a7
mov ebx, eax
add esp, 0x18
test ebx, ebx
je 0x10018837
mov ecx, dword [ebp + 8]
mov eax, dword [edi + 0x3c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x10018850
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x1c]
lea esi, [edi + 4]
push eax
mov dword [esp + 0x1c], ebx
call fcn.10019290
test eax, eax
jne 0x10018812
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x20]
inc eax
mov dword [esp + 0x10], eax
cmp eax, dword [esp + 0x1c]
jl 0x100187b4
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
call fcn.1001bf90
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp eax, 0x102
jne 0x10018873
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, 0x80070102
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
call fcn.1001bf90
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4