Function at 0x140080960
Capabilities:
Allocate thread local storage

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
sub rsp, 0x90
mov rax, qword [0x140237008]
xor rax, rsp
mov qword [rsp + 0x88], rax
mov rbx, rdx
test rcx, rcx
je 0x1400809a8
movzx eax, word [rcx]
mov word [rsp + 0x60], ax
add ax, 2
mov word [rsp + 0x62], ax
mov rax, qword [rcx + 8]
jmp 0x1400809b7
mov dword [rsp + 0x60], 0x3e003c
lea rax, str.BaseNamedObjectsPhSvcApiPort
mov r8b, 2
mov qword [rsp + 0x68], rax
lea rdx, [0x14023b448]
lea rcx, [rsp + 0x78]
call qword [sym.imp.ntdll.dll_RtlInitializeSid]
xor edx, edx
lea rcx, [rsp + 0x78]
call qword [sym.imp.ntdll.dll_RtlSubAuthoritySid]
mov edx, 1
lea rcx, [rsp + 0x78]
mov dword [rax], 0x20
call qword [sym.imp.ntdll.dll_RtlSubAuthoritySid]
lea rcx, ds:[rsp + 0x78]
mov dword [rax], 0x220
call qword [sym.imp.ntdll.dll_RtlLengthSid]
lea rcx, [0x140237fe8]
mov edi, eax
call qword [sym.imp.ntdll.dll_RtlLengthSid]
mov rcx, qword [0x140241998]
mov edx, 4
add eax, 0x48
add edi, eax
mov r8d, edi
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov rcx, rax
mov edx, 1
mov rbp, rax
call qword [sym.imp.ntdll.dll_RtlCreateSecurityDescriptor]
lea edx, [rdi - 0x28]
mov edi, 2
mov r8d, edi
lea rcx, [rbp + 0x28]
call qword [sym.imp.ntdll.dll_RtlCreateAcl]
lea r9, [rsp + 0x78]
mov r8d, 0x1f0001
mov edx, edi
lea rcx, [rbp + 0x28]
call qword [sym.imp.ntdll.dll_RtlAddAccessAllowedAce]
lea r9, [0x140237fe8]
mov edx, edi
lea r8d, [rdi - 1]
lea rcx, [rbp + 0x28]
call qword [sym.imp.ntdll.dll_RtlAddAccessAllowedAce]
xor r9d, r9d
lea r8, [rbp + 0x28]
mov dl, 1
mov rcx, rbp
call qword [sym.imp.ntdll.dll_RtlSetDaclSecurityDescriptor]
xor ecx, ecx
mov dword [rsp + 0x30], 0x30
mov qword [rsp + 0x38], rcx
lea rax, [rsp + 0x60]
mov qword [rsp + 0x58], rcx
lea r8d, [rdi + 2]
mov dword [rsp + 0x20], ecx
lea rdx, [rsp + 0x30]
lea rcx, [0x140246558]
mov dword [rsp + 0x48], 0x40
mov r9d, 0xb0
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x50], rbp
call qword [sym.imp.ntdll.dll_NtCreatePort]
mov rcx, qword [0x140241998]
mov r8, rbp
xor edx, edx
mov esi, eax
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
nop word [rax + rax]
test esi, esi
js 0x140080c15
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x140246550], eax
nop dword [rax]
nop dword [rax + rax]
xor edx, edx
lea rcx, [0x140080180]
call sym.ProcessHacker.exe_PhCreateThread2
sub rdi, 1
jne 0x140080b20
lea r9d, [rdi + 1]
mov byte [rsp + 0x20], 1
xor r8d, r8d
lea rcx, [0x140240f58]
mov edx, 0x1f0003
call qword [sym.imp.ntdll.dll_NtCreateEvent]
test eax, eax
js 0x140080c17
lea r9d, [rdi + 1]
mov byte [rsp + 0x20], dil
xor r8d, r8d
lea rcx, [0x140240f50]
mov edx, 0x1f0003
call qword [sym.imp.ntdll.dll_NtCreateEvent]
mov edi, eax
test eax, eax
jns 0x140080b95
lfence
mov rcx, qword [0x140240f58]
call qword [sym.imp.ntdll.dll_NtClose]
mov eax, edi
jmp 0x140080c1a
test rbx, rbx
je 0x140080bc0
mov rax, qword [0x140240f58]
mov qword [rbx + 8], rax
mov rax, qword [0x140240f50]
mov qword [rbx + 0x10], rax
lock or dword [rsp], 0
cmp byte [rbx], 0
je 0x140080bc0
xor eax, eax
jmp 0x140080c1a
mov rcx, qword [0x140240f58]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
test rbx, rbx
je 0x140080bdc
cmp byte [rbx], 0
jne 0x140080c11
mov rcx, qword [0x140240f50]
lea r8, [rsp + 0x70]
xor edx, edx
mov qword [rsp + 0x70], 0xfffffffffa0a1f00
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov edi, eax
test rbx, rbx
je 0x140080c0a
cmp byte [rbx], 0
jne 0x140080c11
cmp eax, 0x102
jne 0x140080bc0
mov eax, edi
jmp 0x140080c1a
mov eax, esi
lfence
mov rcx, qword [rsp + 0x88]
xor rcx, rsp
call fcn.1401848a0
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x10]
mov rbp, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret