Function at 0x1401f358c
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 [0x14044e770]
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 0x1401f3af6
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
cmp eax, 0x7a
je 0x1401f36f2
call fcn.14004acb4
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x1401f36dc
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, [0x14030cae0]
mov r8, rcx
mov eax, r15d
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x1401f367a
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x1401f3670
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 0x1401f36a4
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401f369a
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, [0x14039de19]
mov rcx, r10
call fcn.140001158
mov ecx, dword [rsp + 0x40]
movzx eax, cx
or eax, 0x80070000
test ecx, ecx
cmovle eax, ecx
jmp 0x1401f3b3f
mov eax, dword [rsp + 0x4c]
test eax, eax
je 0x1401f3aab
cmp dword [rsp + 0x48], r15d
je 0x1401f3aab
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.1400abd0c
mov edx, dword [rsp + 0x48]
lea rcx, [rbp + 0x10]
call fcn.14016b760
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 0x1401f385e
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.14004acb4
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x1401f3847
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, [0x14030cae0]
mov r8, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x1401f37e5
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x1401f37db
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 0x1401f380f
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401f3805
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, [0x14039de19]
mov rcx, r10
call fcn.140001158
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x1401f3a9b
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 0x1401f38c3
mov r12, qword [rsp + 0x68]
mov r14, qword [rsp + 0x60]
mov r15, qword [r14]
test r15, r15
je 0x1401f38bd
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 0x1401f393e
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.14004acb4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401f3927
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, [0x14039754c]
call fcn.140001158
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x1401f3a8a
movdqa xmm0, xmmword [0x14034f9a0]
movdqu xmmword [rbp - 0x68], xmm0
mov word [rbp - 0x78], r15w
mov rdx, qword [rbp + 0x18]
cmp rsi, rdx
je 0x1401f398d
sub rdx, rsi
sar rdx, 1
lea rcx, [rbp - 0x78]
cmp rdx, 7
ja 0x1401f3985
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 0x1401f398d
mov r9, rsi
call fcn.14004a878
call fcn.14004acb4
mov r10, qword [rax + 8]
cmp dword [r10], 5
jbe 0x1401f3a7c
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, [0x14030cae0]
mov r9, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test r8, r8
je 0x1401f39e7
mov r9, r8
mov rax, rdx
inc rax
cmp word [r8 + rax*2], r15w
jne 0x1401f39dd
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 0x1401f3a14
mov r8, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401f3a0a
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 0x1401f3a43
mov rcx, rax
mov r8, rdx
inc r8
cmp word [rax + r8*2], r15w
jne 0x1401f3a39
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, [0x14039dd94]
mov rcx, r10
call fcn.140001158
mov ebx, dword [rsp + 0x40]
lea rcx, [rbp - 0x78]
call fcn.14004b500
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1401f3a9b
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
lea rcx, [rbp + 0x10]
call fcn.140084ac8
mov eax, ebx
jmp 0x1401f3b3f
call fcn.14004acb4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401f3aef
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, [0x1403a26ff]
call fcn.140001158
mov eax, 0x80070452
jmp 0x1401f3b3f
call fcn.14004acb4
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401f3b3a
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, [0x1403a26ff]
call fcn.140001158
mov eax, 0x80004005
mov rcx, qword [rbp + 0x40]
xor rcx, rsp
call fcn.1402ae860
mov rbx, qword [rsp + 0x1a8]
add rsp, 0x150
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret