Function at 0x40aa60
Capabilities:
Create thread

Disassembly:
sub esp, 0x10
push ebx
push esi
mov esi, ecx
xor ebx, ebx
cmp dword [esi + 0x40], ebx
jne 0x40aa7b
pop esi
mov eax, 0x80004005
pop ebx
add esp, 0x10
ret 8
push edi
lea edi, [esi + 0x14]
push edi
mov dword [esp + 0x18], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0xc]
mov ecx, dword [esp + 0x20]
mov byte [esp + 0x18], 1
cmp ecx, eax
jne 0x40aaac
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 8
cmp ecx, eax
push ebp
mov dword [esp + 0x24], ebx
jge 0x40abe1
sub eax, ecx
mov ebp, eax
cmp ebp, ebx
mov dword [esp + 0x10], ebp
jle 0x40ab98
lea esp, [esp]
mov eax, dword [esi + 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
push 1
lea edi, [esi + 0x38]
push edi
call ebx
mov ecx, dword [esi + 0x40]
push 0xffffffffffffffff
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
mov edx, dword [esp + 0x28]
mov eax, dword [esi + 0x3c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x40ab3d
push 0
push edi
call ebx
test eax, eax
je 0x40ab41
push 0x102
call fcn.00401490
mov ecx, dword [esp + 0x1c]
add esp, 4
push ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebp
pop edi
mov eax, esi
pop esi
pop ebx
add esp, 0x10
ret 8
test eax, eax
jne 0x40abab
lea eax, [esi + 0x10]
lea edi, [esi + 4]
push eax
mov ecx, edi
call fcn.004082d0
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40ab83
push ebx
mov ecx, edi
call fcn.004072f0
mov ebp, dword [eax]
push 0xea60
push ebp
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40abc9
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
mov ecx, edi
call fcn.00407230
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
inc eax
cmp eax, ebp
mov dword [esp + 0x24], eax
jl 0x40aad0
mov edi, dword [esp + 0x18]
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebp
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x10
ret 8
call fcn.00401470
mov edx, dword [esp + 0x18]
push edx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebp
pop edi
mov eax, esi
pop esi
pop ebx
add esp, 0x10
ret 8
lea ecx, [esp + 0x18]
call fcn.00406260
pop ebp
pop edi
pop esi
mov eax, 0x80004005
pop ebx
add esp, 0x10
ret 8
sub ecx, eax
cmp ecx, ebx
mov dword [esp + 0x14], ecx
jle 0x40ab98
mov ebx, dword [esp + 0x28]
mov ebp, dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [esi + 0x3c]
push eax
call ebp
mov eax, dword [esi + 0x2c]
lea ecx, [esp + 0x10]
push ecx
push 0
push esi
push 0x40aa50
push eax
push 0
call fcn.00411ce8
mov edi, eax
add esp, 0x18
mov dword [esp + 0x28], edi
test edi, edi
je 0x40ac64
mov eax, dword [esi + 0x3c]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x40ac82
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x14]
push eax
lea ecx, [esi + 4]
mov dword [esp + 0x30], edi
call fcn.00403280
test eax, eax
jne 0x40ac50
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x24]
inc eax
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x24], eax
jl 0x40abf5
jmp 0x40ab94
call fcn.00401470
mov ecx, dword [esp + 0x18]
push ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop ebp
pop edi
mov eax, esi
pop esi
pop ebx
add esp, 0x10
ret 8
cmp eax, 0x102
jne 0x40acaa
lea ecx, [esp + 0x28]
call fcn.00407d70
lea ecx, [esp + 0x18]
call fcn.00406260
pop ebp
pop edi
pop esi
mov eax, 0x80070102
pop ebx
add esp, 0x10
ret 8
call fcn.00401470
lea ecx, [esp + 0x28]
mov esi, eax
call fcn.00407d70
lea ecx, [esp + 0x18]
call fcn.00406260
pop ebp
pop edi
mov eax, esi
pop esi
pop ebx
add esp, 0x10
ret 8