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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xfc
mov eax, dword [0x4d8300]
xor eax, ebp
mov dword [ebp - 4], eax
mov byte [ebp - 0xad], cl
mov edx, 0x1c0
mov ecx, dword [0x5228aa]
mov al, cl
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0xe0], str.i386
and al, 0x23
mov dword [ebp - 0xdc], str.amd64
mov dword [ebp - 0xd8], str.minint
mov esi, ebx
mov dword [ebp - 0xe8], str.minint_txtsetup.sif
mov dword [ebp - 0xe4], str.minint_system32_
mov dword [ebp - 0xf8], str.i386_txtsetup.sif
mov dword [ebp - 0xf4], str.i386_system32_
mov dword [ebp - 0xf0], str._amd64_txtsetup.sif
mov dword [ebp - 0xec], str._amd64_system32_
push edi
cmp al, 0x23
jne 0x409f91
xor edi, edi
inc edi
jmp 0x409fa1
mov eax, edx
mov edi, ebx
and ax, cx
cmp ax, dx
push 2
pop eax
cmove edi, eax
push ebx
push ebx
push 0x147
push dword [0x5222a8]
mov dword [ebp - 0xc0], edi
call dword [sym.imp.USER32.dll_SendMessageW]
push eax
push str.SetupSourceDevice___deviceharddisk_dpartition1_
lea eax, [ebp - 0xa8]
push 0x40
push eax
call fcn.00403163
shr edi, 1
lea eax, [ebp - 0x68]
mov byte [ebp - 0x69], bl
mov ecx, dword [ebp + edi*8 - 0xe0]
movsx edi, byte [ebp - 0xad]
push ecx
push edi
push str._c:_s_ntdetect.com
push 0x40
push eax
mov dword [ebp - 0xc4], ecx
call fcn.00403163
add esp, 0x24
mov byte [ebp - 0x29], bl
lea eax, [ebp - 0x24]
push edi
push str._c:_ntdetect.com
push 0x20
push eax
call fcn.00403163
add esp, 0x10
mov byte [ebp - 5], bl
lea eax, [ebp - 0x24]
push 1
push eax
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
cmp byte [0x5228c0], bl
jne 0x40a0db
mov eax, dword [ebp - 0xc0]
push dword [ebp + eax*4 - 0xe0]
lea eax, [ebp - 0x68]
push edi
push str._c:_s_txtsetup.sif
push 0x40
push eax
call fcn.00403163
add esp, 0x14
mov byte [ebp - 0x29], bl
lea eax, [ebp - 0x24]
push edi
push str._c:_txtsetup.sif
push 0x20
push eax
call fcn.00403163
add esp, 0x10
mov byte [ebp - 5], bl
lea eax, [ebp - 0x24]
push 1
push eax
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x40a09c
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x68]
push eax
push str.Did_not_copy__s_as__s:__s_n
call fcn.0042ed57
add esp, 0x10
push ecx
lea eax, [ebp - 0xa8]
push eax
lea ecx, [ebp - 0x24]
call fcn.00419cab
pop ecx
test eax, eax
lea eax, [ebp - 0x24]
pop ecx
push eax
jne 0x40a0c7
push str.Failed_to_add_SetupSourceDevice_in__s_n
call fcn.0042ed57
pop ecx
pop ecx
jmp 0x40a555
lea eax, [ebp - 0xa8]
push eax
push str.Successfully_added__s_to__s_n
call fcn.0042ed57
add esp, 0xc
push dword [ebp - 0xc4]
lea eax, [ebp - 0x68]
push edi
push str._c:_s_setupldr.bin
push 0x40
push eax
call fcn.00403163
add esp, 0x14
mov byte [ebp - 0x29], bl
lea eax, [ebp - 0x24]
push edi
push str._c:BOOTMGR
push 0x20
push eax
call fcn.00403163
add esp, 0x10
mov byte [ebp - 5], bl
lea eax, [ebp - 0x24]
push 1
push eax
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
test eax, eax
jne 0x40a13e
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x68]
push eax
push str.Did_not_copy__s_as__s:__s_n
call fcn.0042ed57
add esp, 0x10
mov eax, dword [0x5228aa]
test eax, 0x1c0
je 0x40a17c
cmp byte [0x5228c0], bl
je 0x40a165
push str.Detected_minint_directory_with__minint_option:_nothing_to_patch_n
call fcn.0042ed57
xor ebx, ebx
pop ecx
inc ebx
jmp 0x40a555
test al, 0x27
jne 0x40a555
push str.Detected_minint_directory_only_but_no__minint_option:_not_sure_what_to_do_n
call fcn.0042ed57
jmp 0x40a0c1
push ebx
push 0x80
push 3
push ebx
push 1
push 0xc0000000
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0xc4], edi
cmp edi, 0xffffffff
jne 0x40a1bf
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
push str.Could_not_open__s_for_patching:__s_n
call fcn.0042ed57
add esp, 0xc
jmp 0x40a555
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0xb8], eax
cmp eax, 0xffffffff
jne 0x40a1e6
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
push str.Could_not_get_size_for_file__s:__s_n
jmp 0x40a542
push eax
call fcn.004812e1
mov esi, eax
mov dword [ebp - 0xb4], esi
pop ecx
test esi, esi
je 0x40a54a
push ebx
lea eax, [ebp - 0xd0]
push eax
push dword [ebp - 0xb8]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a533
mov eax, dword [ebp - 0xb8]
cmp eax, dword [ebp - 0xd0]
jne 0x40a533
push ebx
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x40a250
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
push str.Could_not_rewind_file__s:__s_n
jmp 0x40a542
lea eax, [ebp - 0x24]
push eax
push str.Patching_file__s_n
call fcn.0042ed57
mov eax, dword [ebp - 0xb8]
pop ecx
pop ecx
cmp eax, 0x2061
jbe 0x40a299
cmp byte [esi + 0x2060], 0x74
jne 0x40a299
cmp byte [esi + 0x2061], 3
jne 0x40a299
push str.__0x00002060:_0x74_0x03____0xEB_0x1A__disable_Win2k3_CRC_check__n
mov word [esi + 0x2060], 0x1aeb
call fcn.0042ed57
mov eax, dword [ebp - 0xb8]
pop ecx
xor ecx, ecx
lea edx, [eax - 0x20]
inc ecx
mov dword [ebp - 0xcc], edx
mov dword [ebp - 0xac], ecx
cmp edx, ecx
jbe 0x40a3a9
mov edi, ebx
mov ebx, dword [ebp - 0xb4]
mov dword [ebp - 0xbc], edi
mov eax, dword [ebp + edi*4 - 0xe8]
mov esi, str._NULL_
test eax, eax
mov dword [ebp - 0xc8], eax
push eax
cmovne esi, eax
add ecx, ebx
mov dword [ebp - 0xd4], ecx
call fcn.004816f0
dec eax
pop ecx
push eax
push esi
mov esi, dword [ebp - 0xd4]
mov eax, str._NULL_
test esi, esi
cmovne eax, esi
push eax
call fcn.004873d4
add esp, 0xc
test eax, eax
jne 0x40a36d
mov eax, dword [ebp - 0xc0]
lea eax, [edi + eax*2]
mov edi, dword [ebp + eax*4 - 0xf8]
push edi
push esi
push dword [ebp - 0xac]
push str.__0x_08X:__s_____s_n
call fcn.0042ed57
push edi
push esi
call fcn.00486c30
push edi
call fcn.004816f0
add esp, 0x1c
mov esi, eax
push dword [ebp - 0xc8]
call fcn.004816f0
cmp eax, esi
pop ecx
cmova edi, dword [ebp - 0xc8]
push edi
call fcn.004816f0
mov edi, dword [ebp - 0xbc]
pop ecx
mov ecx, dword [ebp - 0xac]
add ecx, eax
mov dword [ebp - 0xac], ecx
jmp 0x40a373
mov ecx, dword [ebp - 0xac]
push 2
inc edi
pop eax
mov dword [ebp - 0xbc], edi
cmp edi, eax
jb 0x40a2c1
mov edx, dword [ebp - 0xcc]
inc ecx
mov dword [ebp - 0xac], ecx
push 0
pop ebx
cmp ecx, edx
jb 0x40a2b3
mov esi, dword [ebp - 0xb4]
mov edi, dword [ebp - 0xc4]
cmp byte [0x5228c0], 0
jne 0x40a4fc
mov eax, ebx
mov dword [ebp - 0xac], eax
test edx, edx
je 0x40a4fc
add eax, esi
mov edi, str._NULL_
push str.rdisk_0_
mov dword [ebp - 0xbc], eax
cmovne edi, eax
call fcn.004816f0
pop ecx
dec eax
push eax
push str.rdisk_0_
push edi
call fcn.004873d4
add esp, 0xc
test eax, eax
jne 0x40a42f
push ebx
push ebx
push 0x147
push dword [0x5222a8]
call dword [sym.imp.USER32.dll_SendMessageW]
mov ecx, dword [ebp - 0xbc]
add al, 0x30
mov byte [ecx + 6], al
movsx eax, al
push eax
push str.rdisk_0_
push dword [ebp - 0xac]
push str.__0x_08X:__s____rdisk__c__n
call fcn.0042ed57
add esp, 0x10
push str._win_nt_.bt
call fcn.004816f0
pop ecx
dec eax
push eax
push str._win_nt_.bt
push edi
call fcn.004873d4
add esp, 0xc
test eax, eax
jne 0x40a4dd
mov eax, dword [ebp - 0xc0]
push str._win_nt_.bt
mov edi, dword [ebp + eax*4 - 0xe0]
call fcn.004816f0
pop ecx
mov ecx, dword [ebp - 0xac]
add eax, ecx
add eax, esi
mov esi, dword [ebp - 0xbc]
push eax
push edi
push esi
push ecx
push str.__0x_08X:__s_____s_s_n
call fcn.0042ed57
add esp, 0x14
push edi
push esi
call fcn.00486c30
push str._win_nt_.bt
call fcn.004816f0
add esp, 0xc
mov esi, eax
add esi, dword [ebp - 0xac]
add esi, dword [ebp - 0xb4]
push edi
call fcn.004816f0
pop ecx
mov ecx, eax
mov al, byte [esi]
add ecx, dword [ebp - 0xac]
add ecx, dword [ebp - 0xb4]
push edi
mov byte [ecx], al
call fcn.004816f0
add eax, dword [ebp - 0xac]
mov esi, dword [ebp - 0xb4]
pop ecx
mov byte [eax + esi + 1], bl
mov eax, dword [ebp - 0xac]
inc eax
mov dword [ebp - 0xac], eax
cmp eax, dword [ebp - 0xcc]
jb 0x40a3c6
mov edi, dword [ebp - 0xc4]
push ecx
lea eax, [ebp - 0xd0]
mov edx, esi
push eax
push dword [ebp - 0xb8]
mov ecx, edi
call fcn.0043032f
add esp, 0xc
test eax, eax
jne 0x40a52e
call fcn.0042fc51
push eax
push str.Could_not_write_patched_file:__s_n
call fcn.0042ed57
pop ecx
pop ecx
jmp 0x40a54a
xor ebx, ebx
inc ebx
jmp 0x40a54a
call fcn.0042fc51
push eax
lea eax, [ebp - 0x24]
push eax
push str.Could_not_read_file__s:__s_n
call fcn.0042ed57
add esp, 0xc
test edi, edi
je 0x40a555
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.004812c6
pop ecx
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00475c80
leave
ret