Function at 0x140098e18
Capabilities:
Get session user name
Get user security identifier

Disassembly:
mov qword [rsp + 0x18], r8
mov byte [rsp + 0x10], dl
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
sub rsp, 0x138
movsx eax, dl
mov rbx, rcx
xor edi, edi
mov esi, eax
and al, 0xbf
lea rdx, [0x1401200c0]
and esi, 0x40
mov rbp, r8
mov qword [rsp + 0x48], r8
cmp esi, edi
mov dword [rsp + 0x60], esi
mov byte [rsp + 0x178], al
cmovne rdx, rcx
lea rcx, [rsp + 0x58]
call fcn.14006d8b0
cmp esi, edi
jne 0x140098e7b
lea rcx, [rsp + 0x58]
mov rdx, rbx
call fcn.140061a7c
xor edx, edx
lea rcx, [rsp + 0xd4]
mov qword [rsp + 0x88], rdi
lea r8d, [rdx + 0x2c]
mov qword [rsp + 0xb0], rdi
mov qword [rsp + 0x80], rdi
mov dword [rsp + 0xd0], edi
call fcn.1400fa350
xor edx, edx
lea r8d, [rdx + 0x30]
lea rcx, [rsp + 0x100]
call fcn.1400fa350
mov eax, esi
lea rcx, [rsp + 0xa8]
neg eax
mov qword [rsp + 0x98], rdi
sbb eax, eax
and eax, 0xfffffffd
add eax, 4
mov dword [rsp + 0x50], eax
call fcn.140061664
mov rbx, qword [rsp + 0x58]
xor ecx, ecx
mov edi, 1
cmp esi, ecx
je 0x140098ff7
mov eax, 0x80000
lea rcx, [rsp + 0xa8]
mov edx, 0x181450
mov dword [rsp + 0x78], 0xa28
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x68], eax
call fcn.140061744
mov r11d, dword [rsp + 0x78]
mov rcx, qword [rsp + 0xa8]
mov edx, dword [rsp + 0x40]
mov r8, qword [rsp + 0x170]
lea rax, [rcx + r11*2]
xor r9d, r9d
add rdx, rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0xa0], rdx
mov dword [rsp + 0x90], r9d
cmp word [r8], r9w
jne 0x140098f98
lea rdx, [rsp + 0x78]
mov rbp, rcx
mov qword [rsp + 0x48], rcx
call qword [sym.imp.ADVAPI32.DLL_GetUserNameW]
xor ecx, ecx
cmp eax, ecx
jne 0x140098f8b
call qword [sym.imp.KERNEL32.DLL_GetLastError]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
cmove ebp, edi
jmp 0x14009937b
mov rax, qword [rsp + 0x70]
mov rdx, qword [rsp + 0xa0]
lea rcx, [rsp + 0x90]
lea r9, [rsp + 0x40]
mov r8, rax
mov qword [rsp + 0x30], rcx
lea rcx, [rsp + 0x68]
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x20], rdx
mov rdx, rbp
xor ecx, ecx
call qword [sym.imp.ADVAPI32.DLL_LookupAccountNameW]
xor ecx, ecx
cmp eax, ecx
je 0x140098f77
mov ebp, dword [rsp + 0x50]
mov r9, qword [rsp + 0x70]
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x20], rcx
mov edx, ebp
mov r8d, edi
mov rcx, rbx
call qword [sym.imp.ADVAPI32.DLL_SetNamedSecurityInfoW]
xor ecx, ecx
jmp 0x140098ffb
mov ebp, dword [rsp + 0x50]
lea rax, [rsp + 0x88]
xor r9d, r9d
mov edx, ebp
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rcx
lea rax, [rsp + 0xb0]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
lea r8d, [r9 + 4]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.DLL_GetNamedSecurityInfoW]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
jne 0x14009937b
lea rax, [0x1401200a0]
xor ebp, ebp
mov ecx, 2
mov qword [rsp + 0xb8], rax
lea rax, [0x140120088]
mov dword [rsp + 0x70], ecx
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0x48]
cmp rax, rbp
je 0x140099083
cmp word [rax], bp
je 0x140099083
mov ecx, edi
mov qword [rsp + 0xb8], rax
mov dword [rsp + 0x70], ecx
movsxd rax, ecx
mov edx, ebp
cmp rax, rbp
mov dword [rsp + 0x40], edx
mov qword [rsp + 0x48], rax
jle 0x1400990fe
mov eax, esi
mov rsi, qword [rsp + 0x48]
mov rbx, rdx
neg eax
sbb ebp, ebp
and ebp, 0x10ffc0
movsxd rax, edx
mov rdx, qword [rsp + rbx*8 + 0xb8]
lea r8d, [rbp + 0xf003f]
lea rcx, [rax + rax*2]
mov r9d, 2
mov dword [rsp + 0x20], 3
add rcx, rcx
lea rcx, [rsp + rcx*8 + 0xd0]
call qword [sym.imp.ADVAPI32.DLL_BuildExplicitAccessWithNameW]
mov edx, dword [rsp + 0x40]
add rbx, rdi
add edx, edi
cmp rbx, rsi
mov dword [rsp + 0x40], edx
jl 0x1400990aa
mov rbx, qword [rsp + 0x58]
mov esi, dword [rsp + 0x60]
mov ecx, dword [rsp + 0x70]
mov r8, qword [rsp + 0xb0]
lea r9, [rsp + 0x80]
lea rdx, [rsp + 0xd0]
call qword [sym.imp.ADVAPI32.DLL_SetEntriesInAclW]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
jne 0x14009937b
mov rax, qword [rsp + 0x80]
mov edx, dword [rsp + 0x50]
mov qword [rsp + 0x30], rcx
mov qword [rsp + 0x28], rax
lea r8d, [rcx + 4]
mov qword [rsp + 0x20], rcx
mov rcx, rbx
xor r9d, r9d
call qword [sym.imp.ADVAPI32.DLL_SetNamedSecurityInfoW]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
jne 0x14009937b
cmp byte [rsp + 0x178], cl
jle 0x14009937b
mov rcx, qword [rsp + 0x88]
xor eax, eax
cmp rcx, rax
je 0x14009918b
call qword [sym.imp.KERNEL32.DLL_LocalFree]
xor eax, eax
mov qword [rsp + 0x88], rax
cmp esi, eax
je 0x14009932e
mov rcx, rbx
call qword [sym.imp.KERNEL32.DLL_lstrlenW]
xor ecx, ecx
cmp eax, ecx
mov dword [rsp + 0x160], eax
jle 0x1400991cd
movsxd rcx, eax
mov edx, 0x5c
cmp dx, word [rbx + rcx*2 - 2]
je 0x1400991c4
mov edx, 0x2f
cmp dx, word [rbx + rcx*2 - 2]
jne 0x1400991cd
sub eax, edi
mov dword [rsp + 0x160], eax
lea ecx, [rax + 4]
cmp ecx, 0x212
mov dword [rsp + 0x178], ecx
jl 0x1400991e9
mov ebp, 0x80070057
jmp 0x14009937b
lea eax, [rax + rax + 0xf]
lea rcx, [rsp + 0x58]
and eax, 0xfffffff8
movsxd rdi, eax
lea rdx, [rdi + 0xab8]
call fcn.140061744
mov rbx, qword [rsp + 0x58]
lea rax, [rdi + rbx]
mov rdx, rbx
lea rsi, [rax + 0x250]
mov qword [rsp + 0x48], rax
movsxd rax, dword [rsp + 0x160]
lea rdi, [rax + rax]
mov rcx, rsi
mov r8, rdi
call fcn.14001d310
lea rcx, [rdi + rsi]
lea rdx, [0x1401181e8]
mov r8d, 0xa
call fcn.14001d310
mov r8, qword [rsp + 0x48]
xor eax, eax
mov word [rsi + 0x422], ax
lea rcx, [rsp + 0x68]
mov rdx, rsi
mov qword [rsp + 0x68], rax
call fcn.1400f96dc
xor ecx, ecx
cmp qword [rsp + 0x68], rcx
je 0x14009937b
mov rsi, qword [rsp + 0x48]
lea eax, [rcx + 0x2e]
test byte [rsi], 0x10
je 0x14009929b
cmp ax, word [rsi + 0x2c]
jne 0x14009929b
cmp cx, word [rsi + 0x2e]
je 0x1400992fb
cmp ax, word [rsi + 0x2e]
jne 0x14009929b
cmp cx, word [rsi + 0x30]
je 0x1400992fb
lea rcx, [rsi + 0x2c]
call qword [sym.imp.KERNEL32.DLL_lstrlenW]
movsxd rcx, eax
movsxd rax, dword [rsp + 0x178]
add rcx, rax
cmp rcx, 0x211
jge 0x1400992fb
lea r9, [rsi + 0x2c]
lea rdx, [0x140118440]
lea rcx, [rsi + 0x674]
mov r8, rbx
call qword [sym.imp.USER32.DLL_wsprintfW]
mov r8, qword [rsp + 0x170]
mov dl, byte [rsp + 0x168]
xor eax, eax
lea rcx, [rsi + 0x674]
mov word [rsi + 0xa96], ax
call fcn.140098e18
mov rcx, qword [rsp + 0x68]
mov rdx, rsi
call qword [sym.imp.KERNEL32.DLL_FindNextFileW]
xor ecx, ecx
cmp eax, ecx
lea eax, [rcx + 0x2e]
jne 0x14009927e
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x14009937b
cmp rcx, 0xffffffffffffffff
je 0x14009937b
call qword [sym.imp.KERNEL32.DLL_FindClose]
jmp 0x14009937b
mov rdx, qword [rsp + 0x160]
lea rax, [rsp + 0x98]
mov r9d, 0xf003f
xor r8d, r8d
mov rcx, 0xffffffff80000002
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.DLL_RegOpenKeyExW]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
jne 0x14009937b
mov rdx, qword [rsp + 0x80]
mov rcx, qword [rsp + 0x98]
lea r8, [rsp + 0x58]
call fcn.140098c4c
mov rcx, qword [rsp + 0x98]
test rcx, rcx
je 0x14009938e
call qword [sym.imp.ADVAPI32.DLL_RegCloseKey]
mov rcx, qword [rsp + 0x80]
test rcx, rcx
je 0x1400993a1
call qword [sym.imp.KERNEL32.DLL_LocalFree]
mov rcx, qword [rsp + 0x88]
test rcx, rcx
je 0x1400993b4
call qword [sym.imp.KERNEL32.DLL_LocalFree]
lea rcx, [rsp + 0xa8]
call fcn.140059370
lea rcx, [rsp + 0x58]
call fcn.140059370
mov eax, ebp
add rsp, 0x138
pop rdi
pop rsi
pop rbp
pop rbx
ret