Function at 0x1400049c0
Capabilities:
Compare security identifiers
Get thread local storage value
Get user security identifier
Query or enumerate registry value

Disassembly:
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x13d0]
mov eax, 0x14d0
call fcn.1400ab0e0
sub rsp, rax
mov qword [rbp - 0x70], 0xfffffffffffffffe
mov qword [rsp + 0x1508], rbx
mov qword [rsp + 0x1510], rsi
mov rax, qword [0x1401222f0]
xor rax, rsp
mov qword [rbp + 0x13c0], rax
mov r15, rcx
mov ecx, 2
call fcn.1400a82f0
mov qword [rsp + 0x40], rax
xor r12d, r12d
mov word [rax], r12w
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x70]
lea edx, [r12 + 8]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140004f4c
mov dword [rbp - 0x78], 0x1000
lea rax, [rbp - 0x78]
mov qword [rsp + 0x20], rax
mov r9d, 0x1000
lea r8, [rbp + 0x3c0]
lea edx, [r12 + 1]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov rcx, qword [rsp + 0x70]
test eax, eax
jne 0x140004a82
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140004f4c
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x50], r12d
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x60]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x50]
xor r8d, r8d
lea rdx, str.System
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov ecx, dword [rsp + 0x50]
call fcn.1400a82f0
mov r14, rax
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x60]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x50]
mov r8, r14
lea rdx, str.System
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov ecx, 0x620
call fcn.1400a82f0
mov rdi, rax
mov qword [rsp + 0x58], rax
mov rdx, qword [rsp + 0x40]
lea r8, [rax + 8]
nop dword [rax]
movzx ecx, word [rdx]
mov word [r8], cx
lea rdx, [rdx + 2]
lea r8, [r8 + 2]
test cx, cx
jne 0x140004b20
lea rcx, str..Default
mov rdx, rax
sub rdx, rcx
movzx eax, word [rcx]
mov word [rdx + rcx + 8], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x140004b41
mov rax, qword [0x140126138]
sub rax, qword [0x140126130]
sar rax, 3
mov dword [rdi + 4], eax
lea rsi, [rdi + 0x210]
lea r9, str.SYSTEM
lea r8, str.NT_AUTHORITY
lea rdx, [0x1400d7708]
mov rcx, rsi
call fcn.1400aa864
test r15, r15
je 0x140004bc4
mov ebx, dword [rdi + 4]
mov rcx, r15
call qword [sym.imp.USER32.dll_GetMenu]
mov rcx, rax
mov edx, 3
call qword [sym.imp.USER32.dll_GetSubMenu]
mov rcx, rax
mov qword [rsp + 0x20], rsi
mov r9d, ebx
mov r8d, 0x400
or edx, 0xffffffff
call qword [sym.imp.USER32.dll_InsertMenuW]
mov rdx, qword [rbp + 0x3c0]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x140004be4
mov byte [rdi], 1
mov qword [0x140125920], rdi
jmp 0x140004be7
mov byte [rdi], 0
lea rcx, [rdi + 0x418]
lea r9, str.Config
lea r8, [0x1401254f0]
lea rdx, [0x1400d7708]
call fcn.1400aa864
lea rax, [rsp + 0x58]
mov rcx, qword [0x140126138]
cmp rax, rcx
jae 0x140004c6c
lea r8, [rsp + 0x58]
mov rax, qword [0x140126130]
cmp rax, r8
ja 0x140004c6c
lea rbx, [rsp + 0x58]
sub rbx, rax
sar rbx, 3
cmp rcx, qword [0x140126140]
jne 0x140004c5e
mov edx, 1
lea rcx, [0x140126130]
call fcn.140011f80
mov rcx, qword [0x140126138]
mov rax, qword [0x140126130]
test rcx, rcx
je 0x140004c9c
mov rax, qword [rax + rbx*8]
mov qword [rcx], rax
jmp 0x140004c95
cmp rcx, qword [0x140126140]
jne 0x140004c8d
mov edx, 1
lea rcx, [0x140126130]
call fcn.140011f80
mov rcx, qword [0x140126138]
test rcx, rcx
je 0x140004c9c
mov qword [rcx], rdi
mov rcx, qword [0x140126138]
add rcx, 8
mov qword [0x140126138], rcx
mov ecx, dword [0x1401252dc]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
or eax, 0x20019
lea rcx, [rsp + 0x68]
mov qword [rsp + 0x20], rcx
mov r9d, eax
xor r8d, r8d
lea rdx, str.SoftwareMicrosoftWindows_NTCurrentVersionProfileList
mov rcx, qword [0x140119a10]
call fcn.1400075c0
test eax, eax
jne 0x140004f3c
lea r8, [rsp + 0x40]
xor edx, edx
mov rcx, qword [rsp + 0x68]
call fcn.1400136a0
test eax, eax
jne 0x140004f31
nop dword [rax]
mov rbx, qword [rsp + 0x40]
mov ecx, dword [0x1401252dc]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
or eax, 0x20019
lea rcx, [rsp + 0x78]
mov qword [rsp + 0x20], rcx
mov r9d, eax
xor r8d, r8d
mov rdx, rbx
mov rcx, qword [rsp + 0x68]
call fcn.1400075c0
test eax, eax
jne 0x140004f14
mov dword [rsp + 0x48], 4
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x80]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1400d77a8]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140004f09
test byte [rbp - 0x80], 8
jne 0x140004f09
mov rcx, qword [rsp + 0x40]
call fcn.140005670
mov rsi, rax
test rax, rax
je 0x140004f09
mov dword [rbp - 0x7c], 0x104
mov dword [rsp + 0x4c], 0x104
lea rax, [rsp + 0x60]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x4c]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x60]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x7c]
lea r8, [rbp + 0x1b0]
mov rdx, rsi
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
test eax, eax
je 0x140004f00
mov ecx, 0x620
call fcn.1400a82f0
mov rdi, rax
mov qword [rsp + 0x58], rax
mov dword [rsp + 0x48], 0x208
lea rcx, [rax + 0x418]
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
xor r9d, r9d
xor r8d, r8d
lea rdx, str.ProfileImagePath
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x140004ef8
mov rcx, qword [rsp + 0x40]
lea rdx, [rdi + 8]
nop dword [rax]
movzx eax, word [rcx]
mov word [rdx], ax
lea rcx, [rcx + 2]
lea rdx, [rdx + 2]
test ax, ax
jne 0x140004e40
mov rax, qword [0x140126138]
sub rax, qword [0x140126130]
sar rax, 3
mov dword [rdi + 4], eax
lea r14, [rdi + 0x210]
lea r9, [rbp + 0x1b0]
lea r8, [rbp - 0x60]
lea rdx, [0x1400d7708]
mov rcx, r14
call fcn.1400aa864
test r15, r15
je 0x140004ec2
mov ebx, dword [rdi + 4]
mov rcx, r15
call qword [sym.imp.USER32.dll_GetMenu]
mov rcx, rax
mov edx, 3
call qword [sym.imp.USER32.dll_GetSubMenu]
mov rcx, rax
mov qword [rsp + 0x20], r14
mov r9d, ebx
mov r8d, 0x400
or edx, 0xffffffff
call qword [sym.imp.USER32.dll_InsertMenuW]
mov rdx, qword [rbp + 0x3c0]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x140004ee2
mov byte [rdi], 1
mov qword [0x140125920], rdi
jmp 0x140004ee5
mov byte [rdi], 0
lea rdx, [rsp + 0x58]
lea rcx, [0x140126130]
call fcn.1400126e0
jmp 0x140004f00
mov rcx, rdi
call fcn.1400a82b0
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_FreeSid]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc r12d
lea r8, [rsp + 0x40]
mov edx, r12d
mov rcx, qword [rsp + 0x68]
call fcn.1400136a0
test eax, eax
je 0x140004d00
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rcx, str.SeRestorePrivilege
call fcn.140005190
test eax, eax
jne 0x140004f75
test r15, r15
je 0x140004f6e
mov rcx, r15
call qword [sym.imp.USER32.dll_GetMenu]
mov r8d, 0x400
mov edx, 3
mov rcx, rax
call qword [sym.imp.USER32.dll_DeleteMenu]
mov byte [0x14012599c], 1
mov rcx, qword [rsp + 0x40]
call fcn.1400a82b0
mov rcx, qword [rbp + 0x13c0]
xor rcx, rsp
call fcn.1400ab140
lea r11, [rsp + 0x14d0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret