Function at 0x140057920
Capabilities:
Copy file
Get file size
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x20]
sub rsp, 0x120
mov rax, qword [0x140106438]
xor rax, rsp
mov qword [rbp + 0x10], rax
xor r15d, r15d
movsx edx, cl
movzx ecx, word [0x14015b412]
lea rax, str.i386
mov qword [rsp + 0x70], rax
mov r14d, r15d
lea rax, str.amd64
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x78], rax
lea r8d, [r15 + 2]
lea rax, str.minint
mov r12d, 0x1c0
mov qword [rbp - 0x80], rax
lea rax, str.minint_txtsetup.sif
mov qword [rsp + 0x60], rax
lea rax, str.minint_system32_
mov qword [rsp + 0x68], rax
lea rax, str.i386_txtsetup.sif
mov qword [rbp - 0x78], rax
lea rax, str.i386_system32_
mov qword [rbp - 0x70], rax
lea rax, str._amd64_txtsetup.sif
mov qword [rbp - 0x68], rax
lea rax, str._amd64_system32_
mov qword [rbp - 0x60], rax
movzx eax, cl
and al, 0x23
cmp al, 0x23
jne 0x1400579e2
lea r13d, [r15 + 1]
jmp 0x1400579f4
movzx eax, r12w
mov r13d, r15d
and ax, cx
cmp ax, r12w
cmove r13d, r8d
mov ecx, 0xfffffffe
mov qword [rsp + 0x158], rbx
mov eax, r13d
mov edi, edx
and rax, rcx
mov ecx, edx
mov rsi, qword [rsp + rax*8 + 0x70]
call fcn.1400a1974
mov edx, 0x40
mov qword [rsp + 0x28], rsi
lea r9, str._c:_s_ntdetect.com
mov dword [rsp + 0x20], eax
lea rcx, [rbp - 0x30]
lea r8, [rdx - 0x41]
call fcn.1400034e0
mov ecx, edi
mov byte [rbp + 0xf], r14b
call fcn.1400a1974
mov edx, 0x20
mov dword [rsp + 0x20], eax
lea r9, str._c:_ntdetect.com
lea rcx, [rbp - 0x58]
lea r8, [rdx - 0x21]
call fcn.1400034e0
mov r8d, 1
mov byte [rbp - 0x39], r14b
lea rdx, [rbp - 0x58]
lea rcx, [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_CopyFileA]
cmp byte [0x14015b42b], r14b
jne 0x140057b58
mov eax, r13d
lea rbx, [rsp + 0x70]
mov ecx, edi
lea rbx, [rbx + rax*8]
call fcn.1400a1974
mov ecx, eax
lea r9, str._c:_s_txtsetup.sif
mov rax, qword [rbx]
mov edx, 0x40
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], ecx
lea rcx, [rbp - 0x30]
lea r8, [rdx - 0x41]
call fcn.1400034e0
mov ecx, edi
mov byte [rbp + 0xf], r14b
call fcn.1400a1974
mov edx, 0x20
mov dword [rsp + 0x20], eax
lea r9, str._c:_txtsetup.sif
lea rcx, [rbp - 0x58]
lea r8, [rdx - 0x21]
call fcn.1400034e0
mov r8d, 1
mov byte [rbp - 0x39], r14b
lea rdx, [rbp - 0x58]
lea rcx, [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x140057b1e
call fcn.140041e50
mov r9, rax
lea r8, [rbp - 0x58]
lea rdx, [rbp - 0x30]
lea rcx, str.Did_not_copy__s_as__s:__s_n
call fcn.140041aa0
lea rcx, [rbp - 0x58]
call fcn.140021ad0
test rax, rax
jne 0x140057b41
lea rdx, [rbp - 0x58]
lea rcx, str.Failed_to_add_SetupSourceDevice_in__s_n
call fcn.140041aa0
jmp 0x140058032
lea r8, [rbp - 0x58]
lea rdx, str.SetupSourceDevice___deviceharddisk1partition1_
lea rcx, str.Successfully_added__s_to__s_n
call fcn.140041aa0
mov ecx, edi
call fcn.1400a1974
mov edx, 0x40
mov qword [rsp + 0x28], rsi
lea r9, str._c:_s_setupldr.bin
mov dword [rsp + 0x20], eax
lea rcx, [rbp - 0x30]
lea r8, [rdx - 0x41]
call fcn.1400034e0
mov ecx, edi
mov byte [rbp + 0xf], r14b
call fcn.1400a1974
mov edx, 0x20
mov dword [rsp + 0x20], eax
lea r9, str._c:BOOTMGR
lea rcx, [rbp - 0x58]
lea r8, [rdx - 0x21]
call fcn.1400034e0
mov r8d, 1
mov byte [rbp - 0x39], r14b
lea rdx, [rbp - 0x58]
lea rcx, [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x140057be1
call fcn.140041e50
mov r9, rax
lea r8, [rbp - 0x58]
lea rdx, [rbp - 0x30]
lea rcx, str.Did_not_copy__s_as__s:__s_n
call fcn.140041aa0
movzx eax, word [0x14015b412]
test r12w, ax
je 0x140057c27
cmp byte [0x14015b42b], r14b
je 0x140057c0e
lea rcx, str.Detected_minint_directory_with__minint_option:_nothing_to_patch_n
call fcn.140041aa0
mov r15d, 1
jmp 0x140058032
test al, 0x27
jne 0x140058032
lea rcx, str.Detected_minint_directory_only_but_no__minint_option:_not_sure_what_to_do_n
call fcn.140041aa0
jmp 0x140058032
xor r9d, r9d
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x80
lea rcx, [rbp - 0x58]
mov edx, 0xc0000000
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [rsp + 0x58], rax
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140057c7d
call fcn.140041e50
mov r8, rax
lea rdx, [rbp - 0x58]
lea rcx, str.Could_not_open__s_for_patching:__s_n
call fcn.140041aa0
jmp 0x140058032
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [rsp + 0x54], edi
cmp eax, 0xffffffff
jne 0x140057cb0
call fcn.140041e50
mov r8, rax
lea rdx, [rbp - 0x58]
lea rcx, str.Could_not_get_size_for_file__s:__s_n
call fcn.140041aa0
jmp 0x140058024
mov rcx, rdi
call fcn.14009b5b4
mov qword [rsp + 0x40], rax
mov rbx, rax
test rax, rax
je 0x140058021
lea r9, [rsp + 0x50]
mov qword [rsp + 0x20], r15
mov r8d, edi
mov rdx, rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140058004
cmp edi, dword [rsp + 0x50]
jne 0x140058004
mov rdx, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x140057d2c
call fcn.140041e50
mov r8, rax
lea rdx, [rbp - 0x58]
lea rcx, str.Could_not_rewind_file__s:__s_n
call fcn.140041aa0
mov r14, rbx
jmp 0x140058024
lea rdx, [rbp - 0x58]
lea rcx, str.Patching_file__s_n
call fcn.140041aa0
cmp edi, 0x2061
jbe 0x140057d6b
cmp byte [rbx + 0x2060], 0x74
jne 0x140057d6b
cmp byte [rbx + 0x2061], 3
jne 0x140057d6b
lea rcx, str.__0x00002060:_0x74_0x03____0xEB_0x1A__disable_Win2k3_CRC_check__n
mov word [rbx + 0x2060], 0x1aeb
call fcn.140041aa0
lea eax, [rdi - 0x20]
mov r14d, 1
mov dword [rsp + 0x48], eax
cmp eax, r14d
jbe 0x140057e96
mov r12d, 2
nop word [rax + rax]
mov rsi, qword [rsp + r15*8 + 0x60]
lea rdx, str._NULL_
test rsi, rsi
mov edi, r14d
lea rcx, str._NULL_
mov r8, 0xffffffffffffffff
cmovne rdx, rsi
add rdi, rbx
cmovne rcx, rdi
nop dword [rax + rax]
inc r8
cmp byte [rsi + r8], 0
jne 0x140057dc0
dec r8
call fcn.1400a1ed4
test eax, eax
jne 0x140057e71
cmp r13d, 2
jb 0x140057df9
mov r8d, 0x159
lea rdx, str.C:_src_r3dusb_srcwue.c
lea rcx, str.index___2
call fcn.1400a15c4
mov eax, r13d
mov r8, rdi
mov edx, r14d
lea rcx, [r15 + rax*2]
mov rbx, qword [rbp + rcx*8 - 0x78]
lea rcx, str.__0x_08X:__s_____s_n
mov r9, rbx
call fcn.140041aa0
mov rax, rbx
sub rdi, rbx
movzx ecx, byte [rax]
mov byte [rax + rdi], cl
lea rax, [rax + 1]
test cl, cl
jne 0x140057e20
mov rcx, 0xffffffffffffffff
inc rcx
cmp byte [rbx + rcx], 0
jne 0x140057e35
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rsi + rax], 0
jne 0x140057e45
cmp rax, rcx
mov rax, 0xffffffffffffffff
cmova rbx, rsi
nop dword [rax]
inc rax
cmp byte [rbx + rax], 0
jne 0x140057e60
mov rbx, qword [rsp + 0x40]
add r14d, eax
inc r15
sub r12, 1
jne 0x140057d90
mov eax, dword [rsp + 0x48]
inc r14d
mov r15, r12
cmp r14d, eax
jb 0x140057d81
mov rsi, qword [rsp + 0x58]
cmp byte [0x14015b42b], 0
jne 0x140057fc2
mov r14d, r15d
test eax, eax
je 0x140057fc2
mov eax, r13d
lea r12, [rsp + 0x70]
mov r13d, dword [rsp + 0x48]
mov rdi, rbx
lea r12, [r12 + rax*8]
nop dword [rax]
nop word [rax + rax]
test rdi, rdi
lea rcx, str._NULL_
mov r8d, 7
lea rdx, str.rdisk_0_
cmovne rcx, rdi
call fcn.1400a1ed4
test eax, eax
jne 0x140057f12
lea r9d, [rax + 0x31]
mov byte [rdi + 6], 0x31
lea r8, str.rdisk_0_
mov edx, r14d
lea rcx, str.__0x_08X:__s____rdisk__c__n
call fcn.140041aa0
test rdi, rdi
lea rcx, str._NULL_
mov r8d, 0xb
lea rdx, str._win_nt_.bt
cmovne rcx, rdi
lea rsi, [rdi + 0xc]
call fcn.1400a1ed4
test eax, eax
jne 0x140057fab
mov rbx, qword [r12]
lea rcx, str.__0x_08X:__s_____s_s_n
mov r9, rbx
mov qword [rsp + 0x20], rsi
mov r8, rdi
mov edx, r14d
call fcn.140041aa0
mov rdx, rdi
mov rcx, rbx
sub rdx, rbx
movzx eax, byte [rcx]
mov byte [rcx + rdx], al
lea rcx, [rcx + 1]
test al, al
jne 0x140057f61
mov rcx, 0xffffffffffffffff
inc rcx
cmp byte [rbx + rcx], 0
jne 0x140057f76
mov rdx, qword [rsp + 0x40]
add rcx, r15
movzx eax, byte [r15 + rdx + 0xc]
mov byte [rcx + rdx], al
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rbx + rax], 0
jne 0x140057f97
add rax, r15
mov rbx, rdx
mov byte [rax + rdx + 1], 0
inc r14d
inc rdi
inc r15
cmp r14d, r13d
jb 0x140057ed0
mov rsi, qword [rsp + 0x58]
mov r8d, dword [rsp + 0x54]
xor r9d, r9d
mov rdx, rbx
mov rcx, rsi
call fcn.140042b10
test eax, eax
jne 0x140057ff7
call fcn.140041e50
mov rdx, rax
lea rcx, str.Could_not_write_patched_file:__s_n
call fcn.140041aa0
mov r14, qword [rsp + 0x40]
xor r15d, r15d
jmp 0x140058024
mov r14, qword [rsp + 0x40]
mov r15d, 1
jmp 0x140058024
call fcn.140041e50
mov r8, rax
lea rdx, [rbp - 0x58]
lea rcx, str.Could_not_read_file__s:__s_n
call fcn.140041aa0
mov r14, rbx
jmp 0x140058024
mov r14, rax
test rsi, rsi
je 0x140058032
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r14
call fcn.14009b5a0
mov rbx, qword [rsp + 0x158]
mov eax, r15d
mov rcx, qword [rbp + 0x10]
xor rcx, rsp
call fcn.140092060
lea r11, [rsp + 0x120]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret