Function at 0x140059690
Capabilities:
Allocate or change rwx memory

Disassembly:
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x58
xor ebx, ebx
mov r12, r9
mov r15, r8
mov rax, rdx
mov r13, rcx
mov edi, ebx
test r8, r8
je 0x1400596c7
mov qword [r8], rbx
test r12, r12
je 0x1400596cf
mov qword [r9], rbx
mov rbp, qword [rsp + 0xc0]
test rbp, rbp
je 0x1400596e0
mov qword [rbp], rbx
test rax, rax
jne 0x1400596ef
mov eax, 0x57
jmp 0x1400599fa
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x140091058], eax
je 0x140059707
mov eax, 0x10dd
jmp 0x1400599fa
mov eax, dword [0x14009105c]
test eax, eax
jne 0x1400599fa
test r13, r13
jne 0x140059723
lea eax, [r13 + 6]
jmp 0x1400599fa
mov rcx, qword [r13]
test rcx, rcx
jne 0x14005973a
lea edi, [rcx + 6]
mov dword [0x14009105c], edi
jmp 0x1400599f1
xor edx, edx
mov rsi, rbx
mov r14, rbx
call fcn.1400595d8
mov rcx, qword [rsp + 0xa8]
xor edx, edx
mov rbx, rax
call fcn.1400595d8
mov qword [rsp + 0x48], rax
cmp rax, rbx
jne 0x140059776
xor ebp, ebp
cmp dword [0x140091050], ebp
jne 0x1400599f1
jmp 0x1400599a8
test r12, r12
je 0x14005977f
mov qword [r12], rbx
test rbp, rbp
je 0x140059788
mov qword [rbp], rax
mov ecx, 0x30
call fcn.1400520fc
xor ebp, ebp
mov r14, rax
test rax, rax
jne 0x1400597a6
mov edi, 8
jmp 0x1400599a8
mov rcx, rbx
call fcn.1400590ac
mov rsi, rax
test rax, rax
je 0x14005979c
test r15, r15
je 0x1400597be
mov qword [r15], rax
xor eax, eax
mov r12, rbx
mov qword [rsi + 0x40], rax
mov r13, rsi
lea rax, [rsi + 0x1e]
mov r15d, ebp
mov qword [rsp + 0x38], rax
mov edi, 8
and dword [rsp + 0xc0], 0
lea rax, [rsp + 0xc0]
xor r9d, r9d
mov qword [rsp + 0x20], rax
mov r8, r12
mov qword [rsp + 0x30], r12
lea rdx, [rsp + 0x38]
mov rcx, r13
mov rbp, r12
call fcn.14005a74c
mov r12, rax
mov r8d, r15d
movsxd rax, dword [rsp + 0xc0]
inc r15d
sub rax, rbp
mov ebp, r12d
add rax, r12
sub ebp, ebx
add r13, rax
mov al, r13b
sub al, sil
mov dl, al
mov byte [rsp + 0xa8], al
shl dl, 3
mov al, bpl
and al, 7
or dl, al
mov byte [r8 + rsi + 0x40], dl
cmp r15d, edi
jae 0x140059864
mov rcx, qword [rsp + 0x30]
call fcn.1400592d0
test eax, eax
jne 0x140059864
cmp ebp, 5
jb 0x1400597db
mov dword [rsp + 0x30], r15d
mov r15, qword [rsp + 0xb0]
mov qword [rsp + 0x40], r13
mov r13, qword [rsp + 0xa0]
jmp 0x14005989c
mov rcx, r12
call fcn.140059334
xor ebp, ebp
test eax, eax
je 0x14005999b
cdqe
add r12, rax
mov ebp, r12d
sub ebp, ebx
cmp ebp, 5
jb 0x140059880
cmp dword [rsp + 0x30], edi
ja 0x140059999
mov rax, qword [rsp + 0x40]
cmp rax, qword [rsp + 0x38]
jbe 0x1400598b8
int3
mov al, byte [rsp + 0xa8]
lea rcx, [rsi + 0x20]
mov r8d, ebp
mov rdx, rbx
mov byte [rsi + 0x1e], al
mov byte [rsi + 0x3e], bpl
mov edi, ebp
call sub.VCRUNTIME140.dll_memcpy
cmp rdi, 0x19
jbe 0x1400598e9
mov edi, 6
xor ebp, ebp
jmp 0x1400599a8
movzx edx, byte [rsi + 0x1e]
lea rax, [rbx + rbp]
mov qword [rsi + 0x48], rax
add rdx, rsi
mov rax, qword [rsp + 0x48]
mov ebp, 0
mov qword [rsi + 0x50], rax
mov eax, esi
mov word [rdx], 0x25ff
lea rcx, [rdx + 6]
sub eax, ecx
lea rcx, [rdx + 6]
add eax, 0x48
mov dword [rdx + 2], eax
mov r8, qword [rsp + 0x38]
sub r8, rcx
cmp rcx, qword [rsp + 0x38]
cmova r8, rbp
test r8, r8
je 0x14005993a
mov dl, 0xcc
call sub.VCRUNTIME140.dll_memset
lea r9, [rsp + 0xb8]
mov dword [rsp + 0xb8], ebp
mov r8d, 0x40
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140059969
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x1400599a8
mov dword [r14 + 8], ebp
mov qword [r14 + 0x10], r13
mov qword [r14 + 0x20], rsi
mov qword [r14 + 0x18], rbx
mov eax, dword [rsp + 0xb8]
mov dword [r14 + 0x28], eax
mov rax, qword [0x140091070]
mov qword [r14], rax
xor eax, eax
mov qword [0x140091070], r14
jmp 0x1400599fa
xor ebp, ebp
cmp dword [0x140091050], ebp
mov edi, 9
jne 0x1400599b3
mov dword [0x14009105c], edi
test rsi, rsi
je 0x1400599df
xor edx, edx
mov rbx, rsi
mov rcx, rsi
and rbx, 0xffffffffffff0000
lea r8d, [rdx + 0x60]
call sub.VCRUNTIME140.dll_memset
mov rax, qword [rbx + 0x10]
mov qword [rsi + 0x48], rax
mov qword [rbx + 0x10], rsi
test r15, r15
je 0x1400599df
mov qword [r15], rbp
test r14, r14
je 0x1400599f1
mov edx, 0x30
mov rcx, r14
call fcn.140052590
mov eax, edi
mov qword [0x140091060], r13
add rsp, 0x58
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret