Function at 0x18004a390
Capabilities:
Allocate or change rwx memory
Get system information on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x70
mov rax, qword [0x1800ce080]
xor rax, rsp
mov qword [rsp + 0x60], rax
mov r14, rcx
lea rsi, [rdx + 0x1f]
add rcx, 8
and rsi, 0xffffffffffffffe0
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rdi, qword [r14 + 0x78]
test rdi, rdi
je 0x180049c9a
mov rax, qword [rdi + 0x10]
sub rax, qword [rdi + 0x18]
cmp rsi, rax
jbe 0x180049d9c
mov rdi, qword [rdi]
test rdi, rdi
jne 0x180049c81
mov r15d, 0x8000
mov ecx, reloc.WLDAP32.dll_Ordinal_32
cmp rsi, r15
cmova r15, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
xor ebp, ebp
mov rdi, rax
test rax, rax
je 0x180049db3
mov r13, qword [r14]
lea r12, [rax + 0x10]
test r15, r15
je 0x180049d6e
mov rax, qword [0x1801591a0]
test rax, rax
jne 0x180049d30
lea rcx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov ecx, dword [rsp + 0x34]
dec ecx
mov eax, ecx
shr eax, 1
or ecx, eax
mov eax, ecx
shr eax, 2
or ecx, eax
mov eax, ecx
shr eax, 4
or ecx, eax
mov eax, ecx
shr eax, 8
or ecx, eax
mov eax, ecx
shr eax, 0x10
or eax, ecx
inc eax
mov qword [0x180159190], rax
mov eax, dword [rsp + 0x58]
mov qword [0x180159198], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov qword [0x1801591a0], rax
mov rcx, qword [0x180159190]
dec r15
add r15, rcx
mov dword [rsp + 0x20], 0x40
dec rcx
mov r9d, 0x3000
not rcx
and r15, rcx
test r13, r13
mov r8, r15
cmovne rax, r13
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test rax, rax
jne 0x180049d80
mov rax, rbp
mov rcx, rdi
mov qword [rdi + 8], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x180049db3
test r12, r12
je 0x180049d89
mov qword [r12], r15
mov qword [rdi + 8], rax
mov qword [rdi + 0x18], rbp
mov rax, qword [r14 + 0x78]
mov qword [rdi], rax
mov qword [r14 + 0x78], rdi
mov rcx, qword [rdi + 0x18]
mov rbp, qword [rdi + 8]
add rbp, rcx
lea rax, [rcx + rsi]
mov qword [rdi + 0x18], rax
add qword [r14 + 0x50], rsi
lea rcx, [r14 + 8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, rbp
mov rcx, qword [rsp + 0x60]
xor rcx, rsp
call fcn.1800a6750
mov rbx, qword [rsp + 0xc0]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov qword [rsp + 8], rcx
push rdi
push r12
sub rsp, 0x58
lea rdi, [rdx + 0x1f]
mov r12, rcx
and rdi, 0xffffffffffffffe0
mov qword [rsp + 0x78], rdi
jne 0x180049e18
xor eax, eax
add rsp, 0x58
pop r12
pop rdi
ret
mov qword [rsp + 0x80], rbx
lea rbx, [rcx + 8]
mov qword [rsp + 0x50], rbp
mov rcx, rbx
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x40], r13
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rsi, qword [r12 + 0x70]
mov r15, qword [r12 + 0x30]
test rsi, rsi
je 0x180049f62
nop dword [rax]
mov rax, qword [rsi + 0x30]
sub rax, qword [rsi + 0x38]
cmp rax, rdi
jb 0x180049f3c
mov rcx, qword [rsi + 0x50]
cmp rcx, rdi
jae 0x180049e83
test rcx, rcx
jne 0x180049f3c
mov r11, qword [rsi + 0x40]
lea rax, [rdi - 1]
add rax, qword [rsi + 0x48]
xor edx, edx
div qword [rsi + 0x48]
mov r14, qword [rsi + 0x58]
xor ecx, ecx
xor r9d, r9d
xor edi, edi
mov rbp, rax
test r11, r11
je 0x180049f28
nop dword [rax]
mov r10, qword [r14]
lea r14, [r14 + 8]
cmp r10, 0xffffffffffffffff
jne 0x180049ecb
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
jmp 0x180049f1f
lea rax, [rdi + 0x40]
mov r8d, 0x40
cmp rax, r11
jbe 0x180049ee0
mov r8, r11
sub r8, rdi
xor eax, eax
lea edx, [rax + 1]
test r8, r8
je 0x180049f1f
nop word [rax + rax]
inc rax
test r10, rdx
jne 0x180049f0b
inc rcx
cmp rcx, rbp
jne 0x180049f17
sub rax, rcx
add rdi, rax
jmp 0x18004a0a4
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
add rdx, rdx
cmp rax, r8
jb 0x180049ef0
add rdi, 0x40
cmp rdi, r11
jb 0x180049eb0
imul r9, qword [rsi + 0x48]
mov rdi, qword [rsp + 0x78]
mov qword [rsi + 0x50], r9
mov rsi, qword [rsi + 0x28]
jmp 0x180049f59
mov rcx, qword [rsi + 0x28]
cmp rax, r15
jae 0x180049f56
cmp rsi, qword [r12 + 0x70]
jne 0x180049f56
test rcx, rcx
je 0x180049f56
mov qword [r12 + 0x70], rcx
mov rsi, rcx
test rsi, rsi
jne 0x180049e60
mov rsi, qword [r12 + 0x30]
mov r15, qword [r12 + 0x38]
cmp rsi, rdi
jae 0x180049f7a
mov rsi, rdi
mov rdi, qword [r12]
jmp 0x180049f87
mov rdi, qword [r12]
test rsi, rsi
je 0x18004a12b
call fcn.180049310
test rdi, rdi
jne 0x180049f95
mov rdi, qword [rax + 0x10]
mov rax, qword [rax]
mov r9d, 0x3000
xor edx, edx
mov dword [rsp + 0x20], 0x40
mov rcx, rdi
lea rbp, [rax - 1]
add rbp, rsi
dec rax
not rax
and rbp, rax
mov r8, rbp
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov r12, rax
test rax, rax
je 0x18004a12b
xor edx, edx
mov rax, rbp
div r15
mov ecx, 0x68
mov r13, rax
lea rdi, [rax + 7]
shr rdi, 3
add rdi, 7
and rdi, 0xfffffffffffffff8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
mov rcx, 0xffffffffffffffff
mov eax, 2
mul rdi
cmovo rax, rcx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r14, rax
test rsi, rsi
je 0x18004a0e4
test rax, rax
je 0x18004a0e4
xor eax, eax
lea r8, [rdi + rdi]
mov qword [rsi], rax
xor edx, edx
mov qword [rsi + 8], rax
mov rcx, r14
mov qword [rsi + 0x10], r12
mov dword [rsi + 0x18], 1
mov qword [rsi + 0x20], rax
mov qword [rsi + 0x28], rax
mov qword [rsi + 0x30], rbp
mov qword [rsi + 0x38], rax
mov qword [rsi + 0x40], r13
mov qword [rsi + 0x48], r15
mov qword [rsi + 0x50], rbp
call sub.VCRUNTIME140.dll_memset
mov r12, qword [rsp + 0x70]
lea rax, [r14 + rdi]
mov rcx, r12
mov qword [rsi + 0x60], rax
mov rdx, rsi
mov qword [rsi + 0x58], r14
call fcn.180049680
mov rax, qword [rsp + 0x78]
xor edx, edx
dec rax
xor edi, edi
add rax, qword [rsi + 0x48]
div qword [rsi + 0x48]
mov rbp, rax
mov rax, qword [rsi + 0x30]
add qword [r12 + 0x48], rax
mov rcx, qword [rsi + 0x58]
mov r8, rbp
mov rdx, rdi
call fcn.1800495b0
mov rcx, qword [rsi + 0x60]
lea r8, [rbp - 1]
mov rdx, rdi
call fcn.1800495b0
imul rbp, qword [rsi + 0x48]
mov qword [rsi + 0x50], 0
add qword [rsi + 0x38], rbp
add qword [r12 + 0x50], rbp
imul rdi, qword [rsi + 0x48]
add rdi, qword [rsi + 0x10]
jmp 0x18004a12d
mov rdi, qword [rsp + 0x70]
mov rdi, qword [rdi]
call fcn.180049310
test rdi, rdi
jne 0x18004a0fa
mov rdi, qword [rax + 0x10]
mov r9d, 0x8000
xor r8d, r8d
mov rdx, r12
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFreeEx]
test rsi, rsi
je 0x18004a11d
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test r14, r14
je 0x18004a12b
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor edi, edi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov r15, qword [rsp + 0x30]
mov rax, rdi
mov r14, qword [rsp + 0x38]
mov r13, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x80]
add rsp, 0x58
pop r12
pop rdi
ret
cmp r8d, 1
je 0x180049c40
jmp 0x180049df0