Function at 0x140659c60
Capabilities:
Allocate or change rwx memory

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
movsxd rdi, dword [rcx + 0x3c]
mov r12, rcx
add rdi, rcx
mov r8d, 0x3000
xor ecx, ecx
mov edx, dword [rdi + 0x50]
lea r14, [rdi + 0x108]
mov esi, dword [rdi + 0x3c]
lea r9d, [rcx + 4]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov qword [0x14066b108], rax
mov rdx, r12
mov r8d, dword [rdi + 0x54]
mov rcx, rax
call fcn.1406598a8
mov eax, dword [rdi + 0x54]
xor edx, edx
mov rbx, qword [0x14066b108]
dec rax
div rsi
movzx edx, word [rdi + 6]
sub rbx, r12
xor r13d, r13d
add rbx, r14
mov r11d, esi
mov r10d, r13d
lea r9d, [rax + 1]
imul r9d, esi
test dx, dx
je 0x140659d37
mov r8, rbx
lea rcx, [r14 + 8]
sub r8, r14
xor edx, edx
mov dword [r8 + rcx + 0xc], r9d
mov eax, dword [rcx]
dec rax
div r11
mov edx, dword [r8 + rcx + 0x1c]
inc eax
imul eax, esi
mov dword [r8 + rcx + 8], eax
bt edx, 0x1d
jae 0x140659d24
btr edx, 0x1f
mov dword [r8 + rcx + 0x1c], edx
movzx edx, word [rdi + 6]
add r9d, eax
inc r10d
add rcx, 0x28
cmp r10d, edx
jne 0x140659cf7
movzx eax, dx
mov r15d, r13d
lea rcx, [rax + rax*4]
mov eax, dword [rbx + rcx*8 - 0x14]
add eax, dword [rbx + rcx*8 - 0x18]
mov dword [0x14066b110], eax
cmp word [rdi + 6], r13w
je 0x140659d8a
mov rbp, rbx
lea rsi, [r14 + 0xc]
sub rbp, r14
mov edx, dword [rsi]
mov ecx, dword [rsi + rbp + 8]
add rdx, r12
add rcx, qword [0x14066b108]
mov r8d, dword [rsi + rbp + 4]
call fcn.1406598a8
movzx eax, word [rdi + 6]
lea rsi, [rsi + 0x28]
inc r15d
cmp r15d, eax
jne 0x140659d60
mov rax, qword [0x14066b108]
mov r15d, 0xc
movsxd rdx, dword [rax + 0x3c]
add rdx, rax
mov eax, dword [0x14066b4c0]
sub eax, dword [0x14066b4b0]
mov dword [rdx + 0x90], eax
mov eax, dword [0x14066b4c4]
mov dword [rdx + 0x94], eax
cmp dword [0x14066b4d4], r13d
je 0x140659e30
mov r10d, dword [rdx + 0xb0]
mov r9d, r13d
mov dword [rdx + 0xb4], r15d
movzx r11d, word [rdi + 6]
test r11d, r11d
je 0x140659e37
lea r8, [rbx + 0x10]
mov ecx, dword [r8 - 4]
cmp r10d, ecx
jb 0x140659df5
add ecx, dword [r8]
cmp r10d, ecx
jb 0x140659e03
inc r9d
add r8, 0x28
cmp r9d, r11d
je 0x140659e37
jmp 0x140659de4
movsxd rax, r9d
lea rcx, [rax + rax*4]
mov eax, dword [rbx + rcx*8 + 0x14]
sub eax, dword [rbx + rcx*8 + 0xc]
add eax, r10d
je 0x140659e37
cdqe
add rax, qword [0x14066b108]
mov dword [rax], r13d
mov dword [rax + 4], r15d
mov dword [rax + 8], 0xa000
jmp 0x140659e37
mov qword [rdx + 0xb0], r13
mov eax, dword [0x14066b4a0]
lea r9, [rsp + 0x50]
sub eax, dword [rdx + 0x30]
mov r8d, 0x40
add eax, dword [0x14066b4a8]
mov dword [rdx + 0x28], eax
movzx eax, word [rdi + 6]
mov dword [rsp + 0x50], r13d
lea ecx, [rax + rax*4]
shl ecx, 3
sub ecx, r12d
add ecx, r14d
movsxd rbx, ecx
mov rcx, r12
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov edx, r13d
cmp word [rdi + 6], r13w
je 0x140659ea2
lea rcx, [r14 + 0x24]
mov eax, dword [rcx]
bt eax, 0x1d
jae 0x140659e94
btr eax, 0x1f
mov dword [rcx], eax
movzx eax, word [rdi + 6]
inc edx
add rcx, 0x28
cmp edx, eax
jne 0x140659e86
mov eax, dword [0x14066b4c0]
sub eax, dword [0x14066b4b0]
mov dword [rdi + 0x90], eax
mov eax, dword [0x14066b4c4]
mov dword [rdi + 0x94], eax
cmp dword [0x14066b4d4], r13d
je 0x140659f35
mov dword [rdi + 0xb4], r15d
xor r9d, r9d
mov r8d, dword [rsp + 0x50]
mov rdx, rbx
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
movsxd rbx, dword [rdi + 0xb0]
lea r9, [rsp + 0x50]
movsxd rbp, dword [rdi + 0xb4]
mov r8d, 0x40
mov rdx, rbp
lea rsi, [r12 + rbx]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test ebx, ebx
je 0x140659f1f
mov dword [rsi], r13d
mov dword [rsi + 4], r15d
mov dword [rsi + 8], 0xa000
mov r8d, dword [rsp + 0x50]
xor r9d, r9d
mov rdx, rbp
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
jmp 0x140659f3c
mov qword [rdi + 0xb0], r13
mov eax, dword [0x14066b4a0]
sub eax, dword [rdi + 0x30]
add eax, dword [0x14066b4a8]
mov rbx, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
mov dword [rdi + 0x28], eax
xor eax, eax
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
ret