Function at 0x140022700
Capabilities:
Check if file exists
Compare security identifiers
Get file attributes

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0x90
xor esi, esi
mov byte [rbp + 0x77], 0
xor r15b, r15b
mov qword [rbp - 0x19], rsi
mov r13d, esi
mov qword [rbp - 0x21], rsi
mov r12d, esi
mov qword [rbp - 9], rsi
mov qword [rbp - 1], rsi
mov qword [rbp + 7], rsi
mov qword [rbp - 0x11], rsi
mov byte [rbp + 0x6f], 0
call fcn.140042340
mov rdi, rax
nop
mov rcx, rdi
call fcn.140042c20
lea rcx, [0x140084158]
mov rbx, rax
call fcn.140042c20
cmp rax, rbx
jg 0x14002280c
sub rbx, rax
mov byte [rsp + 0x30], sil
mov qword [rsp + 0x28], rax
lea r9, [0x140084158]
mov rdx, rbx
mov qword [rsp + 0x20], rsi
mov r8, rax
mov rcx, rdi
call fcn.140042650
test eax, eax
jne 0x14002280c
mov rcx, rdi
call fcn.140042c20
lea rcx, [0x140083cd8]
mov rbx, rax
call fcn.140042c20
cmp rax, rbx
jg 0x14002280c
sub rbx, rax
mov byte [rsp + 0x30], sil
mov qword [rsp + 0x28], rax
lea r9, [0x140083cd8]
mov rdx, rbx
mov qword [rsp + 0x20], rsi
mov r8, rax
mov rcx, rdi
call fcn.140042650
test eax, eax
jne 0x14002280c
mov rcx, rdi
call fcn.140042c20
xor edx, edx
mov rcx, rdi
lea r8, [rax - 1]
call fcn.140042ce0
mov rcx, rdi
mov rbx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rdi, rbx
jmp 0x140022750
mov r14d, 1
mov rcx, rdi
mov edx, r14d
call fcn.140042350
mov rcx, rax
mov qword [rbp + 0x17], rax
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140022a97
and eax, 0x410
cmp eax, 0x10
jne 0x140022a97
lea rcx, [rbp - 0x19]
call fcn.140022510
test al, al
je 0x140022a7e
lea rcx, [rbp - 0x21]
call fcn.1400223c0
test al, al
je 0x140022a7a
lea rax, [rbp + 7]
mov edx, r14d
mov qword [rsp + 0x38], rax
lea r9, [rbp - 9]
lea rax, [rbp - 1]
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x28], rax
lea r8d, [r14 + 4]
mov rcx, rbx
mov qword [rsp + 0x20], rsi
call qword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoW]
test eax, eax
je 0x1400228c3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.W32Util_IsDirectorySafe
lea rcx, str._s:_GetNamedSecurityInfoW_failed:__d_n
call fcn.14001bf60
mov r13, qword [rbp - 0x19]
mov r12, qword [rbp - 0x21]
jmp 0x140022aad
cmp qword [rbp - 1], rsi
jne 0x1400228ec
mov r8, rdi
lea rdx, str.W32Util_IsDirectorySafe
lea rcx, str._s:_Failed_DACL_presence_check____s__n
call fcn.14001bf60
mov r13, qword [rbp - 0x19]
mov r12, qword [rbp - 0x21]
jmp 0x140022aad
mov rdx, qword [rbp - 9]
mov r13, qword [rbp - 0x19]
mov r12, qword [rbp - 0x21]
test rdx, rdx
je 0x140022927
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x140022927
mov rdx, qword [rbp - 9]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x140022927
lea rcx, str._s:_Failed_owner_SID_match____s__n
jmp 0x140022a9e
mov rcx, qword [rbp + 7]
lea r8, [rbp + 0xf]
lea rdx, [rbp + 0x7f]
call qword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorControl]
test eax, eax
jne 0x14002295e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.W32Util_IsDirectorySafe
lea rcx, str._s:_GetSecurityDescriptorControl_failed:__d_n
call fcn.14001bf60
jmp 0x140022aad
mov eax, 0x1000
test word [rbp + 0x7f], ax
jne 0x140022975
lea rcx, str._s:_Failed_DACL_inherit_check____s__n
jmp 0x140022a9e
mov rcx, qword [rbp - 1]
lea r8, [rbp - 0x11]
lea rdx, [rbp - 0x29]
call qword [sym.imp.ADVAPI32.dll_GetExplicitEntriesFromAclW]
test eax, eax
je 0x1400229ac
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.W32Util_IsDirectorySafe
lea rcx, str._s:_GetExplicitEntriesFromAclW_failed:__d_n
call fcn.14001bf60
jmp 0x140022aad
cmp dword [rbp - 0x29], 2
je 0x1400229be
lea rcx, str._s:_Failed_DACL_num_entries_check____s__n
jmp 0x140022a9e
mov rbx, rsi
mov rax, qword [rbp - 0x11]
cmp dword [rbx + rax + 0x1c], 0
jne 0x140022a71
mov r14, qword [rbx + rax + 0x28]
mov rdx, r13
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x140022a08
mov rax, qword [rbp - 0x11]
cmp dword [rbx + rax + 4], 1
jne 0x140022a44
mov eax, dword [rbx + rax]
and eax, 0x12019f
cmp eax, 0x12019f
jne 0x140022a44
mov r14b, 1
mov byte [rbp + 0x6f], r14b
jmp 0x140022a49
mov rdx, r12
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x140022a44
mov rax, qword [rbp - 0x11]
movzx r14d, byte [rbp + 0x6f]
cmp dword [rbx + rax + 4], 1
jne 0x140022a49
mov eax, dword [rbx + rax]
and eax, 0x12019f
movzx r15d, r15b
cmp eax, 0x12019f
mov eax, 1
cmove r15d, eax
jmp 0x140022a49
movzx r14d, byte [rbp + 0x6f]
inc esi
add rbx, 0x30
cmp esi, dword [rbp - 0x29]
jb 0x1400229c1
test r15b, r15b
je 0x140022a68
test r14b, r14b
je 0x140022a68
mov byte [rbp + 0x77], 1
jmp 0x140022aad
lea rcx, str._s:_Failed_cur_user_and_admin_ACE_presence_check____s__n
jmp 0x140022a9e
lea rcx, str._s:_Failed_trustee_SID_identity_check____s__n
jmp 0x140022a9e
mov r12, qword [rbp - 0x21]
lea rdx, str.W32Util_IsDirectorySafe
lea rcx, str._s:_Couldnt_get_local_admin_or_user_SID_n
call fcn.14001bf60
mov r13, qword [rbp - 0x19]
jmp 0x140022aad
lea rcx, str._s:_Failed_directory_attributes_check____s__n
mov r8, rdi
lea rdx, str.W32Util_IsDirectorySafe
call fcn.14001bf60
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp + 0x17]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, r13
mov dword [rax], edi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rbp + 7]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rbp - 0x11]
call qword [sym.imp.KERNEL32.dll_LocalFree]
movzx eax, byte [rbp + 0x77]
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret