Function at 0x140004050
Capabilities:
Allocate or change rwx memory
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
lea rbp, [rsp - 0x12e0]
mov eax, 0x13e0
call fcn.1401e1830
sub rsp, rax
mov rax, qword [0x1405efab8]
xor rax, rsp
mov qword [rbp + 0x12d0], rax
mov rsi, rcx
mov dword [rsp + 0x38], 0
call qword [sym.imp.MSVCP140.dll__Query_perf_frequency]
mov rbx, rax
call qword [sym.imp.MSVCP140.dll__Query_perf_counter]
cmp rbx, 0x989680
jne 0x1400040af
imul rax, rax, 0x64
jmp 0x1400040cd
cqo
idiv rbx
mov rcx, rax
imul rax, rdx, 0x3b9aca00
imul rcx, rcx, 0x3b9aca00
cqo
idiv rbx
add rax, rcx
mov rcx, rax
mov dword [rbp + 0x12c4], 0xffffffff
mov dword [rsp + 0x44], eax
mov edx, 1
mov ebx, 0x270
nop dword [rax + rax]
mov eax, ecx
shr eax, 0x1e
xor eax, ecx
imul ecx, eax, 0x6c078965
add ecx, edx
mov dword [rsp + rdx*4 + 0x44], ecx
inc rdx
cmp rdx, rbx
jb 0x1400040f0
mov rdi, qword [rsi + 0x10]
lea r9, [rsp + 0x38]
mov r8d, 4
mov dword [rsp + 0x40], ebx
mov rcx, rdi
movsxd rdx, dword [rdi + 0x3c]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1400042a4
lea rax, [rsp + 0x48]
nop dword [rax + rax]
mov r8d, dword [rax - 4]
xor r8d, dword [rax]
lea rax, [rax + 4]
btr r8d, 0x1f
xor r8d, dword [rax - 8]
mov ecx, r8d
and cl, 1
neg cl
sbb edx, edx
shr r8d, 1
and edx, 0x9908b0df
xor edx, dword [rax + 0x62c]
xor edx, r8d
mov dword [rax + 0x9b8], edx
sub rbx, 1
jne 0x140004140
mov ecx, dword [rsp + 0x40]
mov edx, dword [rsp + rcx*4 + 0x44]
mov eax, edx
shr eax, 0xb
inc ecx
and eax, dword [rbp + 0x12c4]
xor edx, eax
mov dword [rsp + 0x40], ecx
mov eax, edx
lea rcx, [rsp + 0x40]
and eax, 0xff3a58ad
shl eax, 7
xor edx, eax
mov eax, edx
and eax, 0xffffdf8c
shl eax, 0xf
xor edx, eax
mov eax, edx
shr eax, 0x12
xor eax, edx
mov word [rdi + 2], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 8], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 6], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x16], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x12], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x14], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x18], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0xc], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0xa], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x24], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x26], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x1a], ax
call fcn.140013d20
lea rcx, [rsp + 0x40]
mov word [rdi + 0x10], ax
call fcn.140013d20
movsxd r8, dword [rdi + 0x3c]
xor edx, edx
mov word [rdi + 0xe], ax
sub r8, 0x40
mov rcx, qword [rsi + 0x10]
add rcx, 0x40
call fcn.1401e1c76
movsxd rdx, dword [rdi + 0x3c]
lea r9, [rsp + 0x38]
mov rcx, qword [rsi + 0x10]
lea r8d, [rbx + 2]
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x1400042cc
mov al, 1
mov rcx, qword [rbp + 0x12d0]
xor rcx, rsp
call fcn.1401e0bc0
lea r11, [rsp + 0x13e0]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret
lea rcx, [rsp + 0x20]
call fcn.140001570
lea rdx, [0x14045fe70]
lea rcx, [rsp + 0x20]
call sub.VCRUNTIME140.dll__CxxThrowException
int3