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

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rsi
push rdi
sub rsp, 0x388
mov rax, qword [0x140128218]
xor rax, rsp
mov qword [rsp + 0x378], rax
mov dword [rsp + 0x40], 0
lea rdx, [rsp + 0x338]
mov rcx, qword [rsp + 0x3a8]
call fcn.140058130
nop
lea rcx, [rsp + 0x1a0]
call fcn.1400576e0
mov qword [rsp + 0x78], rax
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x80], rax
lea r8, [rsp + 0x338]
mov rdx, qword [rsp + 0x80]
lea rcx, [rsp + 0x180]
call fcn.1400770d0
mov qword [rsp + 0x88], rax
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x90], rax
lea r8, str..dll
mov rdx, qword [rsp + 0x90]
lea rcx, [rsp + 0x318]
call fcn.140076fb0
nop
lea rcx, [rsp + 0x180]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x1a0]
call fcn.14006ab00
lea rcx, [rsp + 0x318]
call fcn.1400596c0
mov r8d, 1
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov qword [rsp + 0x58], rax
cmp qword [rsp + 0x58], 0
jne 0x14005908b
mov byte [rsp + 0x44], 0
lea r8, str.failed_to_get_load_module
lea rdx, [rsp + 0x44]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
lea rdx, str.MainCRTStartup
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x98], rax
mov rax, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x98]
sub rcx, rax
mov rax, rcx
mov qword [rsp + 0x100], rax
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
lea rax, [rsp + 0x160]
mov qword [rsp + 0xa0], rax
lea rdx, str.RainbowSix.exe
mov rcx, qword [rsp + 0xa0]
call fcn.140059750
lea rcx, [rsp + 0x120]
mov rdi, rcx
mov rsi, rax
mov ecx, reloc.WS2_32.dll_recv
rep movsb byte [rdi], byte [rsi]
lea rcx, [rsp + 0x120]
call fcn.1400587c0
mov dword [rsp + 0x54], eax
cmp dword [rsp + 0x54], 0
jne 0x14005916d
mov byte [rsp + 0x45], 0
lea r8, str.game_not_open
lea rdx, [rsp + 0x45]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
lea r8, str..dll
lea rdx, [rsp + 0x338]
lea rcx, [rsp + 0x1c0]
call fcn.140076ee0
mov qword [rsp + 0xa8], rax
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0xb8], rax
lea rdx, [rsp + 0x170]
mov rcx, qword [rsp + 0xb8]
call fcn.14006a5f0
lea rcx, [rsp + 0x130]
mov rdi, rcx
mov rsi, rax
mov ecx, reloc.WS2_32.dll_recv
rep movsb byte [rdi], byte [rsi]
lea rdx, [rsp + 0x130]
mov ecx, dword [rsp + 0x54]
call fcn.140058960
mov byte [rsp + 0x46], al
lea rcx, [rsp + 0x1c0]
call fcn.14006ab00
movzx eax, byte [rsp + 0x46]
test eax, eax
je 0x140059257
mov byte [rsp + 0x47], 0
lea r8, str.already_injected
lea rdx, [rsp + 0x47]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
jmp 0x140059259
mov r8d, dword [rsp + 0x54]
xor edx, edx
mov ecx, 0x1fffff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
jne 0x1400592c9
mov byte [rsp + 0x48], 0
lea r8, str.open_process_failed
lea rdx, [rsp + 0x48]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
xor r8d, r8d
lea rdx, [0x14010c140]
lea rcx, [rsp + 0x140]
call fcn.1400780b0
nop
lea rcx, [rsp + 0x140]
call fcn.140054800
nop
lea rcx, [rsp + 0x140]
call fcn.140053c70
lea rax, [rsp + 0x49]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
lea rax, [rsp + 0x4a]
mov rdi, rax
xor eax, eax
mov ecx, 1
rep stosb byte [rdi], al
movzx r9d, byte [rsp + 0x49]
movzx r8d, byte [rsp + 0x4a]
movzx edx, byte [rsp + 0x4f]
lea rcx, [rsp + 0x1e0]
call fcn.1400597d0
mov rcx, rax
call fcn.1400664c0
mov dword [rsp + 0x20], 1
mov r9d, 0x40
mov r8d, 3
mov rdx, rax
lea rcx, [rsp + 0x200]
call fcn.1400662f0
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0xc8], rax
mov rcx, qword [rsp + 0xc8]
call fcn.140066200
nop
lea rcx, [rsp + 0x200]
call fcn.140059810
lea rdx, str.S_1_15_2_1
lea rcx, str.C:_seosion
call fcn.1400585f0
lea rdx, str.S_1_15_2_1
lea rcx, str.C:_seosiondefault.cfg
call fcn.1400585f0
lea rcx, [rsp + 0x50]
call fcn.140021510
mov qword [rsp + 0xe0], rax
lea rdx, [rsp + 0x108]
lea rcx, [rsp + 0x318]
call fcn.14006a720
mov rax, qword [rax]
mov qword [rsp + 0xd0], rax
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0xe8], rax
lea rdx, [rsp + 0x110]
lea rcx, [rsp + 0x318]
call fcn.14006a800
mov rax, qword [rax]
mov qword [rsp + 0xd8], rax
mov rax, qword [rsp + 0xd8]
mov qword [rsp + 0xf0], rax
mov r9, qword [rsp + 0xe0]
mov r8, qword [rsp + 0xe8]
mov rdx, qword [rsp + 0xf0]
lea rcx, [rsp + 0x358]
call fcn.140078410
nop
lea rcx, [rsp + 0x358]
call fcn.140053070
lea rdx, str.S_1_15_2_1
mov rcx, rax
call fcn.1400585f0
lea rcx, [rsp + 0x358]
call fcn.140059800
shl rax, 1
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x20], 4
mov r9d, 0x1000
mov r8, qword [rsp + 0x70]
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
jne 0x140059516
mov byte [rsp + 0x4b], 0
lea r8, str.failed_to_allocate
lea rdx, [rsp + 0x4b]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x358]
call fcn.14006a0e0
nop
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
lea rcx, [rsp + 0x358]
call fcn.140053070
mov qword [rsp + 0x20], 0
mov r9, qword [rsp + 0x70]
mov r8, rax
mov rdx, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x1400595a7
mov byte [rsp + 0x4c], 0
lea r8, str.failed_to_write
lea rdx, [rsp + 0x4c]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x358]
call fcn.14006a0e0
nop
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov rax, qword [rsp + 0x68]
mov qword [rsp + 0x20], rax
mov r9, qword [sym.imp.KERNEL32.dll_LoadLibraryW]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov qword [rsp + 0xf8], rax
cmp qword [rsp + 0xf8], 0
jne 0x140059648
mov byte [rsp + 0x4d], 0
lea r8, str.failed_to_start_module
lea rdx, [rsp + 0x4d]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x358]
call fcn.14006a0e0
nop
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
jmp 0x1400596a2
mov byte [rsp + 0x4e], 1
lea r8, str.success
lea rdx, [rsp + 0x4e]
mov rcx, qword [rsp + 0x3a0]
call fcn.1400783c0
mov eax, dword [rsp + 0x40]
or eax, 1
mov dword [rsp + 0x40], eax
lea rcx, [rsp + 0x358]
call fcn.14006a0e0
nop
lea rcx, [rsp + 0x318]
call fcn.14006ab00
nop
lea rcx, [rsp + 0x338]
call fcn.14006ab00
mov rax, qword [rsp + 0x3a0]
mov rcx, qword [rsp + 0x378]
xor rcx, rsp
call fcn.1400afe40
add rsp, 0x388
pop rdi
pop rsi
ret