Function at 0xbef010b0
Capabilities:
Get user security identifier
Query environment variable

Disassembly:
push rbp
push rbx
push rsi
push rdi
mov rbp, rsp
sub rsp, 0x58
mov rax, qword [0xbef0de10]
lea rcx, [rbp + 0x28]
mov qword [rsp + 0x20], rcx
lea r9, [rbp - 0x18]
xor esi, esi
xor ecx, ecx
mov edx, 0xffffffff
mov qword [rbp - 0x18], rsi
mov r8d, 7
mov qword [rbp + 0x40], rsi
xor dil, dil
call rax
test eax, eax
je 0xbef012d3
cmp qword [rbp - 0x18], rsi
je 0xbef012d3
mov rax, qword [0xbef0de10]
lea rcx, [rbp + 0x30]
mov qword [rsp + 0x20], rcx
lea r9, [rbp + 0x40]
xor ecx, ecx
mov edx, 0xffffffff
mov r8d, 5
call rax
test eax, eax
je 0xbef012d3
mov ecx, dword [rbp + 0x28]
xor edx, edx
add ecx, dword [rbp + 0x30]
lea ebx, [rcx + rcx*2]
mov rcx, qword [0xbef0e4e0]
shr ebx, 1
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef0df68], rax
test rax, rax
je 0xbef012d3
mov r8, qword [rbp - 0x18]
mov r9d, 0xffffffff
mov qword [rsp + 0x38], rsi
xor edx, edx
mov qword [rsp + 0x30], rsi
mov ecx, 0xfde9
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rbp + 0x28], eax
test eax, eax
je 0xbef01198
lea ecx, [rax - 1]
mov rax, qword [0xbef0df68]
mov byte [rcx + rax], 0x5c
mov eax, dword [rbp + 0x28]
mov r8, qword [rbp + 0x40]
sub ebx, eax
mov qword [rsp + 0x38], rsi
mov r9d, 0xffffffff
mov eax, eax
xor edx, edx
add rax, qword [0xbef0df68]
mov ecx, 0xfde9
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rdx, qword [rbp + 0x40]
lea rax, [rbp + 0x38]
mov rcx, qword [rbp - 0x18]
lea r9, [rbp + 0x30]
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp + 0x28]
mov dword [rbp + 0x30], esi
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
mov dword [rbp + 0x28], esi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x30]
test edx, edx
jne 0xbef0123e
mov rdx, qword [rbp + 0x40]
lea rax, [rbp + 0x38]
mov qword [rsp + 0x30], rax
lea r9, [rbp + 0x30]
lea rax, [rbp + 0x28]
xor r8d, r8d
mov qword [rsp + 0x28], rax
xor ecx, ecx
mov qword [rsp + 0x20], rsi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x30]
mov dil, 1
test edx, edx
je 0xbef012d3
mov ecx, dword [rbp + 0x28]
inc ecx
mov eax, edx
xor edx, edx
lea r8, [rax + rcx*2]
mov rcx, qword [0xbef0e4e0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef0df60], rax
mov r8, rax
test rax, rax
je 0xbef012d3
mov eax, dword [rbp + 0x30]
lea rdx, [rbp + 0x38]
mov rcx, qword [rbp - 0x18]
lea r9, [rbp + 0x30]
mov qword [rsp + 0x30], rdx
add rax, r8
lea rdx, [rbp + 0x28]
test dil, dil
mov qword [rsp + 0x28], rdx
mov rdx, qword [rbp + 0x40]
cmovne rcx, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0xbef012b6
mov rcx, qword [0xbef0df60]
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov byte [0xbef0df5c], al
jmp 0xbef012d3
mov r8, qword [0xbef0df60]
xor edx, edx
mov rcx, qword [0xbef0e4e0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [0xbef0df60], rsi
mov rcx, qword [rbp + 0x40]
test rcx, rcx
je 0xbef012e2
call qword [0xbef0deb8]
mov rcx, qword [rbp - 0x18]
test rcx, rcx
je 0xbef012f1
call qword [0xbef0deb8]
cmp qword [0xbef0df68], rsi
je 0xbef01307
cmp qword [0xbef0df60], rsi
jne 0xbef01544
xor r8d, r8d
lea rcx, [0xbeef36d8]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
xor r8d, r8d
lea rcx, [0xbeef36f8]
xor edx, edx
mov dword [rbp + 0x28], eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edx, dword [rbp + 0x28]
mov dword [rbp + 0x30], eax
lea ecx, [rax + rdx]
test ecx, ecx
je 0xbef01544
mov rcx, qword [0xbef0e4e0]
lea r8d, [rdx + rax]
add r8, r8
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbp - 0x18], rax
test rax, rax
je 0xbef01544
mov edx, dword [rbp + 0x28]
mov ecx, dword [rbp + 0x30]
add ecx, edx
lea rax, [rax + rdx*2]
xor edx, edx
mov qword [rbp + 0x40], rax
lea ebx, [rcx + rcx*2]
mov rcx, qword [0xbef0e4e0]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef0df68], rax
test rax, rax
je 0xbef01531
mov r8d, dword [rbp + 0x28]
lea rcx, [0xbeef36d8]
mov rdx, qword [rbp - 0x18]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8, qword [rbp - 0x18]
mov r9d, 0xffffffff
mov qword [rsp + 0x38], rsi
xor edx, edx
mov dword [rbp + 0x28], eax
mov ecx, 0xfde9
mov rax, qword [0xbef0df68]
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rbp + 0x28], eax
test eax, eax
je 0xbef013f5
lea ecx, [rax - 1]
mov rax, qword [0xbef0df68]
mov byte [rcx + rax], 0x5c
mov r8d, dword [rbp + 0x30]
lea rcx, [0xbeef36f8]
mov rdx, qword [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8, qword [rbp + 0x40]
mov r9d, 0xffffffff
mov qword [rsp + 0x38], rsi
mov ecx, 0xfde9
mov dword [rbp + 0x30], eax
mov eax, dword [rbp + 0x28]
mov edx, eax
mov qword [rsp + 0x30], rsi
add rdx, qword [0xbef0df68]
sub ebx, eax
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rdx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rdx, qword [rbp + 0x40]
lea rax, [rbp + 0x38]
mov rcx, qword [rbp - 0x18]
lea r9, [rbp + 0x30]
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp + 0x28]
mov dword [rbp + 0x30], esi
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
mov dword [rbp + 0x28], esi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x30]
test edx, edx
jne 0xbef014b2
mov rdx, qword [rbp + 0x40]
lea rax, [rbp + 0x38]
mov qword [rsp + 0x30], rax
lea r9, [rbp + 0x30]
lea rax, [rbp + 0x28]
xor r8d, r8d
mov qword [rsp + 0x28], rax
xor ecx, ecx
mov qword [rsp + 0x20], rsi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x30]
mov dil, 1
test edx, edx
je 0xbef01531
mov ecx, dword [rbp + 0x28]
inc ecx
mov eax, edx
xor edx, edx
lea r8, [rax + rcx*2]
mov rcx, qword [0xbef0e4e0]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef0df60], rax
mov r8, rax
test rax, rax
je 0xbef01531
mov eax, dword [rbp + 0x30]
lea rdx, [rbp + 0x38]
mov rcx, qword [rbp - 0x18]
lea r9, [rbp + 0x30]
mov qword [rsp + 0x30], rdx
add rax, r8
lea rdx, [rbp + 0x28]
test dil, dil
mov qword [rsp + 0x28], rdx
mov rdx, qword [rbp + 0x40]
cmovne rcx, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0xbef0152a
mov rcx, qword [0xbef0df60]
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov byte [0xbef0df5c], al
jmp 0xbef01531
mov qword [0xbef0df60], rsi
mov r8, qword [rbp - 0x18]
xor edx, edx
mov rcx, qword [0xbef0e4e0]
call qword [sym.imp.KERNEL32.dll_HeapFree]
add rsp, 0x58
pop rdi
pop rsi
pop rbx
pop rbp
ret