Function at 0x401050
Capabilities:
Allocate or change rwx memory
Create thread
Enumerate pe sections
Execute shellcode via indirect call
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
mov eax, dword [0x408004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, edx
mov eax, 0x5a4d
push esi
mov esi, ecx
mov dword [ebp - 0x54], esi
cmp word [ebx], ax
je 0x401092
push str.Invalid_file_n
call fcn.00401020
add esp, 4
xor al, al
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [ebx + 0x3c]
mov eax, 0x14c
add edi, ebx
mov dword [ebp - 0x4c], edi
cmp word [edi + 4], ax
je 0x4010c6
push str.Invalid_platform_n
call fcn.00401020
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push str.File_ok_n
call fcn.00401020
add esp, 4
push 4
push 0x3000
push dword [edi + 0x50]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
mov dword [ebp - 0x50], edi
test edi, edi
jne 0x401100
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Target_process_memory_allocation_failed__ex__0x_X_n
jmp 0x40174d
lea eax, [ebp - 0xc]
mov dword [ebp - 0xc], 0
push eax
mov eax, dword [ebp - 0x4c]
push 0x40
push dword [eax + 0x50]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov eax, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push 0
push 0x1000
push ebx
push edi
mov dword [ebp - 0x2c], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push esi
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x401194
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cant_write_file_header_0x_X_n
call fcn.00401020
add esp, 8
push 0x8000
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x4c]
xor edi, edi
movzx esi, word [eax + 0x14]
add esi, 0x2c
cmp word [eax + 6], di
je 0x4011da
add esi, eax
mov eax, dword [esi - 4]
test eax, eax
je 0x4011cb
push 0
push eax
mov eax, dword [esi]
add eax, ebx
push eax
mov eax, dword [esi - 8]
add eax, dword [ebp - 0x50]
push eax
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x401231
mov eax, dword [ebp - 0x4c]
inc edi
add esi, 0x28
movzx eax, word [eax + 6]
cmp edi, eax
jne 0x4011a8
mov ebx, dword [ebp - 0x54]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
push 4
push 0x3000
push 0x1c
push 0
push ebx
call esi
mov edi, eax
mov dword [ebp - 0x5c], edi
test edi, edi
jne 0x40126b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Target_process_mapping_allocation_failed__ex__0x_X_n
call fcn.00401020
add esp, 8
push 0x8000
push edi
push dword [ebp - 0x50]
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cant_map_sections:_0x_x_n
call fcn.00401020
add esp, 8
push 0x8000
push 0
push dword [ebp - 0x50]
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push 0
push 0x1c
lea eax, [ebp - 0x2c]
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x4012c4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cant_write_mapping_0x_X_n
call fcn.00401020
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
add esp, 8
push 0x8000
push 0
push dword [ebp - 0x50]
push ebx
call esi
push 0x8000
push 0
push edi
push ebx
call esi
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push 0x40
push 0x3000
push 0x1000
push 0
push ebx
call esi
mov dword [ebp - 0x58], eax
test eax, eax
jne 0x4012ea
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Memory_shellcode_allocation_failed__ex__0x_X_n
jmp 0x40128b
push 0
push 0x1000
push 0x401770
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x401343
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cant_write_shellcode_0x_X_n
call fcn.00401020
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
add esp, 8
push 0x8000
push 0
push dword [ebp - 0x50]
push ebx
call esi
push 0x8000
push 0
push edi
push ebx
call esi
push 0x8000
push 0
push dword [ebp - 0x58]
jmp 0x4012ae
mov esi, dword [ebp - 0x50]
push esi
push str.Mapped_DLL_at__p_n
call fcn.00401020
push edi
push str.Mapping_info_at__p_n
call fcn.00401020
push dword [ebp - 0x58]
push str.Shell_code_at__p_n
call fcn.00401020
push str.Data_allocated_n
call fcn.00401020
add esp, 0x1c
push 0
push 0
push edi
push dword [ebp - 0x58]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
test eax, eax
jne 0x4013cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Thread_creation_failed_0x_X_n
call fcn.00401020
add esp, 8
push 0x8000
push 0
push esi
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
push ebx
call esi
push 0x8000
push 0
push edi
push ebx
call esi
push 0x8000
push 0
push dword [ebp - 0x58]
jmp 0x4012ae
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x58]
push str.Thread_created_at:__p__waiting_for_return..._n
call fcn.00401020
mov ebx, dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
add esp, 8
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
nop
mov esi, dword [ebp - 0x54]
lea eax, [ebp - 8]
push eax
push esi
mov dword [ebp - 8], 0
call ebx
mov eax, dword [ebp - 8]
cmp eax, 0x103
jne 0x401747
push 0
push 0x1c
lea eax, [ebp - 0x48]
mov dword [ebp - 0x30], 0
push eax
push dword [ebp - 0x5c]
xorps xmm0, xmm0
push esi
movups xmmword [ebp - 0x48], xmm0
movq qword [ebp - 0x38], xmm0
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov esi, dword [ebp - 0x3c]
cmp esi, sub.VCRUNTIME140.dll__CxxThrowException
je 0x401708
cmp esi, 0x505050
jne 0x401458
push str.WARNING:_Exception_support_failed__n
call fcn.00401020
add esp, 4
push 0xa
call edi
test esi, esi
je 0x4013f0
push 0x1400000
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
mov dword [ebp - 0x60], ebx
test ebx, ebx
jne 0x401497
push str.Unable_to_allocate_memory_n
call fcn.00401020
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push 0x1400000
push 0
push ebx
call sub.VCRUNTIME140.dll_memset
mov edi, dword [ebp - 0x54]
add esp, 0xc
push 0
push 0x1000
push ebx
mov ebx, dword [ebp - 0x50]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x4014ce
push str.WARNING_:_Cant_clear_HEADER_n
call fcn.00401020
add esp, 4
mov ecx, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 8], 0
movzx eax, word [ecx + 0x14]
lea esi, [ecx + 0x18]
add esi, eax
movzx eax, word [ecx + 6]
mov ecx, eax
test ax, ax
je 0x4015e1
cmp dword [esi + 8], 0
je 0x4015cc
mov ecx, str..pdata
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x401524
test dl, dl
je 0x401520
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x401524
add eax, 2
add ecx, 2
test dl, dl
jne 0x401504
xor eax, eax
jmp 0x401529
sbb eax, eax
or eax, 1
test eax, eax
je 0x40158d
mov ecx, str..rsrc
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x401554
test dl, dl
je 0x401550
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x401554
add eax, 2
add ecx, 2
test dl, dl
jne 0x401534
xor eax, eax
jmp 0x401559
sbb eax, eax
or eax, 1
test eax, eax
je 0x40158d
mov ecx, str..reloc
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x401584
test dl, dl
je 0x401580
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x401584
add eax, 2
add ecx, 2
test dl, dl
jne 0x401564
xor eax, eax
jmp 0x401589
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4015c9
push esi
push str.Processing__s_removal_n
call fcn.00401020
mov eax, dword [esi + 0xc]
add esp, 8
add eax, ebx
push 0
push dword [esi + 8]
push dword [ebp - 0x60]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x4015c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Cant_clear_section__s:_0x_x_n
call fcn.00401020
add esp, 0xc
mov edx, dword [ebp - 0x4c]
movzx eax, word [edx + 6]
add esi, 0x28
inc dword [ebp - 8]
mov ecx, eax
cmp dword [ebp - 8], eax
jne 0x4014f3
movzx eax, word [edx + 0x14]
lea esi, [edx + 0x18]
add esi, eax
xor ebx, ebx
test cx, cx
je 0x40166d
lea edx, [ebx + 0x20]
mov ecx, dword [esi + 8]
test ecx, ecx
je 0x401659
mov eax, dword [esi + 0x24]
mov edi, 2
mov dword [ebp - 8], 0
test eax, 0x80000000
jbe 0x40161c
mov edi, 4
jmp 0x401624
test eax, 0x20000000
cmova edi, edx
lea eax, [ebp - 8]
push eax
mov eax, dword [esi + 0xc]
add eax, dword [ebp - 0x50]
push edi
push ecx
push eax
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
push edi
push esi
test eax, eax
je 0x401647
push str.section__s_set_as__lX_n
jmp 0x40164c
push str.FAIL:_section__s_not_set_as__lX_n
call fcn.00401020
mov edx, 0x20
add esp, 0xc
mov ecx, dword [ebp - 0x4c]
inc ebx
add esi, 0x28
movzx eax, word [ecx + 6]
cmp ebx, eax
jne 0x4015f8
mov edi, dword [ebp - 0x54]
jmp 0x401670
mov ecx, dword [ebp - 0x4c]
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
movzx eax, word [ecx + 0x14]
push 2
push dword [eax + ecx + 0x24]
push dword [ebp - 0x50]
push edi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov ebx, dword [ebp - 0x58]
push 0
push 0x1000
push dword [ebp - 0x60]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x4016b5
push str.WARNING:_Cant_clear_shellcode_n
call fcn.00401020
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
push 0x8000
push 0
push ebx
push edi
call esi
test eax, eax
jne 0x4016d7
push str.WARNING:_cant_release_shell_code_memory_n
call fcn.00401020
add esp, 4
push 0x8000
push 0
push dword [ebp - 0x5c]
push edi
call esi
test eax, eax
jne 0x4016f5
push str.WARNING:_cant_release_mapping_data_memory_n
call fcn.00401020
add esp, 4
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040341f
mov esp, ebp
pop ebp
ret
push str.Wrong_mapping_ptr_n
call fcn.00401020
mov ebx, dword [ebp - 0x54]
add esp, 4
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFreeEx]
push 0x8000
push 0
push dword [ebp - 0x50]
push ebx
call esi
push 0x8000
push 0
push dword [ebp - 0x5c]
push ebx
call esi
push 0x8000
push 0
push dword [ebp - 0x58]
jmp 0x4012ae
push eax
push str.Process_crashed__exit_code:__d_n
call fcn.00401020
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
xor al, al
pop edi
pop esi
pop ebx
call fcn.0040341f
mov esp, ebp
pop ebp
ret