Function at 0x180004970
Capabilities:
Check if file exists
Copy file
Delete file
Get file size
Read file via mapping

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x250
xor r12d, r12d
mov r14d, r9d
mov r15, r8
mov rsi, rdx
mov edi, r12d
test rdx, rdx
je 0x180004bbd
mov rcx, rdx
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x180004bbd
xor edx, edx
mov word [rsp + 0x40], r12w
mov r8d, 0x206
lea rcx, [rsp + 0x42]
call fcn.180045cf0
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_BeginUpdateResourceW]
mov rbp, rax
test rax, rax
je 0x180004bdb
mov r9d, 0x809
mov dword [rsp + 0x28], r14d
lea edx, [r12 + 2]
mov qword [rsp + 0x20], r15
mov r8d, 0x721
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_UpdateResourceW]
mov edx, r12d
mov rcx, rbp
test eax, eax
mov ebx, eax
sete dl
call qword [sym.imp.KERNEL32.dll_EndUpdateResourceW]
test ebx, ebx
je 0x180004bdb
mov r9, rsi
lea r8, str._s.bak
mov edx, 0x104
lea rcx, [rsp + 0x40]
call fcn.180018f20
xor r8d, r8d
lea rdx, [rsp + 0x40]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x180004bdb
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_BeginUpdateResourceW]
mov rbp, rax
test rax, rax
je 0x180004baa
mov r9d, 0x809
mov dword [rsp + 0x28], r14d
lea edx, [r12 + 2]
mov qword [rsp + 0x20], r15
mov r8d, 0x721
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_UpdateResourceW]
mov edx, r12d
mov rcx, rbp
test eax, eax
mov ebx, eax
sete dl
call qword [sym.imp.KERNEL32.dll_EndUpdateResourceW]
test ebx, ebx
je 0x180004baa
lea r8, [rsp + 0x40]
mov rdx, rsi
call fcn.180003320
mov edi, eax
test eax, eax
je 0x180004baa
mov qword [rsp + 0x30], r12
lea r8d, [r12 + 1]
mov dword [rsp + 0x28], r12d
xor r9d, r9d
mov edx, 0xc0000000
mov dword [rsp + 0x20], 3
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x180004af8
mov edi, r12d
jmp 0x180004baa
xor edx, edx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileSize]
xor r9d, r9d
mov qword [rsp + 0x28], r12
xor edx, edx
mov dword [rsp + 0x20], r12d
mov rcx, rbx
mov ebp, eax
lea r8d, [r9 + 4]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov rcx, rbx
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rdi, rdi
jne 0x180004b37
mov edi, r12d
jmp 0x180004baa
xor r9d, r9d
mov qword [rsp + 0x20], r12
xor r8d, r8d
mov rcx, rdi
lea edx, [r9 + 6]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov rcx, rdi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, r12d
test rbx, rbx
je 0x180004baa
movsxd rsi, dword [rbx + 0x3c]
lea rax, [rsp + 0x2b0]
lea r9, [rsp + 0x280]
mov qword [rsp + 0x20], rax
mov r8d, ebp
mov rdx, rbx
mov dword [rsi + rbx + 0x58], r12d
call fcn.180003530
test rax, rax
je 0x180004ba1
mov eax, dword [rsp + 0x2b0]
mov edi, 1
mov dword [rsi + rbx + 0x58], eax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp word [rsp + 0x40], r12w
je 0x180004bbd
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
mov eax, edi
lea r11, [rsp + 0x250]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret
mov eax, r12d
jmp 0x180004bbf