Function at 0x100161470
Capabilities:
Check if file exists
Create directory
Delete file

Disassembly:
mov rax, rsp
push r14
sub rsp, 0x5a0
mov qword [rax - 0x4e8], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x10022f440]
xor rax, rsp
mov qword [rsp + 0x590], rax
mov rsi, rcx
mov qword [rsp + 0x80], rcx
mov qword [rsp + 0x40], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rsp + 0x40]
mov edx, 4
lea r8d, [rdx - 3]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
jne 0x1001614f3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x3f0
je 0x100161523
or ebx, 0x80130000
xor edi, edi
jmp 0x100161527
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
test eax, eax
jne 0x100161523
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
or ebx, 0x80130000
xor edi, edi
jmp 0x100161527
xor edi, edi
mov ebx, edi
mov ecx, ebx
call fcn.10015ed00
nop
mov rcx, qword [rsi + 0x288]
or rax, 0xffffffffffffffff
nop word [rax + rax]
inc rax
cmp word [rcx + rax*2], 0
jne 0x100161540
test rax, rax
jne 0x100161592
mov word [rsp + 0x330], di
xor edx, edx
mov r8d, 0x208
lea rcx, [rsp + 0x332]
call sub.MSVCR100.dll_memset
mov edx, 0x104
lea rcx, [rsp + 0x330]
call fcn.100160860
lea rcx, [rsi + 0x188]
lea rdx, [rsp + 0x330]
call fcn.100057700
mov rcx, qword [rsi + 0x288]
or rax, 0xffffffffffffffff
nop dword [rax]
inc rax
cmp word [rcx + rax*2], 0
jne 0x1001615a0
test rax, rax
je 0x100161bfd
mov rcx, qword [rsi + 0x288]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x100161698
xor r8d, r8d
mov rdx, qword [rsi + 0x288]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x100161bf9
lea rdx, [rsp + 0x330]
mov rcx, rsi
call fcn.100162d90
nop
lea rcx, [rsi + 0x188]
mov rdx, rax
call fcn.1001527f0
nop
mov rdx, qword [rsp + 0x430]
test rdx, rdx
je 0x100161689
lea rax, [rsp + 0x330]
cmp rdx, rax
je 0x100161689
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0xa0], rax
mov r14d, 0x200
je 0x100161649
cmp word [rax + 4], r14w
jne 0x100161649
mov rax, qword [rax + 0x28]
mov qword [rsp + 0xa0], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0x58], rcx
je 0x100161671
cmp word [rcx + 4], r14w
jne 0x100161671
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0x58], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100161681
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x430], rdi
mov dword [rsi + 0x2a0], 1
jmp 0x100161bf9
lea rax, [rsp + 0x330]
mov qword [rsp + 0x430], rax
mov qword [rsp + 0x438], 0x80
mov qword [rsp + 0x440], rdi
lea rdx, [rsi + 0x188]
lea rcx, [rsp + 0x330]
call fcn.1001527f0
nop
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x1f0], rax
mov qword [rsp + 0x1f8], 0x80
mov qword [rsp + 0x200], rdi
mov rdx, qword [rsp + 0x1f0]
test rdx, rdx
je 0x10016177d
lea rax, [rsp + 0xf0]
cmp rdx, rax
je 0x10016177d
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0x90], rax
mov r14d, 0x200
je 0x10016173b
cmp word [rax + 4], r14w
jne 0x10016173b
mov rax, qword [rax + 0x28]
mov qword [rsp + 0x90], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0x68], rcx
je 0x100161763
cmp word [rcx + 4], r14w
jne 0x100161763
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0x68], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100161773
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x1f0], rdi
jmp 0x100161783
mov r14d, 0x200
mov rdx, rdi
mov qword [rsp + 0x200], rdx
mov eax, 0x80
mov qword [rsp + 0x1f8], rax
lea rcx, [rsp + 0xf0]
mov qword [rsp + 0x1f0], rcx
lea rbx, [0x100045320]
mov qword [rsp + 0x98], rbx
nop word [rax + rax]
cmp word [rbx], 0
je 0x100161818
cmp rax, rdx
jne 0x1001617e0
lea rcx, [rsp + 0xf0]
call fcn.1000577e0
mov rdx, qword [rsp + 0x200]
movzx ecx, word [rbx]
mov rax, qword [rsp + 0x1f0]
mov word [rax + rdx*2], cx
mov rdx, qword [rsp + 0x200]
inc rdx
mov qword [rsp + 0x200], rdx
add rbx, 2
mov qword [rsp + 0x98], rbx
mov rax, qword [rsp + 0x1f8]
jmp 0x1001617c0
cmp rax, rdx
jne 0x100161832
lea rcx, [rsp + 0xf0]
call fcn.1000577e0
mov rdx, qword [rsp + 0x200]
mov rax, qword [rsp + 0x1f0]
mov word [rax + rdx*2], di
inc qword [rsp + 0x200]
lea rdx, [rsp + 0xf0]
lea rcx, [rsp + 0x330]
call fcn.100152470
nop
mov rdx, qword [rsp + 0x1f0]
test rdx, rdx
je 0x1001618dc
lea rax, [rsp + 0xf0]
cmp rdx, rax
je 0x1001618dc
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0x78], rax
je 0x100161896
cmp word [rax + 4], r14w
jne 0x100161896
mov rax, qword [rax + 0x28]
mov qword [rsp + 0x78], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0xa8], rcx
je 0x1001618c4
cmp word [rcx + 4], r14w
jne 0x1001618c4
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0xa8], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x1001618d4
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x1f0], rdi
lea rcx, [rsp + 0xe0]
call qword [sym.imp.ole32.dll_CoCreateGuid]
test eax, eax
js 0x100161b16
movaps xmm0, xmmword [rsp + 0xe0]
movdqa xmmword [rsp + 0xd0], xmm0
mov r8d, 0x26
lea rdx, [rsp + 0x540]
lea rcx, [rsp + 0xd0]
call fcn.10015ef20
lea r11, [rsp + 0x210]
mov qword [rsp + 0x310], r11
mov qword [rsp + 0x318], 0x80
mov qword [rsp + 0x320], rdi
mov rdx, qword [rsp + 0x310]
test rdx, rdx
je 0x1001619c8
lea rax, [rsp + 0x210]
cmp rdx, rax
je 0x1001619c8
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0x88], rax
je 0x100161982
cmp word [rax + 4], r14w
jne 0x100161982
mov rax, qword [rax + 0x28]
mov qword [rsp + 0x88], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0xb8], rcx
je 0x1001619b0
cmp word [rcx + 4], r14w
jne 0x1001619b0
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0xb8], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x1001619c0
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x310], rdi
mov rdx, rdi
mov qword [rsp + 0x320], rdx
mov eax, 0x80
mov qword [rsp + 0x318], rax
lea rcx, [rsp + 0x210]
mov qword [rsp + 0x310], rcx
lea rbx, [rsp + 0x540]
mov qword [rsp + 0xb0], rbx
cmp word [rbx], 0
je 0x100161a58
cmp rax, rdx
jne 0x100161a20
lea rcx, [rsp + 0x210]
call fcn.1000577e0
mov rdx, qword [rsp + 0x320]
movzx ecx, word [rbx]
mov rax, qword [rsp + 0x310]
mov word [rax + rdx*2], cx
mov rdx, qword [rsp + 0x320]
inc rdx
mov qword [rsp + 0x320], rdx
add rbx, 2
mov qword [rsp + 0xb0], rbx
mov rax, qword [rsp + 0x318]
jmp 0x100161a00
cmp rax, rdx
jne 0x100161a72
lea rcx, [rsp + 0x210]
call fcn.1000577e0
mov rdx, qword [rsp + 0x320]
mov rax, qword [rsp + 0x310]
mov word [rax + rdx*2], di
inc qword [rsp + 0x320]
lea rdx, [rsp + 0x210]
lea rcx, [rsp + 0x330]
call fcn.100152470
nop
mov rdx, qword [rsp + 0x310]
test rdx, rdx
je 0x100161b16
lea rax, [rsp + 0x210]
cmp rdx, rax
je 0x100161b16
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0x48], rax
je 0x100161ad6
cmp word [rax + 4], r14w
jne 0x100161ad6
mov rax, qword [rax + 0x28]
mov qword [rsp + 0x48], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0x50], rcx
je 0x100161afe
cmp word [rcx + 4], r14w
jne 0x100161afe
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0x50], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100161b0e
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x310], rdi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [r9 + 1]
mov rcx, qword [rsp + 0x430]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x100161b67
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100161b60
movzx eax, ax
or eax, 0x80070000
mov ecx, eax
call fcn.10015ed00
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x430]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
nop
mov rdx, qword [rsp + 0x430]
test rdx, rdx
je 0x100161bf9
lea rax, [rsp + 0x330]
cmp rdx, rax
je 0x100161bf9
mov rax, rdx
and rax, 0xffffffffffffe000
mov qword [rsp + 0x60], rax
je 0x100161bb9
cmp word [rax + 4], r14w
jne 0x100161bb9
mov rax, qword [rax + 0x28]
mov qword [rsp + 0x60], rax
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
mov qword [rsp + 0x70], rcx
je 0x100161be1
cmp word [rcx + 4], r14w
jne 0x100161be1
mov rcx, qword [rcx + 0x28]
mov qword [rsp + 0x70], rcx
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100161bf1
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rsp + 0x430], rdi
jmp 0x100161bfd
mov rdx, qword [rsp + 0x40]
cmp rdx, 0xffffffffffffffff
je 0x100161c49
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_SetThreadToken]
test eax, eax
jne 0x100161c3e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov rcx, qword [rsp + 0x40]
cmp rcx, 0xffffffffffffffff
je 0x100161c36
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
or edi, 0x80130000
jmp 0x100161c52
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x40], 0xffffffffffffffff
mov ecx, edi
call fcn.10015ed00
mov rcx, qword [rsp + 0x590]
xor rcx, rsp
call fcn.10005f420
lea r11, [rsp + 0x5a0]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop r14
ret