Function at 0x100587cc
Capabilities:
Allocate or change rwx memory
Create process on windows
Create process suspended
Enumerate pe sections
Resume thread
Use process replacement

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffea8
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x150], edx
mov dword [ebp - 0x154], edx
mov dword [ebp - 0x158], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x10058ada
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3c]
add eax, dword [ebp - 4]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 4]
call fcn.10058740
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
call fcn.10002a48
mov dword [ebp - 0x1c], eax
xor ecx, ecx
push ebp
push 0x10058aa7
push dword fs:[ecx]
mov dword fs:[ecx], esp
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0x18]
add edx, 0x18
mov ecx, dword [ebp - 0x18]
movzx ecx, word [ecx + 0x14]
add edx, ecx
mov dword [ebp - 0x20], edx
mov edx, dword [ebp - 0x18]
movzx esi, word [edx + 6]
dec esi
test esi, esi
jb 0x1005886e
inc esi
xor ebx, ebx
lea edx, [ebx + ebx*4]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + edx*8 + 0x14]
cmp eax, edx
jbe 0x1005886a
mov eax, edx
inc ebx
dec esi
jne 0x1005885a
mov ecx, eax
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
call fcn.10007120
mov eax, dword [ebp - 0x18]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x54]
call fcn.10058720
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x18]
movzx esi, word [eax + 6]
dec esi
test esi, esi
jb 0x10058919
inc esi
xor ebx, ebx
lea edi, [ebx + ebx*4]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*8 + 0x10]
test eax, eax
jbe 0x100588f0
mov edx, dword [ebp - 0x20]
cmp eax, dword [edx + edi*8 + 8]
jbe 0x100588c2
lea eax, [ebx + ebx*4]
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*8 + 8]
mov edx, dword [ebp - 0x20]
mov edx, dword [edx + edi*8 + 0x14]
add edx, dword [ebp - 4]
mov ecx, eax
mov eax, dword [ebp - 0x14]
call fcn.10007120
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*8 + 8]
mov edx, dword [ebp - 0x18]
mov edx, dword [edx + 0x38]
call fcn.10058720
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
jmp 0x10058915
mov eax, dword [ebp - 0x20]
cmp dword [eax + edi*8 + 8], 0
je 0x10058915
lea eax, [ebx + ebx*4]
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*8 + 8]
mov edx, dword [ebp - 0x18]
mov edx, dword [edx + 0x38]
call fcn.10058720
add eax, dword [ebp - 0x14]
mov dword [ebp - 0x14], eax
inc ebx
dec esi
jne 0x100588a1
lea eax, [ebp - 0x140]
mov edx, 0x44
call fcn.10007128
lea eax, [ebp - 0xec]
mov edx, 0xcc
call fcn.10007128
mov dword [ebp - 0x14c], 0xc
xor eax, eax
mov dword [ebp - 0x148], eax
mov dword [ebp - 0x144], 0xffffffff
lea eax, [ebp - 0xfc]
push eax
lea eax, [ebp - 0x140]
push eax
push 0
push 0
push 4
push 0xffffffffffffffff
lea eax, [ebp - 0x14c]
push eax
lea eax, [ebp - 0x14c]
push eax
lea edx, [ebp - 0x154]
xor eax, eax
call fcn.10002e0c
push dword [ebp - 0x154]
push 0x10058af0
lea edx, [ebp - 0x158]
mov eax, 1
call fcn.10002e0c
push dword [ebp - 0x158]
lea eax, [ebp - 0x150]
mov edx, 3
call fcn.10004798
mov eax, dword [ebp - 0x150]
call fcn.100048d8
push eax
push 0
call sub.kernel32.dll_CreateProcessA
mov dword [ebp - 0xec], 0x10007
lea eax, [ebp - 0xec]
push eax
mov eax, dword [ebp - 0xf8]
push eax
call sub.kernel32.dll_GetThreadContext
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x48]
add eax, 8
push eax
mov eax, dword [ebp - 0xfc]
push eax
call sub.kernel32.dll_ReadProcessMemory
push 0x40
push 0x3000
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x34]
push eax
mov eax, dword [ebp - 0xfc]
push eax
call sub.kernel32.dll_VirtualAllocEx
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x34]
push eax
mov eax, dword [ebp - 0xfc]
push eax
call sub.kernel32.dll_WriteProcessMemory
lea eax, [ebp - 0xc]
push eax
push 4
mov eax, dword [ebp - 0x18]
add eax, 0x34
push eax
mov eax, dword [ebp - 0x48]
add eax, 8
push eax
mov eax, dword [ebp - 0xfc]
push eax
call sub.kernel32.dll_WriteProcessMemory
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x34]
mov edx, dword [ebp - 0x18]
add eax, dword [edx + 0x28]
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0xec]
push eax
mov eax, dword [ebp - 0xf8]
push eax
call sub.kernel32.dll_SetThreadContext
mov eax, dword [ebp - 0xf8]
push eax
call sub.kernel32.dll_ResumeThread
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x10058aae
mov eax, dword [ebp - 0x1c]
push eax
call fcn.10005f20
pop ecx
ret