Function at 0x10042afa
Capabilities:
Create thread

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
mov ebx, dword [ebp + 0x10]
xor eax, eax
push esi
push edi
push 8
mov dword [ebp - 0xc], edx
lea edi, [ebp - 0x34]
xor edx, edx
pop ecx
mov dword [ebp - 0x38], edx
mov esi, edx
rep stosd dword es:[edi], eax
mov edi, ebx
mov dword [ebp - 4], esi
shl edi, 2
push edi
push edx
push dword [ebp + 0x14]
mov dword [ebp - 0x10], edx
call sub.msvcrt.dll_memset
add esp, 0xc
mov dword [ebp - 0x38], ebx
xor eax, eax
mov dword [ebp - 0x34], ebx
push eax
push eax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x30], eax
xor eax, eax
push eax
push eax
push 1
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x20], fcn.100425d0
mov dword [ebp - 0x1c], 0x10042660
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x30], esi
je 0x10042cf6
test eax, eax
je 0x10042cf6
push edi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x10042bb9
mov esi, 0x8007000e
mov ecx, 0x10008938
push esi
push 0x238
mov dword [ebp - 4], esi
call fcn.1003a254
jmp 0x10042d47
mov edx, dword [ebp + 0x14]
xor edi, edi
mov ecx, eax
mov dword [ebp - 0x24], eax
sub edx, eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0x14], edx
mov ebx, 0x80070000
mov eax, dword [ebp + 0x10]
cmp edi, eax
jae 0x10042cdd
push ecx
push dword [ebp - 0xc]
call fcn.100424f1
mov esi, eax
mov dword [ebp - 4], esi
test esi, esi
js 0x10042ccb
xor ecx, ecx
lea eax, [ebp - 0x38]
push ecx
push ecx
push eax
push 0x10042a40
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
mov dword [edx + ecx], eax
test eax, eax
je 0x10042c1d
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadIdealProcessor]
jmp 0x10042c6c
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10042c2e
movzx eax, ax
or eax, ebx
test eax, eax
jns 0x10042c46
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 4], esi
test esi, esi
jle 0x10042c50
movzx esi, si
or esi, ebx
jmp 0x10042c4b
mov esi, 0x80004005
mov dword [ebp - 4], esi
test esi, esi
jns 0x10042c62
push esi
push 0x25c
mov ecx, 0x10008938
call fcn.1003a254
mov eax, dword [ebp - 8]
push dword [eax]
call fcn.100425d0
mov ecx, dword [ebp - 8]
inc edi
add ecx, 4
mov dword [ebp - 8], ecx
test esi, esi
jns 0x10042bd0
mov eax, dword [ebp + 0x10]
and dword [ebp - 0x28], 0
test edi, edi
je 0x10042d40
mov ecx, eax
lea edx, [ebp - 0x38]
sub ecx, edi
mov eax, ecx
not eax
inc eax
lock xadd dword [edx], eax
cmp ecx, eax
jne 0x10042caa
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x10042d40
push esi
push 0x247
mov ecx, 0x10008938
call fcn.1003a254
jmp 0x10042c7e
test esi, esi
js 0x10042c81
push 0xffffffffffffffff
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x38]
xchg dword [ecx], eax
jmp 0x10042cb5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, 0x80070000
test eax, eax
jle 0x10042d0c
movzx eax, ax
or eax, ebx
test eax, eax
jns 0x10042d24
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 4], esi
test esi, esi
jle 0x10042d2e
movzx esi, si
or esi, ebx
jmp 0x10042d29
mov esi, 0x80004005
mov dword [ebp - 4], esi
test esi, esi
jns 0x10042d6b
push esi
push 0x22a
mov ecx, 0x10008938
call fcn.1003a254
test esi, esi
jns 0x10042d6b
mov ebx, dword [ebp + 0x10]
xor edi, edi
test ebx, ebx
je 0x10042d6b
mov esi, dword [ebp + 0x14]
cmp dword [esi + edi*4], 0
je 0x10042d63
push dword [esi + edi*4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [esi + edi*4], 0
inc edi
cmp edi, ebx
jb 0x10042d50
mov esi, dword [ebp - 4]
cmp dword [ebp - 0x30], 0
je 0x10042d7a
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x2c], 0
je 0x10042d89
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x10042da0
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10