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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x148
lea rax, str.i386
mov r14, qword [0x1400b4c60]
mov r15d, 1
mov qword [rsp + 0x68], rax
lea rax, str.amd64
mov ebx, ecx
mov qword [rsp + 0x70], rax
lea rax, str.minint
mov qword [rsp + 0x78], rax
lea rax, str.minint_txtsetup.sif
mov qword [rsp + 0x58], rax
lea rax, str.minint_system32_
mov qword [rsp + 0x60], rax
lea rax, str.i386_txtsetup.sif
mov qword [rsp + 0x80], rax
lea rax, str.i386_system32_
mov qword [rsp + 0x88], rax
lea rax, str._amd64_txtsetup.sif
mov qword [rsp + 0x90], rax
lea rax, str._amd64_system32_
mov qword [rsp + 0x98], rax
mov ax, word [r14 + 0x55a]
mov edx, eax
not edx
test dl, 0x23
je 0x140049c17
mov eax, edx
test ax, 0x1c0
sete al
movzx eax, al
lea r15d, [rax + rax]
mov rax, qword [0x1400b4b00]
xor r9d, r9d
xor r8d, r8d
movsx ebx, bl
mov edx, 0x147
lea r13, [rsp + 0x100]
mov rcx, qword [rax]
call qword [sym.imp.USER32.dll_SendMessageW]
mov r12, qword [sym.imp.msvcrt.dll__snprintf]
mov edx, 0x40
mov rcx, r13
mov r9d, eax
lea r8, str.SetupSourceDevice___deviceharddisk_dpartition1_
call r12
mov eax, r15d
mov rdi, qword [sym.imp.msvcrt.dll_toupper]
mov ecx, ebx
and eax, 2
mov byte [rsp + 0x13f], 0
mov rsi, qword [rsp + rax*8 + 0x68]
call rdi
lea r8, str._c:_s_ntdetect.com
mov edx, 0x40
mov r9d, eax
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x20], rsi
mov rcx, rax
mov qword [rsp + 0x40], rax
call r12
mov ecx, ebx
mov byte [rsp + 0xff], 0
call rdi
lea r8, str._c:_ntdetect.com
mov edx, 0x20
mov r9d, eax
lea rax, [rsp + 0xa0]
mov rcx, rax
mov qword [rsp + 0x48], rax
call r12
mov byte [rsp + 0xbf], 0
mov rdx, qword [rsp + 0x48]
mov r8d, 1
mov rcx, qword [rsp + 0x40]
mov rbp, qword [sym.imp.KERNEL32.DLL_CopyFileA]
call rbp
cmp byte [r14 + 0x572], 0
jne 0x140049dca
mov ecx, ebx
call rdi
lea r8, str._c:_s_txtsetup.sif
mov edx, 0x40
mov rcx, qword [rsp + 0x40]
mov r9d, eax
mov eax, r15d
mov rax, qword [rsp + rax*8 + 0x68]
mov qword [rsp + 0x20], rax
call r12
mov ecx, ebx
mov byte [rsp + 0xff], 0
call rdi
mov rcx, qword [rsp + 0x48]
lea r8, str._c:_txtsetup.sif
mov edx, 0x20
mov r9d, eax
call r12
mov byte [rsp + 0xbf], 0
mov rdx, qword [rsp + 0x48]
mov r8d, 1
mov rcx, qword [rsp + 0x40]
call rbp
test eax, eax
jne 0x140049d82
call fcn.140038579
mov r8, qword [rsp + 0x48]
mov rdx, qword [rsp + 0x40]
lea rcx, str.Did_not_copy__s_as__s:__s_n
mov r9, rax
call fcn.1400380b9
lea rbp, [rsp + 0xa0]
xor r9d, r9d
mov r8, r13
lea rdx, str._SetupData_
mov rcx, rbp
call fcn.140023ac5
test rax, rax
jne 0x140049db8
mov rdx, rbp
lea rcx, str.Failed_to_add_SetupSourceDevice_in__s_n
call fcn.1400380b9
jmp 0x14004a1e3
mov r8, rbp
mov rdx, r13
lea rcx, str.Successfully_added__s_to__s_n
call fcn.1400380b9
mov ecx, ebx
lea rbp, [rsp + 0xa0]
call rdi
lea r8, str._c:_s_setupldr.bin
mov edx, 0x40
mov rcx, qword [rsp + 0x40]
mov r9d, eax
mov r12, qword [sym.imp.msvcrt.dll__snprintf]
mov qword [rsp + 0x20], rsi
call r12
mov ecx, ebx
mov byte [rsp + 0xff], 0
call rdi
lea r8, str._c:BOOTMGR
mov edx, 0x20
mov rcx, rbp
mov r9d, eax
call r12
mov byte [rsp + 0xbf], 0
mov rcx, qword [rsp + 0x40]
mov rdx, rbp
mov r8d, 1
call qword [sym.imp.KERNEL32.DLL_CopyFileA]
test eax, eax
jne 0x140049e56
call fcn.140038579
mov rdx, qword [rsp + 0x40]
mov r8, rbp
lea rcx, str.Did_not_copy__s_as__s:__s_n
mov r9, rax
call fcn.1400380b9
mov ax, word [r14 + 0x55a]
test ax, 0x1c0
je 0x140049e9f
cmp byte [r14 + 0x572], 0
je 0x140049e86
lea rcx, str.Detected_minint_directory_with__minint_option:_nothing_to_patch_n
xor ebx, ebx
mov edi, 1
call fcn.1400380b9
jmp 0x14004a1e7
test al, 0x27
jne 0x14004a1e3
lea rcx, str.Detected_minint_directory_only_but_no__minint_option:_not_sure_what_to_do_n
call fcn.1400380b9
jmp 0x14004a1e3
xor edx, edx
mov dword [rsp + 0x28], pe_nt_image_headers64
xor r9d, r9d
mov rcx, rbp
mov qword [rsp + 0x30], rdx
mov r8d, 1
mov edx, 0xc0000000
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.DLL_CreateFileA]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140049ef2
call fcn.140038579
mov rdx, rbp
lea rcx, str.Could_not_open__s_for_patching:__s_n
mov r8, rax
call fcn.1400380b9
jmp 0x14004a1e3
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetFileSize]
mov edi, eax
cmp eax, 0xffffffff
jne 0x140049f1f
call fcn.140038579
mov rdx, rbp
lea rcx, str.Could_not_get_size_for_file__s:__s_n
mov r8, rax
call fcn.1400380b9
xor ebx, ebx
jmp 0x140049f93
mov ecx, eax
call sub.msvcrt.dll_malloc
mov rbx, rax
test rax, rax
je 0x140049f1b
xor eax, eax
lea r9, [rsp + 0x54]
mov r8d, edi
mov rdx, rbx
mov qword [rsp + 0x20], rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.DLL_ReadFile]
test eax, eax
je 0x140049f53
cmp dword [rsp + 0x54], edi
je 0x140049f67
call fcn.140038579
mov rdx, rbp
lea rcx, str.Could_not_read_file__s:__s_n
mov r8, rax
jmp 0x140049f8e
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x140049f9a
call fcn.140038579
mov rdx, rbp
lea rcx, str.Could_not_rewind_file__s:__s_n
mov r8, rax
call fcn.1400380b9
xor edi, edi
jmp 0x14004a1eb
mov rdx, rbp
lea rcx, str.Patching_file__s_n
call fcn.1400380b9
cmp edi, 0x2061
jbe 0x140049fd8
cmp byte [rbx + 0x2060], 0x74
jne 0x140049fd8
cmp byte [rbx + 0x2061], 3
jne 0x140049fd8
mov word [rbx + 0x2060], 0x1aeb
lea rcx, str.__0x00002060:_0x74_0x03____0xEB_0x1A__disable_Win2k3_CRC_check__n
call fcn.1400380b9
mov ebp, 1
lea r12d, [rdi - 0x20]
cmp ebp, r12d
jae 0x14004a0ad
xor r12d, r12d
mov r13, qword [rsp + r12 + 0x58]
mov rcx, r13
call sub.msvcrt.dll_strlen
mov edx, ebp
add rdx, rbx
lea r8, [rax - 1]
mov qword [rsp + 0x40], rdx
mov rdx, r13
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.msvcrt.dll__strnicmp]
test eax, eax
jne 0x14004a095
cmp r15d, 2
jne 0x14004a03a
mov r8d, 0x159
lea rdx, str.wue.c
lea rcx, str.index___2
call qword [sym.imp.msvcrt.dll__wassert]
mov eax, r15d
mov r8, qword [rsp + 0x40]
mov edx, ebp
lea rcx, str.__0x_08X:__s_____s_n
shl rax, 4
lea rax, [rsp + rax + 0x80]
mov rax, qword [rax + r12]
mov r9, rax
mov qword [rsp + 0x48], rax
call fcn.1400380b9
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x40]
call sub.msvcrt.dll_strcpy
mov rcx, r13
call sub.msvcrt.dll_strlen
mov rcx, qword [rsp + 0x48]
mov r13, rax
call sub.msvcrt.dll_strlen
cmp rax, r13
cmovb eax, r13d
add ebp, eax
cmp r12, 8
je 0x14004a0a6
mov r12d, 8
jmp 0x140049fed
inc ebp
jmp 0x140049fdd
cmp byte [r14 + 0x572], 0
je 0x14004a0f8
mov r8d, edi
lea r9, [rsp + 0x54]
mov rdx, rbx
mov rcx, rsi
mov dword [rsp + 0x20], 4
mov edi, 1
call fcn.140038ff2
test eax, eax
jne 0x14004a1eb
call fcn.140038579
lea rcx, str.Could_not_write_patched_file:__s_n
mov rdx, rax
call fcn.1400380b9
jmp 0x140049f93
xor ebp, ebp
mov r14d, ebp
cmp ebp, r12d
jae 0x14004a0b7
lea rax, [rbp + rbx]
mov r8d, 7
lea rdx, str.rdisk_0_
mov qword [rsp + 0x40], rax
mov rcx, rax
call qword [sym.imp.msvcrt.dll__strnicmp]
test eax, eax
jne 0x14004a167
mov rax, qword [0x1400b4b00]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x147
mov rcx, qword [rax]
call qword [sym.imp.USER32.dll_SendMessageW]
lea r8, str.rdisk_0_
mov edx, r14d
lea rcx, str.__0x_08X:__s____rdisk__c__n
lea r9d, [rax + 0x30]
lea eax, [r14 + 6]
mov byte [rbx + rax], r9b
movsx r9d, r9b
call fcn.1400380b9
mov rcx, qword [rsp + 0x40]
mov r8d, 0xb
lea rdx, str._win_nt_.bt
call qword [sym.imp.msvcrt.dll__strnicmp]
test eax, eax
jne 0x14004a1db
mov eax, r15d
mov r8, qword [rsp + 0x40]
mov edx, r14d
lea rcx, str.__0x_08X:__s_____s_s_n
mov r13, qword [rsp + rax*8 + 0x68]
lea rax, [rbx + rbp + 0xc]
lea r14, [rbx + rbp]
mov qword [rsp + 0x20], rax
mov r9, r13
call fcn.1400380b9
mov rcx, qword [rsp + 0x40]
mov rdx, r13
call sub.msvcrt.dll_strcpy
mov rcx, r13
call sub.msvcrt.dll_strlen
mov dl, byte [rbx + rbp + 0xc]
mov rcx, r13
mov byte [r14 + rax], dl
call sub.msvcrt.dll_strlen
mov byte [r14 + rax + 1], 0
inc rbp
jmp 0x14004a0fa
xor ebx, ebx
xor edi, edi
or rsi, 0xffffffffffffffff
lea rax, [rsi - 1]
cmp rax, 0xfffffffffffffffd
ja 0x14004a1fe
mov rcx, rsi
call qword [sym.imp.KERNEL32.DLL_CloseHandle]
mov rcx, rbx
call sub.msvcrt.dll_free
mov eax, edi
add rsp, 0x148
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret