Function at 0x1401557a0
Capabilities:
Set file attributes

Disassembly:
push rdi
push r12
push r14
push r15
sub rsp, 0x2d8
mov rax, qword [0x140672360]
xor rax, rsp
mov qword [rsp + 0x2c0], rax
xor edi, edi
lea rdx, [rsp + 0x70]
mov r14d, edi
mov r12, rcx
xor r15b, r15b
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp rax, 0xffffffffffffffff
je 0x140155a28
mov qword [rsp + 0x308], rbx
mov rcx, rax
mov ebx, dword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_FindClose]
and ebx, 0xfffffffe
mov rcx, r12
mov edx, ebx
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea edx, [rdi + 0x12]
mov r8d, 0x600
mov rcx, r12
call fcn.140155160
cmp rax, 0xffffffffffffffff
je 0x140155835
mov r15b, 1
test rax, rax
je 0x140155a20
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140155a20
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x140155a20
mov qword [rsp + 0x2d0], rsi
mov ebx, edi
mov rsi, rdi
mov qword [rsp + 0x38], rdi
mov dword [rsp + 0x30], edi
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
xor r8d, r8d
lea r9, [rsp + 0x38]
mov rcx, rax
lea edx, [r8 + 0x2a]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
jne 0x140155881
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp ebx, 0x3f0
jne 0x1401558eb
mov qword [rsp + 0x310], rbp
mov ebx, edi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor edx, edx
mov ecx, 0x1fffff
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rbp, rax
test rax, rax
jne 0x1401558bb
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1401558e3
lea r8, [rsp + 0x38]
mov edx, 0x28
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x1401558da
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbp, qword [rsp + 0x310]
test ebx, ebx
jne 0x140155959
mov rcx, qword [rsp + 0x38]
lea rax, [rsp + 0x30]
xor r9d, r9d
mov qword [rsp + 0x20], rax
xor r8d, r8d
lea edx, [rbx + 1]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140155959
mov ecx, dword [rsp + 0x30]
call fcn.140368330
mov rsi, rax
test rax, rax
je 0x140155959
mov r9d, dword [rsp + 0x30]
lea rax, [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
lea edx, [rbx + 1]
mov r8, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x140155953
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14, rsi
mov rsi, rdi
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x140155969
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
call fcn.1403683a0
test r14, r14
je 0x140155a18
mov rbx, qword [r14]
test rbx, rbx
je 0x140155a18
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
lea esi, [rax + 0x14]
mov ecx, esi
call fcn.140368330
mov rdi, rax
test rax, rax
je 0x140155a18
mov edx, 1
lea rcx, [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x140155a18
mov r8d, 2
mov edx, esi
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x140155a18
mov r9, rbx
mov edx, 2
mov r8d, 0xc01f0000
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x140155a18
xor r9d, r9d
lea rcx, [rsp + 0x40]
mov r8, rdi
lea edx, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x140155a18
lea r8, [rsp + 0x40]
mov edx, 4
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_SetFileSecurityW]
test eax, eax
je 0x140155a18
mov r15b, 1
mov rsi, qword [rsp + 0x2d0]
mov rbx, qword [rsp + 0x308]
mov rcx, rdi
call fcn.1403683a0
mov rcx, r14
call fcn.1403683a0
movzx eax, r15b
mov rcx, qword [rsp + 0x2c0]
xor rcx, rsp
call fcn.140359070
add rsp, 0x2d8
pop r15
pop r14
pop r12
pop rdi
ret