Function at 0x140047c56
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 [0x1400b1a80]
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 + 0x42a]
mov edx, eax
not edx
test dl, 0x23
je 0x140047d11
mov eax, edx
test ax, 0x1c0
sete al
movzx eax, al
lea r15d, [rax + rax]
mov rax, qword [0x1400b1930]
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 + 0x441], 0
jne 0x140047ec4
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 0x140047e7c
call fcn.140036bd7
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.140036717
lea rbp, [rsp + 0xa0]
xor r9d, r9d
mov r8, r13
lea rdx, str._SetupData_
mov rcx, rbp
call fcn.140023145
test rax, rax
jne 0x140047eb2
mov rdx, rbp
lea rcx, str.Failed_to_add_SetupSourceDevice_in__s_n
call fcn.140036717
jmp 0x1400482dd
mov r8, rbp
mov rdx, r13
lea rcx, str.Successfully_added__s_to__s_n
call fcn.140036717
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 0x140047f50
call fcn.140036bd7
mov rdx, qword [rsp + 0x40]
mov r8, rbp
lea rcx, str.Did_not_copy__s_as__s:__s_n
mov r9, rax
call fcn.140036717
mov ax, word [r14 + 0x42a]
test ax, 0x1c0
je 0x140047f99
cmp byte [r14 + 0x441], 0
je 0x140047f80
lea rcx, str.Detected_minint_directory_with__minint_option:_nothing_to_patch_n
xor ebx, ebx
mov edi, 1
call fcn.140036717
jmp 0x1400482e1
test al, 0x27
jne 0x1400482dd
lea rcx, str.Detected_minint_directory_only_but_no__minint_option:_not_sure_what_to_do_n
call fcn.140036717
jmp 0x1400482dd
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 0x140047fec
call fcn.140036bd7
mov rdx, rbp
lea rcx, str.Could_not_open__s_for_patching:__s_n
mov r8, rax
call fcn.140036717
jmp 0x1400482dd
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.DLL_GetFileSize]
mov edi, eax
cmp eax, 0xffffffff
jne 0x140048019
call fcn.140036bd7
mov rdx, rbp
lea rcx, str.Could_not_get_size_for_file__s:__s_n
mov r8, rax
call fcn.140036717
xor ebx, ebx
jmp 0x14004808d
mov ecx, eax
call sub.msvcrt.dll_malloc
mov rbx, rax
test rax, rax
je 0x140048015
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 0x14004804d
cmp dword [rsp + 0x54], edi
je 0x140048061
call fcn.140036bd7
mov rdx, rbp
lea rcx, str.Could_not_read_file__s:__s_n
mov r8, rax
jmp 0x140048088
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
test eax, eax
jne 0x140048094
call fcn.140036bd7
mov rdx, rbp
lea rcx, str.Could_not_rewind_file__s:__s_n
mov r8, rax
call fcn.140036717
xor edi, edi
jmp 0x1400482e5
mov rdx, rbp
lea rcx, str.Patching_file__s_n
call fcn.140036717
cmp edi, 0x2061
jbe 0x1400480d2
cmp byte [rbx + 0x2060], 0x74
jne 0x1400480d2
cmp byte [rbx + 0x2061], 3
jne 0x1400480d2
mov word [rbx + 0x2060], 0x1aeb
lea rcx, str.__0x00002060:_0x74_0x03____0xEB_0x1A__disable_Win2k3_CRC_check__n
call fcn.140036717
mov ebp, 1
lea r12d, [rdi - 0x20]
cmp ebp, r12d
jae 0x1400481a7
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 0x14004818f
cmp r15d, 2
jne 0x140048134
mov r8d, 0x14f
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.140036717
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 0x1400481a0
mov r12d, 8
jmp 0x1400480e7
inc ebp
jmp 0x1400480d7
cmp byte [r14 + 0x441], 0
je 0x1400481f2
mov r8d, edi
lea r9, [rsp + 0x54]
mov rdx, rbx
mov rcx, rsi
mov dword [rsp + 0x20], 4
mov edi, 1
call fcn.14003810a
test eax, eax
jne 0x1400482e5
call fcn.140036bd7
lea rcx, str.Could_not_write_patched_file:__s_n
mov rdx, rax
call fcn.140036717
jmp 0x14004808d
xor ebp, ebp
mov r14d, ebp
cmp ebp, r12d
jae 0x1400481b1
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 0x140048261
mov rax, qword [0x1400b1930]
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.140036717
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 0x1400482d5
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.140036717
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 0x1400481f4
xor ebx, ebx
xor edi, edi
or rsi, 0xffffffffffffffff
lea rax, [rsi - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1400482f8
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