Function at 0x140001070
Capabilities:
Allocate or change rwx memory
Create thread
Inject thread
Spawn thread to rwx shellcode

Disassembly:
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x60
mov rax, qword [0x140005008]
xor rax, rsp
mov qword [rsp + 0x50], rax
mov ebx, ecx
mov rdi, rdx
lea rcx, str._API_Example___n
call fcn.140001010
cmp ebx, 2
je 0x1400010b8
mov rdx, qword [rdi]
lea rcx, str.____Usage:__s__pid_to_inject_into__n
call fcn.140001010
mov eax, 1
jmp 0x14000128f
mov rcx, qword [rdi + 8]
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
mov ebx, eax
test eax, eax
jne 0x1400010e0
mov rdx, qword [rdi + 8]
lea rcx, str.____Invalid_PID:__s_n
call fcn.140001010
lea eax, [rbx + 1]
jmp 0x14000128f
mov r8d, ebx
xor edx, edx
mov ecx, 0x1fffff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rdi, rax
test rax, rax
jne 0x140001117
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, ebx
lea rcx, str.____Failed_to_open_process:__d__LastError:_0x_x_n
mov r8d, eax
call fcn.140001010
lea eax, [rdi + 1]
jmp 0x14000128f
mov edx, ebx
lea rcx, str.___Successfully_opened_process__d_n
call fcn.140001010
mov edx, 0x14e
lea rcx, str.___Shellcode_length:__lld_n
call fcn.140001010
xor edx, edx
mov dword [rsp + 0x20], 4
mov r9d, 0x3000
mov r8d, 0x14e
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov rbx, rax
test rax, rax
jne 0x140001179
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Failed_to_allocate_memory__LastError:_0x_x_n
call fcn.140001010
lea eax, [rbx + 1]
jmp 0x14000128f
mov r8d, 0x14e
lea rcx, str.___Successfully_allocated_RW_memory_at_0x_p_of_size__lld_n
mov rdx, rbx
call fcn.140001010
lea rax, [rsp + 0x48]
mov r9d, 0x14e
lea r8, [0x140005040]
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x1400011d7
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, rbx
lea rcx, str.____Failed_to_write_shellcode_to_memory_at_0x_p__LastError:_0x_x_n
mov r8d, eax
call fcn.140001010
mov eax, 1
jmp 0x14000128f
lea rcx, str.___Successfully_wrote_shellcode_to_memory_n
call fcn.140001010
lea rax, [rsp + 0x40]
mov r9d, 0x20
mov r8d, 0x14e
mov qword [rsp + 0x20], rax
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
jne 0x140001228
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, rbx
lea rcx, str.____Failed_to_change_permission_to_RX_on_memory_at_0x_p__LastError:_0x_x_n
mov r8d, eax
call fcn.140001010
mov eax, 1
jmp 0x14000128f
lea rcx, str.___Successfully_changed_memory_protections_to_RX_n
call fcn.140001010
xor eax, eax
mov r9, rbx
mov qword [rsp + 0x30], rax
xor r8d, r8d
mov dword [rsp + 0x28], eax
xor edx, edx
mov rcx, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_CreateRemoteThread]
test rax, rax
jne 0x140001275
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Failed_to_create_thread__LastError:_0x_x_n
call fcn.140001010
mov eax, 1
jmp 0x14000128f
lea rcx, str.___Successfully_created_thread_in_process_n
call fcn.140001010
lea rcx, str.___Shellcode_injected_using_API_calls__n
call fcn.140001010
xor eax, eax
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.1400012c0
mov rbx, qword [rsp + 0x70]
add rsp, 0x60
pop rdi
ret