Function at 0x140096400
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 [0x14020a008]
xor rax, rsp
mov qword [rsp + 0x88], rax
mov rbx, rdx
test rcx, rcx
je 0x140096448
movzx eax, word [rcx]
mov word [rsp + 0x30], ax
add ax, 2
mov word [rsp + 0x32], ax
mov rax, qword [rcx + 8]
jmp 0x140096457
mov dword [rsp + 0x30], 0x3e003c
lea rax, str.BaseNamedObjectsPhSvcApiPort
mov r8b, 2
mov qword [rsp + 0x38], rax
lea rdx, [0x14020dc58]
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, [0x14020ae18]
mov edi, eax
call qword [sym.imp.ntdll.dll_RtlLengthSid]
mov rcx, qword [0x140213cd0]
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, [0x14020ae18]
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 + 0x48], 0x30
mov qword [rsp + 0x50], rcx
lea rax, [rsp + 0x30]
mov qword [rsp + 0x70], rcx
lea r8d, [rdi + 2]
mov dword [rsp + 0x20], ecx
lea rdx, [rsp + 0x48]
lea rcx, [0x1402185b8]
mov dword [rsp + 0x60], 0x40
mov r9d, 0xb0
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x68], rbp
call qword [sym.imp.ntdll.dll_NtCreatePort]
mov rcx, qword [0x140213cd0]
mov r8, rbp
xor edx, edx
mov esi, eax
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
nop word [rax + rax]
test esi, esi
js 0x1400966b5
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x1402185b0], eax
nop dword [rax]
nop dword [rax + rax]
xor edx, edx
lea rcx, [0x140095ec0]
call sym.ProcessHacker.exe_PhCreateThread2
sub rdi, 1
jne 0x1400965c0
lea r9d, [rdi + 1]
mov byte [rsp + 0x20], 1
xor r8d, r8d
lea rcx, [0x140213208]
mov edx, 0x1f0003
call qword [sym.imp.ntdll.dll_NtCreateEvent]
test eax, eax
js 0x1400966b7
lea r9d, [rdi + 1]
mov byte [rsp + 0x20], dil
xor r8d, r8d
lea rcx, [0x140213200]
mov edx, 0x1f0003
call qword [sym.imp.ntdll.dll_NtCreateEvent]
mov edi, eax
test eax, eax
jns 0x140096632
mov rcx, qword [0x140213208]
call qword [sym.imp.ntdll.dll_NtClose]
mov eax, edi
jmp 0x1400966b7
test rbx, rbx
je 0x140096660
mov rax, qword [0x140213208]
mov qword [rbx + 8], rax
mov rax, qword [0x140213200]
mov qword [rbx + 0x10], rax
lock or dword [rsp], 0
cmp byte [rbx], 0
je 0x140096660
xor eax, eax
jmp 0x1400966b7
mov rcx, qword [0x140213208]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
test rbx, rbx
je 0x14009667c
cmp byte [rbx], 0
jne 0x1400966b1
mov rcx, qword [0x140213200]
lea r8, [rsp + 0x40]
xor edx, edx
mov qword [rsp + 0x40], 0xfffffffffa0a1f00
call qword [sym.imp.ntdll.dll_NtWaitForSingleObject]
mov edi, eax
test rbx, rbx
je 0x1400966aa
cmp byte [rbx], 0
jne 0x1400966b1
cmp eax, 0x102
jne 0x140096660
mov eax, edi
jmp 0x1400966b7
mov eax, esi
mov rcx, qword [rsp + 0x88]
xor rcx, rsp
call fcn.140161390
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x10]
mov rbp, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
nop
ret