Function at 0x180017080
Capabilities:
Allocate or change rwx memory

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r14
push r15
sub rsp, 0xb8
mov rax, qword [0x1800677c0]
xor rax, rsp
mov qword [rsp + 0xa8], rax
mov rbx, qword [rcx]
xor ebp, ebp
mov rdi, rdx
mov esi, ebp
mov r15, rcx
mov qword [rsp + 0x38], rcx
cmp dword [0x1800699f0], esi
lea r14, [0x180069a50]
jne 0x1800170ea
lea rcx, [0x180069a20]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
xor edx, edx
mov r8d, 0x200
mov rcx, r14
call fcn.180019cb0
mov dword [0x1800699f0], 1
lea rcx, [0x180069a20]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
movzx eax, byte [rbx]
cmp al, 0xff
jne 0x18001710f
cmp byte [rbx + 1], 0x25
jne 0x18001710f
movsxd rcx, dword [rbx + 2]
mov rcx, qword [rcx + rbx + 6]
jmp 0x18001712d
cmp al, 0xe9
jne 0x18001711d
movsxd rax, dword [rbx + 1]
lea rcx, [rbx + 5]
jmp 0x18001712a
cmp al, 0xeb
jne 0x180017135
movsx rax, byte [rbx + 1]
lea rcx, [rbx + 2]
add rcx, rax
call fcn.1800175c0
mov rbx, rax
movzx eax, byte [rdi]
cmp al, 0xff
jne 0x18001714d
cmp byte [rdi + 1], 0x25
jne 0x18001714d
movsxd rcx, dword [rdi + 2]
mov rcx, qword [rcx + rdi + 6]
jmp 0x18001716b
cmp al, 0xe9
jne 0x18001715b
movsxd rax, dword [rdi + 1]
lea rcx, [rdi + 5]
jmp 0x180017168
cmp al, 0xeb
jne 0x180017173
movsx rax, byte [rdi + 1]
lea rcx, [rdi + 2]
add rcx, rax
call fcn.1800175c0
mov rdi, rax
xor edx, edx
lea rcx, [rsp + 0x48]
mov qword [rsp + 0x40], rbp
lea r8d, [rdx + 0x50]
call fcn.180019cb0
lea r8, [rsp + 0x40]
mov edx, 5
mov rcx, rbx
call fcn.180016e90
mov r14d, eax
cmp eax, 5
jb 0x1800174c5
mov edx, r14d
mov rcx, rbx
call fcn.180017730
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x40]
mov rcx, rbx
call fcn.180017920
mov rsi, rax
test rax, rax
je 0x1800174c0
mov qword [rsp + 0x100], r12
mov qword [rsp + 0xb0], r13
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r13, rax
lea rax, [rsp + 0xa4]
mov r9d, 0x40
mov r8d, r14d
mov rdx, rbx
mov rcx, r13
mov qword [rsp + 0x20], rax
mov dword [rsp + 0xa4], ebp
mov dword [rsp + 0xa0], ebp
mov r12d, r14d
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x180017460
mov r9d, 0x40
lea rax, [rsp + 0xa0]
mov rdx, rsi
lea r8d, [r9 + 0x38]
mov rcx, r13
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x18001742d
lea r15, [rsi + 0x38]
test r14d, r14d
je 0x180017286
mov r8, rbx
mov r9, rsi
mov rcx, r15
sub r8, r15
sub r9, r15
mov edx, r14d
nop dword [rax]
movzx eax, byte [r8 + rcx]
lea rcx, [rcx + 1]
mov byte [rcx - 1], al
mov byte [r9 + rcx + 0x57], al
dec rdx
jne 0x180017270
lea rax, [r14 + r15]
lea rcx, [r14 + rbx]
lea r8, [rax + 5]
cmp r8, rcx
jbe 0x18001729f
mov rdx, r8
sub rdx, rcx
jmp 0x1800172a5
mov rdx, rcx
sub rdx, r8
cmp rdx, 0x7fff0000
ja 0x1800172b9
sub ecx, r8d
mov byte [rax], 0xe9
mov dword [rax + 1], ecx
jmp 0x1800172c5
mov word [rax], 0x25ff
mov dword [rax + 2], ebp
mov qword [rax + 6], rcx
mov eax, dword [rsp + 0x50]
mov r9, r15
sub r9, rbx
test eax, eax
je 0x1800172f5
lea rdx, [rsp + 0x58]
mov r8d, eax
nop dword [rax + rax]
mov ecx, dword [rdx + 8]
mov eax, dword [rdx]
lea rdx, [rdx + 0x10]
sub ecx, r9d
mov dword [rax + r15], ecx
dec r8
jne 0x1800172e0
cmp rdi, rbx
jae 0x180017302
mov rax, rbx
sub rax, rdi
jmp 0x180017308
mov rax, rdi
sub rax, rbx
cmp rax, 0x7fff0000
jbe 0x1800173b0
lea r14, [rsi + 0x18]
mov r8, r14
lea rcx, [r14 + 5]
cmp rcx, rdi
jbe 0x18001732c
mov rax, rcx
sub rax, rdi
jmp 0x180017332
mov rax, rdi
sub rax, rcx
cmp rax, 0x7fff0000
ja 0x18001734c
mov eax, edi
mov byte [r14], 0xe9
sub eax, ecx
add r8, 5
mov dword [r14 + 1], eax
jmp 0x18001735e
mov word [r14], 0x25ff
mov dword [r14 + 2], ebp
add r8, 0xe
mov qword [r14 + 6], rdi
sub r8, rsi
mov rdx, r14
mov rcx, r13
sub r8, 0x18
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea rcx, [rbx + 5]
cmp rcx, r14
jbe 0x180017382
mov rax, rcx
sub rax, r14
jmp 0x180017388
mov rax, r14
sub rax, rcx
cmp rax, 0x7fff0000
ja 0x18001739f
sub r14d, ecx
mov byte [rbx], 0xe9
mov dword [rbx + 1], r14d
mov r14d, r12d
jmp 0x1800173e7
mov word [rbx], 0x25ff
mov dword [rbx + 2], ebp
mov qword [rbx + 6], r14
mov r14d, r12d
jmp 0x1800173e7
lea rcx, [rbx + 5]
cmp rcx, rdi
jbe 0x1800173c1
mov rax, rcx
sub rax, rdi
jmp 0x1800173c7
mov rax, rdi
sub rax, rcx
cmp rax, 0x7fff0000
ja 0x1800173db
mov eax, edi
mov byte [rbx], 0xe9
sub eax, ecx
mov dword [rbx + 1], eax
jmp 0x1800173e7
mov word [rbx], 0x25ff
mov dword [rbx + 2], ebp
mov qword [rbx + 6], rdi
mov r8, r12
mov rdx, r15
mov rcx, r13
mov dword [rsi + 8], r14d
mov qword [rsi], rbx
mov qword [rsi + 0x10], rdi
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov r9d, dword [rsp + 0xa0]
lea rax, [rsp + 0xa0]
mov r8d, 0x78
mov rdx, rsi
mov rcx, r13
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov r15, qword [rsp + 0x38]
mov r8, r12
mov rdx, rbx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov r9d, dword [rsp + 0xa4]
lea rax, [rsp + 0xa4]
mov r8, r12
mov rdx, rbx
mov rcx, r13
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov r13, qword [rsp + 0xb0]
mov r12, qword [rsp + 0x100]
cmp qword [rsi], rbp
je 0x18001747e
lea rax, [rsi + 0x38]
mov qword [r15], rax
jmp 0x1800174c0
lea rdx, [0x180069a50]
mov eax, ebp
mov rcx, rdx
nop word [rax + rax]
cmp qword [rcx], rsi
je 0x1800174a2
inc eax
add rcx, 8
cmp eax, 0x40
jb 0x180017490
jmp 0x1800174bd
mov qword [rdx + rax*8], rbp
mov r8d, 0x8000
mov rcx, rsi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_VirtualFree]
dec dword [0x1800699f4]
mov rsi, rbp
call fcn.180017500
lea rcx, [0x180069a20]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test rsi, rsi
setne bpl
mov eax, ebp
mov rcx, qword [rsp + 0xa8]
xor rcx, rsp
call fcn.180019ba0
add rsp, 0xb8
pop r15
pop r14
pop rdi
pop rsi
pop rbp
pop rbx
ret