Function at 0x1401dbe38
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 [0x1403f04b0]
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 0x1401dc3a2
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
cmp eax, 0x7a
je 0x1401dbf9e
call fcn.140048a14
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x1401dbf88
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, [0x1402cb810]
mov r8, rcx
mov eax, r15d
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x1401dbf26
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x1401dbf1c
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 0x1401dbf50
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401dbf46
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, [0x14034ea10]
mov rcx, r10
call fcn.140001078
mov ecx, dword [rsp + 0x40]
movzx eax, cx
or eax, 0x80070000
test ecx, ecx
cmovle eax, ecx
jmp 0x1401dc3eb
mov eax, dword [rsp + 0x4c]
test eax, eax
je 0x1401dc357
cmp dword [rsp + 0x48], r15d
je 0x1401dc357
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.1400a72e0
mov edx, dword [rsp + 0x48]
lea rcx, [rbp + 0x10]
call fcn.14015fe54
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 0x1401dc10a
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.140048a14
mov r10, qword [rax + 8]
cmp dword [r10], 3
jbe 0x1401dc0f3
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, [0x1402cb810]
mov r8, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test rbx, rbx
je 0x1401dc091
mov r8, rbx
mov rax, rdx
inc rax
cmp word [rbx + rax*2], r15w
jne 0x1401dc087
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 0x1401dc0bb
mov rcx, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401dc0b1
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, [0x14034ea10]
mov rcx, r10
call fcn.140001078
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x1401dc347
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 0x1401dc16f
mov r12, qword [rsp + 0x68]
mov r14, qword [rsp + 0x60]
mov r15, qword [r14]
test r15, r15
je 0x1401dc169
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
mov rcx, r15
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.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 0x1401dc1ea
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov dword [rsp + 0x40], eax
call fcn.140048a14
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401dc1d3
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, [0x14034ea58]
call fcn.140001078
mov eax, dword [rsp + 0x40]
movzx ebx, ax
or ebx, 0x80070000
test eax, eax
cmovle ebx, eax
jmp 0x1401dc336
movdqa xmm0, xmmword [0x140307960]
movdqu xmmword [rbp - 0x68], xmm0
mov word [rbp - 0x78], r15w
mov rdx, qword [rbp + 0x18]
cmp rsi, rdx
je 0x1401dc239
sub rdx, rsi
sar rdx, 1
lea rcx, [rbp - 0x78]
cmp rdx, 7
ja 0x1401dc231
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 0x1401dc239
mov r9, rsi
call fcn.140048644
call fcn.140048a14
mov r10, qword [rax + 8]
cmp dword [r10], 5
jbe 0x1401dc328
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, [0x1402cb810]
mov r9, rcx
mov rax, r15
or rdx, 0xffffffffffffffff
test r8, r8
je 0x1401dc293
mov r9, r8
mov rax, rdx
inc rax
cmp word [r8 + rax*2], r15w
jne 0x1401dc289
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 0x1401dc2c0
mov r8, rdi
mov rax, rdx
inc rax
cmp word [rdi + rax*2], r15w
jne 0x1401dc2b6
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 0x1401dc2ef
mov rcx, rax
mov r8, rdx
inc r8
cmp word [rax + r8*2], r15w
jne 0x1401dc2e5
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, [0x14034e98b]
mov rcx, r10
call fcn.140001078
mov ebx, dword [rsp + 0x40]
lea rcx, [rbp - 0x78]
call fcn.1400492c0
nop
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x1401dc347
call qword [sym.imp.api_ms_win_core_heap_l2_1_0.dll_LocalFree]
nop
lea rcx, [rbp + 0x10]
call fcn.140067f0c
mov eax, ebx
jmp 0x1401dc3eb
call fcn.140048a14
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401dc39b
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, [0x14034ea87]
call fcn.140001078
mov eax, 0x80070452
jmp 0x1401dc3eb
call fcn.140048a14
mov rcx, qword [rax + 8]
cmp dword [rcx], 3
jbe 0x1401dc3e6
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, [0x14034ea87]
call fcn.140001078
mov eax, 0x80004005
mov rcx, qword [rbp + 0x40]
xor rcx, rsp
call fcn.14027a710
mov rbx, qword [rsp + 0x1a8]
add rsp, 0x150
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret