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

Disassembly:
push rbp
push rbx
push rdi
mov rbp, rsp
sub rsp, 0x50
mov rax, qword [0xbef016f0]
lea rcx, [rbp + 0x20]
xor edi, edi
mov qword [rsp + 0x20], rcx
lea r9, [rbp - 0x10]
mov qword [rbp - 0x10], rdi
mov edx, 0xffffffff
mov qword [rbp + 0x38], rdi
xor ecx, ecx
lea r8d, [rdi + 7]
call rax
test eax, eax
je 0xbeef88a5
cmp qword [rbp - 0x10], rdi
je 0xbeef88a5
mov rax, qword [0xbef016f0]
lea rcx, [rbp + 0x28]
mov qword [rsp + 0x20], rcx
lea r9, [rbp + 0x38]
xor ecx, ecx
lea r8d, [rdi + 5]
mov edx, 0xffffffff
call rax
test eax, eax
je 0xbeef88a5
mov ecx, dword [rbp + 0x20]
xor edx, edx
add ecx, dword [rbp + 0x28]
lea ebx, [rcx + rcx*2]
mov rcx, qword [0xbef01d50]
shr ebx, 1
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef01818], rax
test rax, rax
je 0xbeef88a5
mov r8, qword [rbp - 0x10]
lea r9d, [rdi - 1]
mov qword [rsp + 0x38], rdi
xor edx, edx
mov qword [rsp + 0x30], rdi
mov ecx, 0xfde9
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rbp + 0x20], eax
test eax, eax
je 0xbeef878e
lea ecx, [rax - 1]
mov rax, qword [0xbef01818]
mov byte [rcx + rax], 0x5c
mov eax, dword [rbp + 0x20]
mov r8, qword [rbp + 0x38]
sub ebx, eax
mov qword [rsp + 0x38], rdi
mov r9d, 0xffffffff
mov eax, eax
xor edx, edx
add rax, qword [0xbef01818]
mov ecx, 0xfde9
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov rdx, qword [rbp + 0x38]
lea rax, [rbp + 0x30]
mov rcx, qword [rbp - 0x10]
lea r9, [rbp + 0x28]
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp + 0x20]
mov dword [rbp + 0x28], edi
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdi
mov dword [rbp + 0x20], edi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x28]
test edx, edx
jne 0xbeef882d
mov rdx, qword [rbp + 0x38]
lea rax, [rbp + 0x30]
mov qword [rsp + 0x30], rax
lea r9, [rbp + 0x28]
lea rax, [rbp + 0x20]
xor r8d, r8d
mov qword [rsp + 0x28], rax
xor ecx, ecx
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x28]
test edx, edx
je 0xbeef88a5
mov ecx, dword [rbp + 0x20]
inc ecx
mov eax, edx
xor edx, edx
lea r8, [rax + rcx*2]
mov rcx, qword [0xbef01d50]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef01810], rax
test rax, rax
je 0xbeef88a5
mov ecx, dword [rbp + 0x28]
lea rdx, [rbp + 0x30]
mov qword [rsp + 0x30], rdx
lea r9, [rbp + 0x28]
add rcx, rax
lea rdx, [rbp + 0x20]
mov qword [rsp + 0x28], rdx
mov r8, rax
mov rdx, qword [rbp + 0x38]
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbp - 0x10]
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0xbeef889e
mov rcx, qword [0xbef01810]
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov byte [0xbef0180c], al
jmp 0xbeef88a5
mov qword [0xbef01810], rdi
mov rcx, qword [rbp + 0x38]
test rcx, rcx
je 0xbeef88b4
call qword [0xbef01780]
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0xbeef88c3
call qword [0xbef01780]
cmp qword [0xbef01818], rdi
jne 0xbeef8aff
xor r8d, r8d
lea rcx, str.COMPUTERNAME
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
xor r8d, r8d
lea rcx, str.USERNAME
xor edx, edx
mov dword [rbp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edx, dword [rbp + 0x20]
mov dword [rbp + 0x28], eax
add edx, eax
je 0xbeef8aff
mov rcx, qword [0xbef01d50]
mov r8d, edx
xor edx, edx
add r8, r8
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbp - 0x10], rax
test rax, rax
je 0xbeef8aff
mov edx, dword [rbp + 0x20]
mov ecx, dword [rbp + 0x28]
add ecx, edx
lea rax, [rax + rdx*2]
xor edx, edx
mov qword [rbp + 0x38], rax
lea ebx, [rcx + rcx*2]
mov rcx, qword [0xbef01d50]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef01818], rax
test rax, rax
je 0xbeef8aec
mov r8d, dword [rbp + 0x20]
lea rcx, str.COMPUTERNAME
mov rdx, qword [rbp - 0x10]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8, qword [rbp - 0x10]
mov r9d, 0xffffffff
mov qword [rsp + 0x38], rdi
xor edx, edx
mov dword [rbp + 0x20], eax
mov ecx, 0xfde9
mov rax, qword [0xbef01818]
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [rbp + 0x20], eax
test eax, eax
je 0xbeef89ba
lea ecx, [rax - 1]
mov rax, qword [0xbef01818]
mov byte [rcx + rax], 0x5c
mov r8d, dword [rbp + 0x28]
lea rcx, str.USERNAME
mov rdx, qword [rbp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8, qword [rbp + 0x38]
mov r9d, 0xffffffff
mov qword [rsp + 0x38], rdi
mov ecx, 0xfde9
mov dword [rbp + 0x28], eax
mov eax, dword [rbp + 0x20]
mov edx, eax
mov qword [rsp + 0x30], rdi
add rdx, qword [0xbef01818]
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 + 0x38]
lea rax, [rbp + 0x30]
mov rcx, qword [rbp - 0x10]
lea r9, [rbp + 0x28]
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp + 0x20]
mov dword [rbp + 0x28], edi
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdi
mov dword [rbp + 0x20], edi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x28]
test edx, edx
jne 0xbeef8a74
mov rdx, qword [rbp + 0x38]
lea rax, [rbp + 0x30]
mov qword [rsp + 0x30], rax
lea r9, [rbp + 0x28]
lea rax, [rbp + 0x20]
xor r8d, r8d
mov qword [rsp + 0x28], rax
xor ecx, ecx
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov edx, dword [rbp + 0x28]
test edx, edx
je 0xbeef8aec
mov ecx, dword [rbp + 0x20]
inc ecx
mov eax, edx
xor edx, edx
lea r8, [rax + rcx*2]
mov rcx, qword [0xbef01d50]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [0xbef01810], rax
test rax, rax
je 0xbeef8aec
mov ecx, dword [rbp + 0x28]
lea rdx, [rbp + 0x30]
mov qword [rsp + 0x30], rdx
lea r9, [rbp + 0x28]
add rcx, rax
lea rdx, [rbp + 0x20]
mov qword [rsp + 0x28], rdx
mov r8, rax
mov rdx, qword [rbp + 0x38]
mov qword [rsp + 0x20], rcx
mov rcx, qword [rbp - 0x10]
call qword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
je 0xbeef8ae5
mov rcx, qword [0xbef01810]
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov byte [0xbef0180c], al
jmp 0xbeef8aec
mov qword [0xbef01810], rdi
mov r8, qword [rbp - 0x10]
xor edx, edx
mov rcx, qword [0xbef01d50]
call qword [sym.imp.KERNEL32.dll_HeapFree]
add rsp, 0x50
pop rdi
pop rbx
pop rbp
ret