Function at 0x10004646
Capabilities:
Create thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov esi, ecx
push edi
xor ebx, ebx
lea eax, [esi + 0x18]
mov dword [ebp - 4], ebx
push eax
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 4], ebx
jne 0x10004674
mov dword [ebp + 8], 0x45a
jmp 0x10004760
cmp dword [esi + 8], ebx
jne 0x10004759
cmp dword [esi + 0x54], ebx
jne 0x10004759
cmp word [ebp + 0xc], bx
movzx eax, word [ebp + 0xc]
jne 0x10004695
mov eax, 0x400
push eax
mov ecx, esi
call fcn.10004891
mov eax, dword [ebp + 8]
cmp eax, ebx
jg 0x100046c8
push 8
xor eax, eax
pop ecx
lea edi, [ebp - 0x28]
mov dword [ebp - 0x2c], ebx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x2c]
mov ecx, esi
push eax
call fcn.10004370
mov eax, dword [ebp - 0x18]
cmp eax, ebx
jne 0x100046c6
push 1
pop eax
add eax, eax
mov dword [esi + 0xc], eax
shl eax, 2
push eax
call sub.MFC42.DLL_operatornew
cmp eax, ebx
pop ecx
mov dword [esi + 0x10], eax
jne 0x100046e5
mov dword [ebp + 8], 0xe
jmp 0x10004760
mov ecx, dword [esi + 0xc]
shl ecx, 2
push ecx
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push ebx
push ebx
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
cmp eax, ebx
mov dword [esi + 8], eax
jne 0x10004713
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
jmp 0x10004760
xor edi, edi
cmp dword [esi + 0xc], ebx
jle 0x10004748
lea eax, [ebp - 4]
push eax
push ebx
push esi
push 0x1000446b
push ebx
push ebx
call dword [sym.imp.MSVCRT.dll__beginthreadex]
mov ecx, dword [esi + 0x10]
add esp, 0x18
mov dword [ecx + edi*4], eax
mov eax, dword [esi + 0x10]
cmp dword [eax + edi*4], ebx
je 0x10004744
inc edi
cmp edi, dword [esi + 0xc]
jl 0x1000471a
cmp edi, ebx
jne 0x10004751
mov dword [ebp + 8], 0xa4
jmp 0x10004760
push 1
pop ebx
jmp 0x100047f1
mov dword [ebp + 8], 0x4df
cmp dword [esi + 0x10], ebx
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x100047b3
cmp dword [esi + 0xc], ebx
mov dword [ebp + 0xc], ebx
jle 0x100047a7
mov eax, dword [esi + 0x10]
mov ecx, dword [ebp + 0xc]
mov eax, dword [eax + ecx*4]
cmp eax, ebx
je 0x1000479c
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [esi + 0x10]
mov ecx, dword [ebp + 0xc]
push dword [eax + ecx*4]
call edi
mov eax, dword [esi + 0x10]
mov ecx, dword [ebp + 0xc]
mov dword [eax + ecx*4], ebx
inc dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [esi + 0xc]
jl 0x10004773
push dword [esi + 0x10]
call sub.MFC42.DLL_operatordelete
pop ecx
mov dword [esi + 0x10], ebx
mov eax, dword [esi + 8]
cmp eax, ebx
je 0x100047c0
push eax
call edi
mov dword [esi + 8], ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x50]
cmp eax, ebx
je 0x100047d7
push eax
call sub.MFC42.DLL_operatordelete
pop ecx
mov eax, dword [esi + 0x54]
mov dword [esi + 0x50], ebx
cmp eax, ebx
je 0x100047e8
push eax
call sub.MFC42.DLL_operatordelete
pop ecx
mov dword [esi + 0x54], ebx
mov dword [esi + 0x48], ebx
mov dword [esi + 0x4c], ebx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
mov eax, ebx
pop esi
pop ebx
leave
ret 8