Function at 0x40159a
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
sub rsp, 0x688
lea rbp, [rsp + 0x80]
lea rax, [rbp + 0x4e0]
mov r8d, 0x104
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call rax
test eax, eax
jne 0x4015fa
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov r9, rax
mov r8d, 0x22
mov edx, 1
lea rcx, str.Failed_to_get_the_executable_path_n
call sym.fwrite
jmp 0x40185a
lea rax, [rbp + 0x4e0]
mov edx, 0x5c
mov rcx, rax
call sym.strrchr
lea rdx, [rax + 1]
lea rax, [rbp + 0x3d0]
mov r9, rdx
lea r8, str.C:_Users_Public_Documents__s
mov edx, 0x104
mov rcx, rax
call dbg.snprintf
lea rax, [rbp + 0x4e0]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
mov r9d, 0
mov r8d, 0
mov edx, 0x80000000
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbp + 0x5f8], rax
cmp qword [rbp + 0x5f8], 0xffffffffffffffff
jne 0x4016ae
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov ebx, eax
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov r8d, ebx
lea rdx, str.Failed_to_open_source_file:__lu_n
mov rcx, rax
call sym.fprintf
jmp 0x40185a
lea rax, [rbp + 0x3d0]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 2
mov r9d, 0
mov r8d, 0
mov edx, 0x40000000
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbp + 0x5f0], rax
cmp qword [rbp + 0x5f0], 0xffffffffffffffff
jne 0x4017db
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov ebx, eax
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov r8d, ebx
lea rdx, str.Failed_to_open_destination_file:__lu_n
mov rcx, rax
call sym.fprintf
mov rax, qword [rbp + 0x5f8]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
jmp 0x40185a
mov r8d, dword [rbp + 0x3cc]
lea rdx, [rbp + 0x3c8]
lea rax, [rbp - 0x40]
mov rcx, qword [rbp + 0x5f0]
mov qword [rsp + 0x20], 0
mov r9, rdx
mov rdx, rax
mov rax, qword [sym.imp.KERNEL32.dll_WriteFile]
call rax
test eax, eax
je 0x401788
mov edx, dword [rbp + 0x3cc]
mov eax, dword [rbp + 0x3c8]
cmp edx, eax
je 0x4017db
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov ebx, eax
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov r8d, ebx
lea rdx, str.Failed_to_write_to_destination_file:__lu_n
mov rcx, rax
call sym.fprintf
mov rax, qword [rbp + 0x5f8]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov rax, qword [rbp + 0x5f0]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
jmp 0x40185a
lea rdx, [rbp + 0x3cc]
lea rax, [rbp - 0x40]
mov rcx, qword [rbp + 0x5f8]
mov qword [rsp + 0x20], 0
mov r9, rdx
mov r8d, 0x400
mov rdx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReadFile]
call rax
test eax, eax
je 0x40181d
mov eax, dword [rbp + 0x3cc]
test eax, eax
jne 0x401743
mov rax, qword [rbp + 0x5f8]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov rax, qword [rbp + 0x5f0]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
lea rax, [rbp + 0x3d0]
mov rdx, rax
lea rcx, str.File_successfully_copied_to__s_n
call sym.printf
nop
add rsp, 0x688
pop rbx
pop rbp
ret