Function at 0x180058640
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], r9
mov qword [rsp + 8], rcx
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
mov r15, r8
mov r13, rdx
xor edx, edx
mov byte [rsp + 0x20], dl
mov qword [rsp + 0x30], rdx
mov qword [rsp + 0x28], rdx
mov rax, qword gs:[0x60]
mov r10, qword [rax + 0x18]
cmp byte [r10 + 0x48], dl
jne 0x1800b782c
lea rax, [r13 - 1]
cmp rax, 0xfffffffffffffffc
ja 0x1800588aa
test r8, r8
je 0x1800588aa
mov qword [rcx], rdx
mov edx, dword [rsp + 0xe8]
and edx, 0x100
lea rcx, [rsp + 0x30]
call fcn.180058f2c
mov edi, eax
mov dword [rsp + 0x24], eax
xor edx, edx
test eax, eax
js 0x180058877
mov rcx, qword gs:[0x60]
lea r8d, [rdx + 0x60]
mov rcx, qword [rcx + 0x30]
call sym.ntdll.dll_RtlAllocateHeap
mov rbx, rax
mov qword [rsp + 0x28], rax
xor edx, edx
test rax, rax
je 0x18005886c
lea r12, [rax + 0x30]
mov qword [r12], rdx
mov r8, qword [rsp + 0x30]
mov edx, dword [rsp + 0xe8]
mov rcx, rax
call fcn.180058ec0
mov edi, eax
mov dword [rsp + 0x24], eax
xor edx, edx
test eax, eax
js 0x18005887c
mov byte [rsp + 0x20], 1
lea r14, [rbx + 0x10]
mov qword [r14], rdx
mov dword [rbx + 0x18], edx
mov qword [rbx + 0x20], r15
mov rax, qword [rsp + 0xd8]
mov qword [rbx + 0x28], rax
mov qword [rbx + 0x38], r13
cmp dword [rsp + 0xe0], 0xffffffff
jne 0x18005884a
mov qword [rbx + 0x40], rdx
mov qword [rbx + 0x48], rdx
mov qword [rbx + 0x50], rdx
mov dword [rbx + 0x58], edx
mov dword [rsp + 0x40], 3
mov qword [rsp + 0x48], rdx
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x58], rdx
xorps xmm0, xmm0
movdqa xmmword [rsp + 0x60], xmm0
mov qword [rsp + 0x70], rdx
mov dword [rsp + 0x78], edx
mov dword [rsp + 0x7c], 1
mov dword [rsp + 0x80], 0x48
mov eax, edx
test byte [rsp + 0xe8], 0xc4
jne 0x180058830
test byte [rsp + 0xe8], 0x10
jne 0x18005883e
lea rax, [0x1800575f0]
mov qword [rsp + 0x70], rax
lea r9, [rsp + 0x40]
mov r8, rbx
lea rdx, [0x180076ef0]
mov rcx, r12
call sym.ntdll.dll_TpAllocWait
mov edi, eax
mov dword [rsp + 0x24], eax
xor edx, edx
test eax, eax
js 0x18005887c
mov rcx, r14
call sym.ntdll.dll_RtlAcquireSRWLockExclusive
nop
mov rax, qword [rsp + 0xc0]
mov qword [rax], rbx
xor r9d, r9d
mov r8, qword [rbx + 0x48]
mov rdx, r13
mov rcx, qword [r12]
call sym.ntdll.dll_TpSetWaitEx
nop
mov rcx, r14
call sym.ntdll.dll_RtlReleaseSRWLockExclusive
xor edx, edx
mov ebx, edx
mov qword [rsp + 0x28], rdx
mov edi, edx
mov dword [rsp + 0x24], edx
jmp 0x18005887c
mov eax, 2
mov dword [rsp + 0x78], eax
jmp 0x1800587ae
or eax, 1
mov dword [rsp + 0x78], eax
jmp 0x1800587bc
mov eax, dword [rsp + 0xe0]
mov qword [rbx + 0x40], rax
lea rcx, [rbx + 0x40]
imul rax, rax, 0xffffffffffffd8f0
mov qword [rcx], rax
mov qword [rbx + 0x48], rcx
jmp 0x18005875b
mov edi, 0xc0000017
mov dword [rsp + 0x24], edi
jmp 0x18005887c
mov rbx, qword [rsp + 0x28]
test rbx, rbx
jne 0x1800b7836
mov rcx, qword [rsp + 0x30]
call fcn.1800588b4
mov eax, edi
mov rbx, qword [rsp + 0xc8]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
mov eax, 0xc000000d
jmp 0x180058891
mov eax, 0xc0000001
jmp 0x180058891
cmp byte [rsp + 0x20], dl
je 0x1800b7849
mov rcx, qword [rbx]
test rcx, rcx
je 0x1800b7849
call sym.ntdll.dll_NtClose
mov rcx, qword gs:[0x60]
mov r8, qword [rsp + 0x28]
xor edx, edx
mov rcx, qword [rcx + 0x30]
call sym.ntdll.dll_RtlFreeHeap
mov edi, dword [rsp + 0x24]
jmp 0x180058885