Function at 0x18005bdc0
Capabilities:
Create directory

Disassembly:
mov r11, rsp
mov qword [r11 + 8], rcx
push rbx
push rbp
push rsi
push rdi
sub rsp, 0xe8
mov qword [rsp + 0xd0], 0xfffffffffffffffe
mov rdi, rcx
mov rax, qword [rcx]
mov ebx, 0x80070057
xor ebp, ebp
cmp word [rax], bp
cmovne ebx, ebp
test ebx, ebx
js 0x18005c10f
mov qword [r11 - 0x48], rbp
xor eax, eax
mov qword [r11 - 0x88], rax
mov qword [r11 - 0x80], rax
mov qword [r11 - 0x78], rax
mov qword [r11 - 0x70], rax
mov qword [r11 - 0x68], rax
mov qword [r11 - 0x60], rax
mov qword [r11 - 0x58], rax
mov qword [r11 - 0x50], rax
mov dword [r11 - 0x60], 0x18
lea edx, [rbp + 1]
lea rcx, [r11 - 0x88]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x18005bf00
xor r9d, r9d
xor r8d, r8d
lea edx, [rbp + 1]
lea rcx, [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x18005bf00
mov rcx, qword [rsp + 0xc0]
test rcx, rcx
jne 0x18005be94
xor r9d, r9d
lea r8, [rsp + 0xc0]
lea edx, [rbp + 1]
lea rcx, str.S:_ML__NW___LW_
call sub.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW
test eax, eax
je 0x18005beee
mov rcx, qword [rsp + 0xc0]
mov dword [rsp + 0x118], ebp
mov dword [rsp + 0x120], ebp
mov qword [rsp + 0x70], rbp
lea r9, [rsp + 0x120]
lea r8, [rsp + 0x70]
lea rdx, [rsp + 0x118]
call qword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorSacl]
test eax, eax
je 0x18005beee
cmp dword [rsp + 0x118], ebp
je 0x18005beee
mov r8, qword [rsp + 0x70]
test r8, r8
je 0x18005beee
xor r9d, r9d
lea edx, [r9 + 1]
lea rcx, [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorSacl]
lea rax, [rsp + 0x80]
mov qword [rsp + 0xb0], rax
jmp 0x18005bf08
mov rax, qword [rsp + 0xb0]
lea rdx, [rsp + 0xa8]
test rax, rax
cmove rdx, rbp
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x18005bf4e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x18005c0fb
test eax, eax
jg 0x18005bf40
mov ebx, eax
jmp 0x18005c0fb
movzx ebx, ax
or ebx, 0x80070000
jmp 0x18005c0fb
mov qword [rsp + 0x40], rbp
lea rdx, [rsp + 0x40]
lea rcx, str.S_1_5_18
call sub.ADVAPI32.dll_ConvertStringSidToSidW
test eax, eax
je 0x18005c0ea
mov qword [rsp + 0x128], rbp
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x128]
mov edx, 0x20
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x18005c0ea
mov dword [rsp + 0x60], ebp
xor eax, eax
mov dword [rsp + 0x64], eax
mov dword [rsp + 0x68], eax
mov dword [rsp + 0x6c], eax
lea r8, [rsp + 0x64]
lea rdx, str.SeSecurityPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
mov esi, eax
test eax, eax
je 0x18005bff8
mov dword [rsp + 0x6c], 2
mov dword [rsp + 0x60], 1
mov qword [rsp + 0x28], rbp
mov qword [rsp + 0x20], rbp
xor r9d, r9d
lea r8, [rsp + 0x60]
xor edx, edx
mov rcx, qword [rsp + 0x128]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov esi, eax
mov rcx, qword [rsp + 0x128]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x18005c0ea
mov qword [rsp + 0x48], rbp
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x48]
mov edx, 0x20
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x18005c0ea
mov dword [rsp + 0x50], ebp
xor eax, eax
mov dword [rsp + 0x54], eax
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x5c], eax
lea r8, [rsp + 0x54]
lea rdx, str.SeTakeOwnershipPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
mov esi, eax
test eax, eax
je 0x18005c091
mov dword [rsp + 0x5c], 2
mov dword [rsp + 0x50], 1
mov qword [rsp + 0x28], rbp
mov qword [rsp + 0x20], rbp
xor r9d, r9d
lea r8, [rsp + 0x50]
xor edx, edx
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov esi, eax
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x18005c0ea
mov rax, qword [rdi]
cmp dword [rax - 8], 1
jle 0x18005c0b4
mov edx, dword [rax - 0x10]
mov rcx, rdi
call fcn.180007c04
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rbp
mov r9, qword [rsp + 0x40]
mov edx, 1
lea r8d, [rdx + 0x1c]
mov rcx, qword [rdi]
call qword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoW]
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x18005c0fb
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
mov rcx, qword [rsp + 0xc0]
test rcx, rcx
je 0x18005c10f
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
mov rdx, qword [rdi]
sub rdx, 0x18
or ecx, 0xffffffff
lock xadd dword [rdx + 0x10], ecx
add ecx, 0xffffffff
test ecx, ecx
jg 0x18005c133
mov rcx, qword [rdx]
mov r8, qword [rcx]
call qword [rreloc.OLEAUT32.dll_VariantClear + 8]
mov eax, ebx
jmp 0x18005c135
mov eax, ebx
add rsp, 0xe8
pop rdi
pop rsi
pop rbp
pop rbx
ret