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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xb4
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0xb0], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
lea eax, [esp + 0x6c]
push edi
push 0x44
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x74]
push eax
push 0
push 0
push 0xc
push 0
push 0
push 0
push 0
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x4010c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateProcessW_returned__d_n
call fcn.00401010
add esp, 8
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov esi, dword [esp + 0x38]
lea eax, [esp + 0x5c]
push eax
push 0x40
push 0x1000
push 0x400000
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov edi, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
lea eax, [esp + 0x48]
push eax
push 4
lea eax, [esp + 0x54]
mov dword [esp + 0x54], 0
push eax
push 0x40003c
push esi
mov dword [esp + 0x5c], 0
call edi
test eax, eax
jne 0x401128
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadProcessMemory:__d_n
call fcn.00401010
add esp, 8
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0x48]
push ecx
add eax, 0x400000
mov dword [esp + 0x58], 0
push 2
lea ecx, [esp + 0x60]
mov dword [esp + 0x54], eax
push ecx
add eax, 0x14
mov dword [esp + 0x64], 0
push eax
push esi
mov dword [esp + 0x5c], 0
call edi
test eax, eax
jne 0x401180
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadProcessMemory:__d_n
call fcn.00401010
add esp, 8
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0x48]
push ecx
push 2
lea ecx, [esp + 0x5c]
mov dword [esp + 0x50], 0
push ecx
add eax, 6
push eax
push esi
call edi
test eax, eax
jne 0x4011bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadProcessMemory:__d_n
call fcn.00401010
add esp, 8
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov ebx, dword [esp + 0x4c]
xor eax, eax
movzx ecx, word [esp + 0x58]
add ebx, 0x18
add ebx, ecx
mov dword [esp + 0x48], 0
cmp ax, word [esp + 0x54]
jae 0x4012c5
lea eax, [esp + 0x50]
mov dword [esp + 0x50], 0
push eax
push 0x28
lea eax, [esp + 0x18]
push eax
push ebx
push esi
call edi
test eax, eax
je 0x40110c
mov ecx, dword [esp + 0x1c]
add ebx, 0x28
mov dword [esp + 0x5c], ebx
mov ebx, dword [esp + 0x34]
mov edx, ebx
mov eax, ebx
shr edx, 0x1f
shr eax, 0x1e
lea edi, [ecx + 0x400000]
and eax, 0xffffff01
shr ebx, 0x1d
mov dword [esp + 0xc], eax
and bl, 1
movzx eax, bl
push eax
mov eax, dword [esp + 0x10]
push edx
movzx eax, al
push eax
push dword [esp + 0x2c]
mov dword [esp + 0x60], edx
push ecx
push str._p__lx_r_d_w_d_e_d_n
call fcn.00401010
add esp, 0x18
test bl, bl
jne 0x4012a5
test dword [esp + 0x34], 0x8000000
jne 0x4012a5
cmp byte [esp + 0xc], bl
je 0x40127f
cmp byte [esp + 0x50], bl
je 0x401276
lea eax, [esp + 0x60]
push eax
push 0x40
jmp 0x401299
lea eax, [esp + 0x64]
push eax
push 0x20
jmp 0x401299
cmp byte [esp + 0x50], 0
je 0x401292
lea eax, [esp + 0x68]
push eax
push 0x80
jmp 0x401299
lea eax, [esp + 0x6c]
push eax
push 0x10
push dword [esp + 0x28]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov ebx, dword [esp + 0x48]
movzx eax, word [esp + 0x54]
inc ebx
mov edi, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
cmp ebx, eax
mov dword [esp + 0x48], ebx
mov ebx, dword [esp + 0x5c]
jb 0x4011e2
push dword [esp + 0x3c]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [esp + 0xbc]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004012e6
mov esp, ebp
pop ebp
ret