Function at 0x18005ca3c
Capabilities:
Access peb ldr_data

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r15
mov rbp, rsp
sub rsp, 0x30
lea r9, [rbp + 0x20]
mov rsi, rdx
lea r8, [rbp + 0x30]
mov rdi, rcx
call fcn.18005cd40
mov eax, dword [rdi + 0x70]
mov rcx, rdi
and eax, 0x40000
neg eax
sbb edx, edx
and edx, 0x3c
add edx, 4
call fcn.180011a6c
mov dword [rsp + 0x28], eax
lea r9, [rbp + 0x20]
xor r8d, r8d
mov dword [rsp + 0x20], 0x1000
lea rdx, [rbp + 0x30]
or rcx, 0xffffffffffffffff
call sym.ntdll.dll_NtAllocateVirtualMemory
mov ebx, eax
test eax, eax
js 0x1800a4171
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
mov ebx, 0x7ffe0380
mov r15d, 0x226
test eax, eax
jne 0x1800a3ffc
mov ecx, ebx
cmp byte [rcx], 0
jne 0x1800a4014
mov rax, qword [rbp + 0x20]
sub qword [rdi + 0x278], rax
dec dword [rdi + 0x274]
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
jne 0x1800a4046
mov rcx, rbx
cmp byte [rcx], 0
jne 0x1800a405e
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
mov ebx, 0x7ffe038a
mov r15d, 0x230
test eax, eax
jne 0x1800a40b9
mov ecx, ebx
cmp byte [rcx], 0
jne 0x1800a40d1
inc dword [rdi + 0x250]
test byte [rsi + 0xa], 4
jne 0x1800a4116
and byte [rsi + 0xa], 0x17
mov al, 1
mov rbx, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x68]
add rsp, 0x30
pop r15
pop rdi
pop rbp
ret
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005cac2
mov rax, qword gs:[0x60]
test byte [rax + 0x378], 1
je 0x18005cacb
mov r8, qword [rbp + 0x20]
mov r9d, 8
mov rdx, qword [rbp + 0x30]
mov rcx, rdi
call fcn.1800fdf54
nop
jmp 0x18005cacb
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005caec
mov rax, qword gs:[0x60]
test byte [rax + 0x378], 1
je 0x18005caf5
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
je 0x1800a4090
mov rax, qword gs:[0x60]
mov rbx, qword [rax + 0x90]
add rbx, r15
mov r9, qword [rdi + 0xc0]
mov rcx, rdi
movzx eax, byte [rbx]
mov r8, qword [rbp + 0x20]
mov rdx, qword [rbp + 0x30]
shl r9, 4
mov qword [rsp + 0x20], rax
call fcn.1800fe1c8
nop
jmp 0x18005caf5
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005cb0f
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
je 0x1800a40ed
mov rax, qword gs:[0x60]
mov rbx, qword [rax + 0x90]
add rbx, r15
mov r9, qword [rdi + 0xc0]
mov rcx, rdi
movzx eax, byte [rbx]
mov r8, qword [rbp + 0x20]
mov rdx, qword [rbp + 0x30]
shl r9, 4
mov qword [rsp + 0x20], rax
call fcn.1800fe1c8
nop
jmp 0x18005cb18
mov rdx, qword [rbp + 0x20]
mov r8, qword [rbp + 0x30]
shr rdx, 2
test rdx, rdx
je 0x18005cb28
mov r9d, 0xfeeefeee
test r8b, 4
je 0x1800a4148
mov dword [r8], r9d
sub rdx, 1
je 0x18005cb28
add r8, 4
mov rcx, rdx
movabs rax, 0xfeeefeeefeeefeee
shr rcx, 1
mov rdi, r8
rep stosq qword [rdi], rax
test dl, 1
je 0x18005cb28
mov dword [r8 + rdx*4 - 4], r9d
jmp 0x18005cb28
inc dword [rdi + 0x25c]
mov rax, qword gs:[0x60]
cmp qword [rax + 0x18], 0
je 0x1800a41aa
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x18]
mov rdx, qword [rcx + 0x10]
lea rcx, str.HEAP__wZ_:
add rdx, 0x58
call sym.ntdll.dll_DbgPrint
jmp 0x1800a41b6
lea rcx, str.HEAP:
call sym.ntdll.dll_DbgPrint
mov rax, qword [rbp + 0x20]
lea rcx, str.ZwAllocateVirtualMemory_failed__lx_for_heap__p__base__p__size__Ix__n
mov r9, qword [rbp + 0x30]
mov r8, rdi
mov edx, ebx
mov qword [rsp + 0x20], rax
call sym.ntdll.dll_DbgPrint
xor al, al
jmp 0x18005cb2e