Function at 0x140097150
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, str.MACHINE_
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.1400702b0
cmp esi, edi
jne 0x1400971b3
lea rcx, [rsp + 0x58]
mov rdx, rbx
call fcn.14006375c
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.140102a90
xor edx, edx
lea r8d, [rdx + 0x30]
lea rcx, [rsp + 0x100]
call fcn.140102a90
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.140063344
mov rbx, qword [rsp + 0x58]
xor ecx, ecx
mov edi, 1
cmp esi, ecx
je 0x14009732f
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.140063424
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 0x1400972d0
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 0x1400972c3
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
mov ebp, eax
cmp eax, ecx
cmove ebp, edi
jmp 0x1400976b3
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 0x1400972af
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 0x140097333
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 0x1400976b3
lea rax, str.Administrators
xor ebp, ebp
mov ecx, 2
mov qword [rsp + 0xb8], rax
lea rax, str.Everyone
mov dword [rsp + 0x70], ecx
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0x48]
cmp rax, rbp
je 0x1400973bb
cmp word [rax], bp
je 0x1400973bb
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 0x140097436
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 0x1400973e2
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 0x1400976b3
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 0x1400976b3
cmp byte [rsp + 0x178], cl
jle 0x1400976b3
mov rcx, qword [rsp + 0x88]
xor eax, eax
cmp rcx, rax
je 0x1400974c3
call qword [sym.imp.KERNEL32.dll_LocalFree]
xor eax, eax
mov qword [rsp + 0x88], rax
cmp esi, eax
je 0x140097666
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_lstrlenW]
xor ecx, ecx
cmp eax, ecx
mov dword [rsp + 0x160], eax
jle 0x140097505
movsxd rcx, eax
mov edx, 0x5c
cmp dx, word [rbx + rcx*2 - 2]
je 0x1400974fc
mov edx, 0x2f
cmp dx, word [rbx + rcx*2 - 2]
jne 0x140097505
sub eax, edi
mov dword [rsp + 0x160], eax
lea ecx, [rax + 4]
cmp ecx, 0x212
mov dword [rsp + 0x178], ecx
jl 0x140097521
mov ebp, 0x80070057
jmp 0x1400976b3
lea eax, [rax + rax + 0xf]
lea rcx, [rsp + 0x58]
and eax, 0xfffffff8
movsxd rdi, eax
lea rdx, [rdi + 0xab8]
call fcn.140063424
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.14001d78c
lea rcx, [rdi + rsi]
lea rdx, [0x1401202b8]
mov r8d, 0xa
call fcn.14001d78c
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.140101db8
xor ecx, ecx
cmp qword [rsp + 0x68], rcx
je 0x1400976b3
mov rsi, qword [rsp + 0x48]
lea eax, [rcx + 0x2e]
test byte [rsi], 0x10
je 0x1400975d3
cmp ax, word [rsi + 0x2c]
jne 0x1400975d3
cmp cx, word [rsi + 0x2e]
je 0x140097633
cmp ax, word [rsi + 0x2e]
jne 0x1400975d3
cmp cx, word [rsi + 0x30]
je 0x140097633
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 0x140097633
lea r9, [rsi + 0x2c]
lea rdx, [0x1401214d8]
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.140097150
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 0x1400975b6
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x1400976b3
cmp rcx, 0xffffffffffffffff
je 0x1400976b3
call qword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x1400976b3
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 0x1400976b3
mov rdx, qword [rsp + 0x80]
mov rcx, qword [rsp + 0x98]
lea r8, [rsp + 0x58]
call fcn.140096f84
mov rcx, qword [rsp + 0x98]
test rcx, rcx
je 0x1400976c6
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rsp + 0x80]
test rcx, rcx
je 0x1400976d9
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x88]
test rcx, rcx
je 0x1400976ec
call qword [sym.imp.KERNEL32.dll_LocalFree]
lea rcx, [rsp + 0xa8]
call fcn.14005b104
lea rcx, [rsp + 0x58]
call fcn.14005b104
mov eax, ebp
add rsp, 0x138
pop rdi
pop rsi
pop rbp
pop rbx
ret