Function at 0x14020885c
Capabilities:
Get user security identifier

Disassembly:
mov rax, rsp
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x50]
sub rsp, 0x150
mov qword [rbp - 0x80], 0xfffffffffffffffe
mov qword [rax + 0x20], rbx
mov rax, qword [0x14049e510]
xor rax, rsp
mov qword [rbp + 0x40], rax
mov r14, r8
mov rdi, rdx
mov rbx, rcx
xor r15d, r15d
mov dword [rsp + 0x4c], r15d
mov dword [rsp + 0x48], r15d
mov dword [rsp + 0x40], r15d
lea rax, [rsp + 0x50]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x4c]
xor r8d, r8d
call qword [sym.imp.api_ms_win_security_lsalookup_l2_1_0.dll_LookupAccountNameW]
test eax, eax
jne 0x140208dc6
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
cmp eax, 0x7a
je 0x1402089c2
call fcn.14004d8a4
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x1402089ac
lea rax, str.Failed_to_query_sid___first_call_to_LookupAccountName_failed_with_unexpected_error_code
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], 0xb0
lea rax, [rsp + 0x40]
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], 4
lea rcx, [0x140344690]
mov r8, rcx
mov eax, r15d
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x14020894a
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x140208940
mov qword [rbp - 0x10], r8
lea eax, [rax*2 + 2]
mov dword [rbp - 8], eax
mov dword [rbp - 4], r15d
mov rax, r15
test rdi, rdi
je 0x140208974
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x14020896a
mov qword [rbp], rcx
lea eax, [rax*2 + 2]
mov dword [rbp + 8], eax
mov dword [rbp + 0xc], r15d
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 6
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e05a2]
mov rcx, r10
call fcn.140001158
mov ecx, dword [rsp + 0x40]
movzx eax, cx
or eax, 0x80070000
test ecx, ecx
cmovle eax, ecx
jmp 0x140208e0f
mov eax, dword [rsp + 0x4c]
test eax, eax
je 0x140208d7b
cmp dword [rsp + 0x48], r15d
je 0x140208d7b
mov byte [rsp + 0x44], r15b
mov edx, eax
mov qword [rsp + 0x60], r14
lea rax, [rsp + 0x44]
mov qword [rsp + 0x68], rax
movaps xmm0, xmmword [rsp + 0x60]
movdqa xmmword [rsp + 0x60], xmm0
lea r8, [rsp + 0x60]
mov rcx, r14
call fcn.1400b6050
mov edx, dword [rsp + 0x48]
lea rcx, [rbp + 0x10]
call fcn.1401776f4
nop
lea rax, [rsp + 0x50]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x48]
mov qword [rsp + 0x28], rax
mov rsi, qword [rbp + 0x10]
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x4c]
mov r8, qword [r14]
mov rdx, rdi
mov rcx, rbx
call qword [sym.imp.api_ms_win_security_lsalookup_l2_1_0.dll_LookupAccountNameW]
test eax, eax
jne 0x140208b2e
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.14004d8a4
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x140208b17
lea rax, str.Failed_to_query_sid___second_call_to_LookupAccountName_failed.
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], 0x7e
lea rax, [rsp + 0x40]
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], 4
lea rcx, [0x140344690]
mov r8, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x140208ab5
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x140208aab
mov qword [rbp - 0x10], r8
lea eax, [rax*2 + 2]
mov dword [rbp - 8], eax
mov dword [rbp - 4], r15d
mov rax, r15
test rdi, rdi
je 0x140208adf
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x140208ad5
mov qword [rbp], rcx
lea eax, [rax*2 + 2]
mov dword [rbp + 8], eax
mov dword [rbp + 0xc], r15d
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 6
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e05a2]
mov rcx, r10
call fcn.140001158
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x140208d6b
mov qword [rsp + 0x58], r15
lea rax, [rsp + 0x58]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], r15
mov byte [rsp + 0x70], 1
lea rdx, [rsp + 0x68]
mov rcx, qword [r14]
call qword [sym.imp.api_ms_win_security_sddl_l1_1_0.dll_ConvertSidToStringSidW]
test eax, eax
sete r13b
cmp byte [rsp + 0x70], r15b
je 0x140208b93
mov r12, qword [rsp + 0x68]
mov r14, qword [rsp + 0x60]
mov r15, qword [r14]
test r15, r15
je 0x140208b8d
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, ebx
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_SetLastError]
mov qword [r14], r12
xor r15d, r15d
test r13b, r13b
je 0x140208c0e
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x140208bf7
lea rax, str.Failed_to_query_sid___converting_sid_to_string_failed
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], WSAStartup
lea rax, [rsp + 0x40]
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], 4
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 4
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403d97e3]
call fcn.140001158
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x140208d5a
movdqa xmm0, xmmword [0x14038ac40]
movdqu xmmword [rbp - 0x68], xmm0
mov word [rbp - 0x78], r15w
mov rdx, qword [rbp + 0x18]
cmp rsi, rdx
je 0x140208c5d
sub rdx, rsi
sar rdx, 1
lea rcx, [rbp - 0x78]
cmp rdx, 7
ja 0x140208c55
mov qword [rbp - 0x68], rdx
lea rbx, [rdx + rdx]
mov r8, rbx
mov rdx, rsi
call qword [sym.imp.api_ms_win_crt_private_l1_1_0.dll_memmove]
mov word [rbp + rbx - 0x78], r15w
jmp 0x140208c5d
mov r9, rsi
call fcn.14004d458
call fcn.14004d8a4
mov r10, qword [rax + 8]
cmp dword [r10], 5
jbe 0x140208d4c
lea rax, str.Sid_successfully_retrieved
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], 0x36
lea r8, [rbp - 0x78]
cmp qword [rbp - 0x60], 8
cmovae r8, qword [rbp - 0x78]
lea rcx, [0x140344690]
mov r9, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test r8, r8
je 0x140208cb7
mov r9, r8
mov rax, rdx
inc rax
cmp word [r8 + rax*2], r15w
jne 0x140208cad
mov qword [rbp - 0x20], r9
lea eax, [rax*2 + 2]
mov dword [rbp - 0x18], eax
mov dword [rbp - 0x14], r15d
mov r8, rcx
mov rax, r15
test rdi, rdi
je 0x140208ce4
mov r8, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x140208cda
mov qword [rbp - 0x10], r8
lea eax, [rax*2 + 2]
mov dword [rbp - 8], eax
mov dword [rbp - 4], r15d
mov r8, r15
mov rax, qword [rsp + 0x58]
test rax, rax
je 0x140208d13
mov rcx, rax
mov r8, rdx
inc r8
cmp word [rax + r8*2], r15w
jne 0x140208d09
mov qword [rbp], rcx
lea eax, [r8*2 + 2]
mov dword [rbp + 8], eax
mov dword [rbp + 0xc], r15d
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 6
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e0555]
mov rcx, r10
call fcn.140001158
mov ebx, dword [rsp + 0x40]
lea rcx, [rbp - 0x78]
call fcn.14004e0f0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x140208d6b
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
lea rcx, [rbp + 0x10]
call fcn.14008903c
mov eax, ebx
jmp 0x140208e0f
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x140208dbf
lea rax, str.Failed_to_query_sid___sid_or_domain_size_is_0
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 0x5c
lea rax, [rbp + 0x10]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e0652]
call fcn.140001158
mov eax, 0x80070452
jmp 0x140208e0f
call fcn.14004d8a4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x140208e0a
lea rax, str.Failed_to_query_sid___calling_LookupAccountName_for_the_first_time_should_return_false
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 0xae
lea rax, [rbp + 0x10]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1403e0652]
call fcn.140001158
mov eax, 0x80004005
mov rcx, qword [rbp + 0x40]
xor rcx, rsp
call fcn.1402dfdb0
mov rbx, qword [rsp + 0x1a8]
add rsp, 0x150
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret