Function at 0x1402be534
Capabilities:
Check if file exists
Copy file
Create directory
Move file

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x190]
sub rsp, 0x290
mov rax, qword [0x14039bc30]
xor rax, rsp
mov qword [rbp + 0x180], rax
mov rsi, rdx
mov r14, rcx
lea rbx, [rcx + 0x28]
mov qword [rsp + 0x60], rbx
xor r15d, r15d
test rbx, rbx
je 0x1402be581
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
nop
lea rdi, [r14 + 0x48]
mov rdx, rdi
cmp qword [rdi + 0x18], 8
jb 0x1402be592
mov rdx, qword [rdi]
mov r8d, 1
lea rcx, [rsp + 0x30]
call fcn.1402bd19c
xor edx, edx
mov r8d, 0x208
lea rcx, [rsp + 0x70]
call fcn.14013d7a0
mov rdx, rdi
cmp qword [rdi + 0x18], 8
jb 0x1402be5c1
mov rdx, qword [rdi]
mov r8d, 0x104
lea rcx, [rsp + 0x70]
lea rax, [rsp + 0x70]
sub rdx, rax
lea rax, [r8 + 0x7ffffefa]
test rax, rax
je 0x1402be5f6
movzx eax, word [rdx + rcx]
test ax, ax
je 0x1402be5f6
mov word [rcx], ax
add rcx, 2
sub r8, 1
jne 0x1402be5d4
lea rax, [rcx - 2]
test r8, r8
cmovne rax, rcx
mov word [rax], r15w
lea rcx, [rsp + 0x70]
call qword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
xor r8d, r8d
lea rdx, [rsp + 0x70]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
lea rdx, str.trusted.tmp
lea rcx, [rsp + 0x70]
call qword [sym.imp.SHLWAPI.dll_PathAppendW]
xor r8d, r8d
lea rdx, [rsp + 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x1402be6d1
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x1402be658
mov rcx, qword [rdi]
lea rsi, [r14 + 0x48]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1402be693
cmp qword [rsi + 0x18], 8
jb 0x1402be670
mov rsi, qword [rsi]
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], r15
mov r9d, 2
xor r8d, r8d
lea rdx, [rsp + 0x70]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReplaceFileW]
jmp 0x1402be6ab
cmp qword [rsi + 0x18], 8
jb 0x1402be69d
mov rsi, qword [rsi]
mov rdx, rsi
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x1402be740
cmp qword [rdi + 0x18], 8
jb 0x1402be6bd
mov rdi, qword [rdi]
mov r8d, 4
mov rdx, rdi
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_MoveFileExW]
mov rcx, qword [rsp + 0x30]
cmp rcx, 0xffffffffffffffff
je 0x1402be707
cmp dword [rsp + 0x38], r15d
je 0x1402be701
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
or r8d, 0xffffffff
mov r9d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_UnlockFileEx]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, r15d
test rbx, rbx
je 0x1402be718
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov eax, edi
mov rcx, qword [rbp + 0x180]
xor rcx, rsp
call fcn.14013af80
mov rbx, qword [rsp + 0x2d0]
add rsp, 0x290
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
mov rcx, qword [rsp + 0x30]
cmp rcx, 0xffffffffffffffff
je 0x1402be776
cmp dword [rsp + 0x38], r15d
je 0x1402be770
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
or r8d, 0xffffffff
mov r9d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_UnlockFileEx]
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, str.67136527_5D6B_4AC9_865B_3E392E982420
call qword [sym.imp.KERNEL32.dll_GlobalAddAtomW]
mov rcx, r14
call fcn.1402bd8e4
mov rcx, r14
call fcn.1402bdd4c
mov edi, eax
jmp 0x1402be70a