Function at 0x14004c550
Capabilities:
Allocate or change rwx memory

Disassembly:
mov qword [rsp + 8], rcx
push rsi
push r13
sub rsp, 0x58
lea rsi, [rdx + 0x1f]
mov r13, rcx
and rsi, 0xffffffffffffffe0
mov qword [rsp + 0x78], rsi
jne 0x14004bfc8
xor eax, eax
add rsp, 0x58
pop r13
pop rsi
ret
mov qword [rsp + 0x88], rbx
lea rbx, [rcx + 8]
mov qword [rsp + 0x50], rbp
mov rcx, rbx
mov qword [rsp + 0x48], rdi
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r12, qword [r13 + 0x70]
mov rdx, qword [r13 + 0x30]
mov qword [rsp + 0x80], rdx
test r12, r12
je 0x14004c119
nop
mov rax, qword [r12 + 0x30]
sub rax, qword [r12 + 0x38]
cmp rax, rsi
jb 0x14004c0f4
mov rcx, qword [r12 + 0x50]
cmp rcx, rsi
jae 0x14004c036
test rcx, rcx
jne 0x14004c0f4
mov r15, qword [r12 + 0x48]
lea rax, [rsi - 1]
mov rbp, qword [r12 + 0x40]
add rax, r15
mov r14, qword [r12 + 0x58]
xor edx, edx
div r15
xor ecx, ecx
xor r9d, r9d
xor edi, edi
mov rsi, rax
test rbp, rbp
je 0x14004c0d7
mov r10, qword [r14]
lea r14, [r14 + 8]
lea r11, [rdi + 0x40]
cmp r10, 0xffffffffffffffff
jne 0x14004c07f
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
jmp 0x14004c0cf
mov r8d, 0x40
cmp r11, rbp
jbe 0x14004c090
mov r8, rbp
sub r8, rdi
xor eax, eax
lea edx, [rax + 1]
test r8, r8
je 0x14004c0cf
nop word [rax + rax]
inc rax
test r10, rdx
jne 0x14004c0bb
inc rcx
cmp rcx, rsi
jne 0x14004c0c7
sub rax, rcx
add rdi, rax
jmp 0x14004c260
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
add rdx, rdx
cmp rax, r8
jb 0x14004c0a0
mov rdi, r11
cmp r11, rbp
jb 0x14004c060
mov rsi, qword [rsp + 0x78]
mov rdx, qword [rsp + 0x80]
imul r15, r9
mov qword [r12 + 0x50], r15
mov r12, qword [r12 + 0x28]
jmp 0x14004c110
mov rcx, qword [r12 + 0x28]
cmp rax, rdx
jae 0x14004c10d
cmp r12, qword [r13 + 0x70]
jne 0x14004c10d
test rcx, rcx
je 0x14004c10d
mov qword [r13 + 0x70], rcx
mov r12, rcx
test r12, r12
jne 0x14004c010
cmp qword [r13 + 0x30], rsi
mov rdi, rsi
mov r15, qword [r13 + 0x38]
cmovae rdi, qword [r13 + 0x30]
mov rsi, qword [r13]
test rdi, rdi
je 0x14004c2eb
call fcn.14004b680
test rsi, rsi
jne 0x14004c144
mov rsi, qword [rax + 0x10]
mov rax, qword [rax]
dec rdi
add rdi, rax
mov dword [rsp + 0x20], 0x40
dec rax
mov r9d, 0x3000
not rax
xor edx, edx
and rdi, rax
mov rcx, rsi
mov r8, rdi
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov rbp, rax
test rax, rax
je 0x14004c2eb
xor edx, edx
mov rax, rdi
div r15
mov ecx, 0x68
mov r13, rax
lea r14, [rax + 7]
shr r14, 3
add r14, 7
and r14, 0xfffffffffffffff8
call fcn.14008e690
mov r12, rax
mov rcx, 0xffffffffffffffff
mov eax, 2
mul r14
cmovo rax, rcx
mov rcx, rax
call fcn.14008e690
mov rsi, rax
test r12, r12
je 0x14004c2a6
test rax, rax
je 0x14004c2a6
xor eax, eax
lea r8, [r14 + r14]
mov qword [r12], rax
xor edx, edx
mov qword [r12 + 8], rax
mov rcx, rsi
mov qword [r12 + 0x10], rbp
mov dword [r12 + 0x18], 1
mov qword [r12 + 0x20], rax
mov qword [r12 + 0x28], rax
mov qword [r12 + 0x30], rdi
mov qword [r12 + 0x38], rax
mov qword [r12 + 0x40], r13
mov qword [r12 + 0x48], r15
mov qword [r12 + 0x50], rdi
call fcn.14007e370
mov r13, qword [rsp + 0x70]
lea rax, [rsi + r14]
mov rcx, r13
mov qword [r12 + 0x60], rax
mov rdx, r12
mov qword [r12 + 0x58], rsi
call fcn.14004b9f0
mov rax, qword [rsp + 0x78]
xor edx, edx
dec rax
xor edi, edi
add rax, qword [r12 + 0x48]
div qword [r12 + 0x48]
mov rsi, rax
mov rax, qword [r12 + 0x30]
add qword [r13 + 0x48], rax
mov rcx, qword [r12 + 0x58]
mov r8, rsi
mov rdx, rdi
call fcn.14004b920
mov rcx, qword [r12 + 0x60]
lea r8, [rsi - 1]
mov rdx, rdi
call fcn.14004b920
imul rsi, qword [r12 + 0x48]
mov qword [r12 + 0x50], 0
add qword [r12 + 0x38], rsi
add qword [r13 + 0x50], rsi
imul rdi, qword [r12 + 0x48]
add rdi, qword [r12 + 0x10]
jmp 0x14004c2ed
mov rdi, qword [rsp + 0x70]
mov rdi, qword [rdi]
call fcn.14004b680
test rdi, rdi
jne 0x14004c2bc
mov rdi, qword [rax + 0x10]
mov r9d, 0x8000
xor r8d, r8d
mov rdx, rbp
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFreeEx]
test r12, r12
je 0x14004c2de
mov rcx, r12
call fcn.140082258
test rsi, rsi
je 0x14004c2eb
mov rcx, rsi
call fcn.140082258
xor edi, edi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov r15, qword [rsp + 0x30]
mov rax, rdi
mov rdi, qword [rsp + 0x48]
mov r14, qword [rsp + 0x38]
mov r12, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x88]
add rsp, 0x58
pop r13
pop rsi
ret
push r14
sub rsp, 0x40
mov r14, rcx
cmp r8d, 1
jne 0x14004c6ad
mov qword [rsp + 0x50], rbx
add rcx, 8
mov qword [rsp + 0x58], rbp
lea rbp, [rdx + 0x1f]
mov qword [rsp + 0x60], rsi
and rbp, 0xffffffffffffffe0
mov qword [rsp + 0x68], rdi
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x30], r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rdi, qword [r14 + 0x78]
test rdi, rdi
je 0x14004c5b9
nop dword [rax]
mov rax, qword [rdi + 0x10]
sub rax, qword [rdi + 0x18]
cmp rbp, rax
jbe 0x14004c665
mov rdi, qword [rdi]
test rdi, rdi
jne 0x14004c5a0
mov esi, 0x8000
mov ecx, 0x20
cmp rbp, rsi
cmova rsi, rbp
call fcn.14008e690
mov rdi, rax
test rax, rax
jne 0x14004c5e8
lea rcx, [r14 + 8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor esi, esi
jmp 0x14004c685
mov r15, qword [r14]
lea r12, [rax + 0x10]
test rsi, rsi
je 0x14004c635
call fcn.14004b680
test r15, r15
jne 0x14004c602
mov r15, qword [rax + 0x10]
mov rax, qword [rax]
dec rsi
add rsi, rax
mov dword [rsp + 0x20], 0x40
dec rax
mov r9d, 0x3000
not rax
xor edx, edx
and rsi, rax
mov rcx, r15
mov r8, rsi
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test rax, rax
jne 0x14004c647
xor esi, esi
mov rcx, rdi
mov eax, esi
mov qword [rdi + 8], rax
call fcn.140082258
jmp 0x14004c67b
test r12, r12
je 0x14004c650
mov qword [r12], rsi
mov qword [rdi + 8], rax
xor esi, esi
mov qword [rdi + 0x18], rsi
mov rax, qword [r14 + 0x78]
mov qword [rdi], rax
mov qword [r14 + 0x78], rdi
mov rcx, qword [rdi + 0x18]
mov rsi, qword [rdi + 8]
add rsi, rcx
add rcx, rbp
mov qword [rdi + 0x18], rcx
add qword [r14 + 0x50], rbp
lea rcx, [r14 + 8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov r15, qword [rsp + 0x30]
mov rax, rsi
mov rsi, qword [rsp + 0x60]
mov r12, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x58]
mov rbx, qword [rsp + 0x50]
add rsp, 0x40
pop r14
ret
add rsp, 0x40
pop r14
jmp 0x14004bfa0