Function at 0x18005cc10
Capabilities:
Access peb ldr_data

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r15
mov rbp, rsp
sub rsp, 0x40
mov rbx, rdx
mov rsi, rcx
movzx edx, word [rdx + 8]
mov qword [rbp + 0x20], rdx
and byte [rbx + 0xa], 0xf8
mov byte [rbx + 0xf], 0
test byte [rcx + 0x70], 0x40
jne 0x1800b8a94
mov rax, qword [rsi + 0x168]
xor rax, qword [0x18015d758]
jne 0x18005cd12
lea r9, [rbp + 0x20]
mov rdx, rbx
lea r8, [rbp + 0x28]
call fcn.18005cd40
test al, al
je 0x18005cd12
mov r9d, 0x4000
lea r8, [rbp + 0x20]
lea rdx, [rbp + 0x28]
call fcn.18005cd8c
mov edi, eax
test eax, eax
js 0x1800b8c18
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
mov edi, 0x7ffe0380
mov r15d, 0x226
test eax, eax
jne 0x1800b8ae8
mov ecx, edi
cmp byte [rcx], 0
jne 0x1800b8b00
mov rax, qword [rbp + 0x20]
add qword [rsi + 0x278], rax
inc dword [rsi + 0x254]
inc dword [rsi + 0x274]
inc dword [rsi + 0x264]
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
jne 0x1800b8b32
mov rcx, rdi
cmp byte [rcx], 0
jne 0x1800b8b4a
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
mov edi, 0x7ffe038a
mov r15d, 0x230
test eax, eax
jne 0x1800b8bb0
mov ecx, edi
cmp byte [rcx], 0
jne 0x1800b8bc8
and byte [rbx + 0xa], 0x13
or byte [rbx + 0xa], 8
cmp dword [rsi + 0x7c], 0
je 0x18005cd2d
mov al, byte [rbx + 0xa]
xor al, byte [rbx + 9]
xor al, byte [rbx + 8]
mov byte [rbx + 0xb], al
mov eax, dword [rsi + 0x88]
xor dword [rbx + 8], eax
mov rbx, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x40
pop r15
pop rdi
pop rbp
ret
shl rdx, 4
lea r8, [rbx + 0x20]
sub rdx, 0x20
shr rdx, 2
test rdx, rdx
je 0x1800b8adf
mov r9d, 0xfeeefeee
test r8b, 4
je 0x1800b8abf
dec rdx
mov dword [r8], r9d
add r8, 4
mov rcx, rdx
movabs rax, 0xfeeefeeefeeefeee
shr rcx, 1
mov rdi, r8
rep stosq qword [rdi], rax
test dl, 1
je 0x1800b8adf
mov dword [r8 + rdx*4 - 4], r9d
or byte [rbx + 0xa], 4
jmp 0x18005cc45
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005cca8
mov rax, qword gs:[0x60]
test byte [rax + 0x378], 1
je 0x18005ccb1
mov r8, qword [rbp + 0x20]
mov r9d, 7
mov rdx, qword [rbp + 0x28]
mov rcx, rsi
call fcn.1800fe120
nop
jmp 0x18005ccb1
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005ccde
mov rax, qword gs:[0x60]
test byte [rax + 0x378], 1
je 0x18005cce7
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
je 0x1800b8b7c
mov rax, qword gs:[0x60]
mov rdi, qword [rax + 0x90]
add rdi, r15
movzx eax, byte [rdi]
mov rcx, rsi
mov r9, qword [rsi + 0xc0]
mov r8, qword [rbp + 0x20]
mov rdx, qword [rbp + 0x28]
mov qword [rsp + 0x30], rax
and qword [rsp + 0x28], 0
shl r9, 4
mov byte [rsp + 0x20], 0
call fcn.1800fdffc
nop
jmp 0x18005cce7
mov rax, qword gs:[0x60]
mov rcx, qword [rax + 0x90]
add rcx, r15
jmp 0x18005cd01
call sym.ntdll.dll_RtlGetCurrentServiceSessionId
test eax, eax
je 0x1800b8be4
mov rax, qword gs:[0x60]
mov rdi, qword [rax + 0x90]
add rdi, r15
movzx eax, byte [rdi]
mov rcx, rsi
mov r9, qword [rsi + 0xc0]
mov r8, qword [rbp + 0x20]
mov rdx, qword [rbp + 0x28]
mov qword [rsp + 0x30], rax
and qword [rsp + 0x28], 0
shl r9, 4
mov byte [rsp + 0x20], 0
call fcn.1800fdffc
nop
jmp 0x18005cd0a
mov rax, qword gs:[0x60]
cmp qword [rax + 0x18], 0
je 0x1800b8c4b
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 0x1800b8c57
lea rcx, str.HEAP:
call sym.ntdll.dll_DbgPrint
mov rax, qword [rbp + 0x20]
lea rcx, str.RtlpHeapFreeVirtualMemory_failed__lx_for_heap__p__base__p__size__Ix__n
mov r9, qword [rbp + 0x28]
mov r8, rsi
mov edx, edi
mov qword [rsp + 0x20], rax
call sym.ntdll.dll_DbgPrint
nop
jmp 0x18005cd12