Function at 0x140046b60
Capabilities:
Get session user name
Get token membership

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x2e8
mov ebx, r9d
mov esi, r8d
mov rdi, rdx
mov r12, qword [rsp + 0x358]
mov rax, qword [0x1401f0038]
xor rax, rsp
mov qword [rsp + 0x2e0], rax
mov r14, qword [r12]
mov qword [r12], 0
test r14, r14
je 0x140046bb7
mov rcx, r14
call fcn.1400480b0
mov rcx, r14
call fcn.14012c4dc
lea r14, [rsp + 0xcc]
mov dword [r14], 0x101
lea r15, [rsp + 0xd0]
mov r8d, 0x202
mov rcx, r15
mov dl, 0xaa
call fcn.14012ffe0
mov rcx, r15
mov rdx, r14
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
xor eax, eax
mov qword [rsp + 0xc0], rax
movabs rcx, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0xb8], rcx
movaps xmm0, xmmword [0x1401c1a20]
movaps xmmword [rsp + 0xa0], xmm0
movaps xmmword [rsp + 0x90], xmm0
movaps xmmword [rsp + 0x80], xmm0
mov dword [rsp + 0x7c], 0xaaaaaaaa
mov qword [rsp + 0x70], rax
cmp byte [rdi + 0x17], 0
mov rcx, rdi
jns 0x140046c3e
mov rcx, qword [rdi]
lea r15, [rsp + 0xc0]
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], rax
lea r14, [rsp + 0xb8]
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rax
mov edx, esi
mov r8d, 4
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
cmp eax, 5
jne 0x140046cba
mov rdx, rdi
mov r8d, esi
call fcn.140046610
test al, al
je 0x140046cbe
cmp byte [rdi + 0x17], 0
mov rcx, rdi
jns 0x140046c93
mov rcx, qword [rdi]
mov qword [rsp + 0x38], r15
xor eax, eax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rax
mov edx, esi
mov r8d, 4
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
test eax, eax
je 0x140046d09
xor ebx, ebx
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140046cd0
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0xc0]
test rcx, rcx
je 0x140046ce3
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x2e0]
xor rcx, rsp
call fcn.14012d050
mov eax, ebx
add rsp, 0x2e8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, qword [rsp + 0xb8]
lea rdx, [rsp + 0x7c]
lea r8, [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_GetExplicitEntriesFromAclW]
test eax, eax
jne 0x140046cbe
mov eax, dword [rsp + 0x7c]
test eax, eax
je 0x140046d94
mov ebp, ebx
not ebp
xor r15d, r15d
mov r13, qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
xor r14d, r14d
jmp 0x140046d5b
mov rax, qword [rsp + 0x70]
and dword [rax + r15], ebp
mov eax, dword [rsp + 0x7c]
inc r14
mov ecx, eax
add r15, 0x30
cmp r14, rcx
jae 0x140046d94
mov rcx, qword [rsp + 0x70]
cmp dword [rcx + r15 + 4], 3
jne 0x140046d4d
cmp dword [rcx + r15 + 0x1c], 0
jne 0x140046d4d
mov dword [rsp + 0x48], 0xaaaaaaaa
mov rdx, qword [rcx + r15 + 0x28]
xor ecx, ecx
lea r8, [rsp + 0x48]
call r13
test eax, eax
je 0x140046d49
cmp dword [rsp + 0x48], 0
jne 0x140046d40
jmp 0x140046d49
mov dword [rsp + 0x20], 3
lea r14, [rsp + 0x80]
lea rdx, [rsp + 0xd0]
mov rcx, r14
mov r8d, ebx
mov r9d, 1
call qword [sym.imp.ADVAPI32.dll_BuildExplicitAccessWithNameW]
xor eax, eax
lea r9, [rsp + 0x68]
mov qword [r9], rax
mov qword [rsp + 0x60], rax
mov ecx, 1
mov rdx, r14
xor r8d, r8d
call qword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
je 0x140046e0b
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140046df2
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140046cbe
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x140046cbe
mov r8, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x70]
mov ecx, dword [rsp + 0x7c]
lea r9, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x140046de2
mov rbx, qword [rsp + 0x60]
lea r14, [rsp + 0x48]
mov rcx, r14
mov rdx, rdi
call fcn.140046a60
mov rcx, qword [r14]
xor eax, eax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
mov edx, esi
mov r8d, 4
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
mov ebx, eax
mov rcx, qword [r14]
test rcx, rcx
je 0x140046e8b
mov rax, qword [rsp + 0x50]
cmp rax, rcx
je 0x140046e81
add rax, 0xfffffffffffffffe
jne 0x140046e71
jmp 0x140047017
mov qword [rsp + 0x50], rcx
call fcn.14012c4dc
cmp ebx, 5
jne 0x140046ec2
mov rdx, rdi
mov r8d, esi
call fcn.140046610
mov ebx, 5
test al, al
je 0x140046ec2
jmp 0x140046fa3
add rax, 0xfffffffffffffffe
je 0x140047017
cmp rax, rcx
jne 0x140046ea9
mov qword [rsp + 0x50], rcx
call fcn.14012c4dc
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140046ed2
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140046ee2
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebx, ebx
sete bl
jne 0x140046cc0
cmp byte [rsp + 0x350], 0
jne 0x140046cc0
mov ecx, 0x30
call fcn.14012c4a0
mov rbx, rax
mov rcx, rax
call fcn.140048090
mov r14, qword [r12]
mov qword [r12], rbx
test r14, r14
je 0x140046f31
mov rcx, r14
call fcn.1400480b0
mov rcx, r14
call fcn.14012c4dc
mov rbx, qword [r12]
cmp rbx, rdi
je 0x140046f59
cmp byte [rbx + 0x17], 0
movzx r8d, byte [rdi + 0x17]
js 0x140046ff5
test r8b, r8b
jns 0x140046f93
mov rdx, qword [rdi]
mov r8, qword [rdi + 8]
mov rcx, rbx
call fcn.14007e260
mov rax, qword [rsp + 0xb8]
mov rcx, qword [r12]
mov qword [rcx + 0x20], rax
mov rax, qword [r12]
mov rcx, qword [rax + 0x28]
mov rdx, qword [rsp + 0xc0]
mov qword [rax + 0x28], rdx
mov qword [rsp + 0xc0], rcx
mov rax, qword [r12]
mov dword [rax + 0x18], esi
mov bl, 1
jmp 0x140046cc0
mov rax, qword [rdi + 0x10]
mov qword [rbx + 0x10], rax
movups xmm0, xmmword [rdi]
movups xmmword [rbx], xmm0
jmp 0x140046f59
mov rbx, qword [rsp + 0x60]
lea r14, [rsp + 0x48]
mov rcx, r14
mov rdx, rdi
call fcn.140046a60
mov rcx, qword [r14]
xor eax, eax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rax
mov edx, esi
mov r8d, 4
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
mov ebx, eax
mov rcx, qword [r14]
test rcx, rcx
je 0x140046ec2
mov rax, qword [rsp + 0x50]
jmp 0x140046eb3
test r8b, r8b
js 0x140047000
and r8d, 0x7f
jmp 0x140047007
mov r8, qword [rdi + 8]
mov rdi, qword [rdi]
mov rcx, rbx
mov rdx, rdi
call fcn.14007e170
jmp 0x140046f59
lea rax, str.null_pointer_given_to_destroy_at
mov qword [rsp + 0x20], rax
lea rcx, str._s:_d:_assertion__s_failed:__s_n
lea rdx, str....._third_partylibc_srcinclude__memoryconstruct_at.h
lea r9, str.__loc___nullptr
mov r8d, 0x44
call fcn.140168d70
int3