Function at 0x402ea4
Capabilities:
Create thread
Resume thread

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
push ebx
push ecx
push edx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x14], ebx
call fcn.00401428
cmp dword [0x407f4c], 0
je 0x402ec9
cmp eax, 4
jb 0x402ec9
shr eax, 1
mov dword [ebp - 0x20], eax
push 0
push 0
push dword [0x408084]
call fcn.00402cf8
mov ebx, eax
test ebx, ebx
jne 0x402ee6
jmp 0x4030b8
lea eax, [ebx*2]
push eax
call fcn.00401fb8
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x402f01
jmp 0x4030b8
push dword [ebp - 0x14]
push ebx
push dword [0x408084]
call fcn.00402cf8
mov ebx, eax
test ebx, ebx
jne 0x402f1b
jmp 0x4030b8
shr ebx, 2
lea eax, [ebx*4]
push eax
call fcn.00401fb8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x402f39
jmp 0x4030b8
lea eax, [ebx*4]
push eax
call fcn.00401fb8
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x402f54
jmp 0x4030b8
mov dword [0x407f18], 0
mov dword [0x407f1c], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 0x18]
push esi
push dword [0x408084]
call fcn.00402db8
cmp eax, 3
je 0x402f92
cmp eax, 2
jne 0x402ff1
push esi
call fcn.004020d4
mov dword [ebp - 0x10], eax
push 0
push 0
push dword [ebp - 0x10]
push fcn.00403cfc
push 0
push 0
call sub.KERNEL32.dll_CreateThread
test eax, eax
je 0x402fef
mov ecx, dword [ebp - 8]
lea ecx, [edi + ecx*4]
mov dword [ecx], eax
inc dword [ebp - 8]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0x20]
cmp dword [ebp - 0xc], eax
jne 0x402fef
push 0xffffffffffffffff
push 0
push dword [ebp - 0x18]
push dword [ebp - 0xc]
call sub.KERNEL32.dll_WaitForMultipleObjects
mov dword [ebp - 8], eax
mov ecx, dword [edi + eax*4]
mov dword [edi + eax*4], 0
push ecx
call sub.ntdll.dll_NtClose
dec dword [ebp - 0xc]
jmp 0x403053
cmp eax, 4
jne 0x403053
push esi
call fcn.004020d4
mov dword [ebp - 0x10], eax
push 0
push 4
push dword [ebp - 0x10]
push fcn.00403cfc
push 0
push 0
call sub.KERNEL32.dll_CreateThread
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x403053
push dword [ebp - 4]
push dword [0x408084]
call fcn.00402b9c
test eax, eax
jne 0x403043
push 0
push dword [ebp - 4]
call sub.ntdll.dll_NtTerminateThread
push dword [ebp - 4]
call sub.ntdll.dll_NtClose
jmp 0x403053
push dword [ebp - 4]
call sub.KERNEL32.dll_ResumeThread
mov eax, dword [ebp - 4]
jmp 0x402fb4
add esi, 8
dec ebx
test ebx, ebx
jne 0x402f7c
cmp dword [ebp - 0xc], 0
je 0x40309a
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
lodsd eax, dword [esi]
test eax, eax
je 0x403075
stosd dword es:[edi], eax
dec ebx
test ebx, ebx
jne 0x40306e
push 0xffffffffffffffff
push 1
push dword [ebp - 0x1c]
push dword [ebp - 0xc]
call sub.KERNEL32.dll_WaitForMultipleObjects
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x1c]
lodsd eax, dword [esi]
push eax
call sub.ntdll.dll_NtClose
dec ebx
test ebx, ebx
jne 0x40308e
lea ecx, [0x407f1c]
mov eax, dword [0x407f18]
mov edx, eax
lock cmpxchg dword [ecx], edx
jne 0x4030af
jmp 0x4030b8
push 0x64
call sub.KERNEL32.dll_Sleep
jmp 0x40309a
cmp dword [ebp - 0x1c], 0
je 0x4030c6
push dword [ebp - 0x1c]
call fcn.00401ff4
cmp dword [ebp - 0x18], 0
je 0x4030d4
push dword [ebp - 0x18]
call fcn.00401ff4
cmp dword [ebp - 0x14], 0
je 0x4030e2
push dword [ebp - 0x14]
call fcn.00401ff4
pop edi
pop esi
pop edx
pop ecx
pop ebx
mov esp, ebp
pop ebp
ret