Function at 0x480eaa
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
mov ebx, ecx
push edi
xor edi, edi
cmp dword [ebx + 0x40], edi
jne 0x480ec6
mov eax, 0x80004005
jmp 0x4810a4
lea eax, [ebx + 0x14]
push eax
mov dword [ebp - 0xc], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [ebx + 0xc]
mov eax, dword [ebp + 8]
cmp eax, esi
je 0x481099
mov dword [ebp - 4], edi
jge 0x480fbd
sub esi, eax
test esi, esi
jle 0x481099
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
xor eax, eax
lea ecx, [ebx + 0x38]
inc eax
xchg dword [ecx], eax
push 0xffffffffffffffff
push edi
push edi
push dword [ebx + 0x40]
call dword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
push dword [ebp + 0xc]
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, 0x102
cmp eax, edx
jne 0x480f3b
xor eax, eax
lea ecx, [ebx + 0x38]
xchg dword [ecx], eax
test eax, eax
je 0x480f3f
mov ecx, edx
call fcn.00480d29
jmp 0x480fb6
test eax, eax
jne 0x480fb1
lea ecx, [ebx + 4]
mov dword [ebp + 8], edi
cmp dword [ecx + 8], edi
jle 0x480f93
mov edx, dword [ecx]
mov eax, dword [ebx + 0x10]
cmp dword [edx], eax
mov eax, dword [ebp + 8]
je 0x480f64
inc eax
add edx, 4
mov dword [ebp + 8], eax
cmp eax, dword [ecx + 8]
jl 0x480f4c
jmp 0x480f93
push eax
call fcn.004810ab
push 0xea60
mov eax, dword [eax]
push eax
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x480fa7
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp + 8]
lea ecx, [ebx + 4]
call fcn.00480d39
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 4], eax
cmp eax, esi
jl 0x480ef4
jmp 0x481099
mov edi, 0x80004005
jmp 0x481099
call fcn.00480e97
mov edi, eax
jmp 0x481099
sub eax, esi
mov dword [ebp + 8], eax
test eax, eax
jle 0x481099
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea eax, [ebp - 8]
push eax
push edi
push ebx
push 0x480e88
push dword [ebx + 0x2c]
push edi
call dword [sym.imp.msvcrt.dll__beginthreadex]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x481087
push dword [ebp + 0xc]
push dword [ebx + 0x3c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x481070
mov eax, dword [ebx + 0xc]
push 4
inc eax
push eax
push dword [ebx + 4]
call fcn.00484c60
add esp, 0xc
test eax, eax
je 0x481057
mov dword [ebx + 4], eax
mov eax, dword [ebx + 0xc]
push 4
inc eax
push eax
push dword [ebx + 8]
call fcn.00484c60
add esp, 0xc
test eax, eax
je 0x481057
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 4]
shl edx, 2
mov dword [ebx + 8], eax
add ecx, edx
je 0x48104c
mov eax, dword [ebp - 8]
mov dword [ecx], eax
mov eax, dword [ebx + 8]
add eax, edx
je 0x481052
mov dword [eax], esi
inc dword [ebx + 0xc]
jmp 0x48105e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 4], eax
cmp eax, dword [ebp + 8]
jl 0x480fca
jmp 0x481099
cmp eax, 0x102
jne 0x48107e
mov edi, 0x80070102
jmp 0x48108e
call fcn.00480e97
mov edi, eax
jmp 0x481092
call fcn.00480e97
mov edi, eax
test esi, esi
je 0x481099
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret 8