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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push edi
push dword [ebp + 0xc]
mov dword [ebp - 0x58], ecx
mov edi, 0xd
push eax
push str.FormatPart2Fat__llu...
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x5c], 0
call fcn.0040c4e0
add esp, 0xc
push 0x100000
call fcn.00413be0
mov esi, eax
add esp, 4
mov dword [ebp - 0x60], esi
test esi, esi
jne 0x407fe7
push str.Failed_to_malloc_check_buf
call fcn.0040c4e0
add esp, 4
lea eax, [edi - 0xc]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004136c0
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x4c]
xor edx, edx
push eax
lea eax, [ebp - 0x5c]
mov ecx, str.ventoy_ventoy.disk.img.xz
push eax
call fcn.0040c680
add esp, 8
mov dword [ebp - 0x70], eax
test eax, eax
je 0x408036
push dword [ebp - 0x4c]
push dword [ebp - 0x5c]
push str.Failed_to_read_img_file__p__u
call fcn.0040c4e0
add esp, 0xc
push esi
call fcn.00413ba8
add esp, 4
mov eax, 1
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004136c0
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x78]
mov ecx, dword [ebp + 0xc]
push 0
shld ecx, eax, 9
push edx
shl eax, 9
push ecx
push eax
push dword [ebp - 0x58]
mov dword [ebp - 0x6c], ecx
mov dword [ebp - 0x64], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0x80
push 0
push 0x431180
call fcn.004198c0
add esp, 0xc
push 0x2000000
call fcn.00413be0
add esp, 4
mov dword [0x431180], eax
test eax, eax
je 0x4082b0
push str.Malloc_whole_img_buffer_success__now_decompress_...
call fcn.0040c4e0
mov esi, dword [ebp - 0x4c]
lea eax, [ebp - 0x50]
push eax
push dword [0x431180]
mov edx, esi
push 0
push ecx
mov ecx, dword [ebp - 0x5c]
call fcn.00413410
add esp, 0x14
cmp esi, dword [ebp - 0x50]
jne 0x40829c
push str.decompress_finished_success
call fcn.0040c4e0
mov esi, dword [0x430254]
add esp, 4
push esi
push str.VentoyProcSecureBoot__d_...
call fcn.0040c4e0
add esp, 8
test esi, esi
je 0x4080ec
push str.Secure_boot_is_enabled_...
call fcn.0040c4e0
add esp, 4
jmp 0x4080f1
call fcn.00407b50
xor ecx, ecx
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], ecx
lea ecx, [ecx]
push 0
lea eax, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push eax
mov eax, dword [0x431180]
push 0x100000
add eax, ecx
push eax
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x54]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x40823f
mov ecx, edi
call fcn.0040f2c0
mov ecx, dword [ebp - 0x50]
mov eax, ecx
and eax, 0x80000001
jns 0x40815d
dec eax
or eax, 0xfffffffe
inc eax
jne 0x408160
inc edi
inc ecx
mov dword [ebp - 0x50], ecx
mov ecx, dword [ebp - 0x4c]
add ecx, 0x100000
mov dword [ebp - 0x4c], ecx
cmp ecx, 0x2000000
jl 0x408100
mov esi, dword [ebp - 0x58]
lea eax, [ebp - 0x78]
push 0
push eax
push dword [ebp - 0x6c]
mov eax, dword [ebp - 0x64]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov edi, edi
push 0
lea eax, [ebp - 0x54]
push eax
push 0x100000
push dword [ebp - 0x60]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x54]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408232
mov edx, dword [ebp - 0x4c]
mov esi, 0xffffc
add edx, dword [0x431180]
mov ecx, dword [ebp - 0x60]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x408232
add ecx, 4
add edx, 4
sub esi, 4
jae 0x4081e4
mov ecx, edi
call fcn.0040f2c0
mov ecx, dword [ebp - 0x50]
mov eax, ecx
and eax, 0x80000001
jns 0x40820d
dec eax
or eax, 0xfffffffe
inc eax
jne 0x408210
inc edi
mov eax, dword [ebp - 0x4c]
inc ecx
mov esi, dword [ebp - 0x58]
add eax, 0x100000
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x4c], eax
cmp eax, 0x2000000
jl 0x4081a0
mov edi, dword [ebp - 0x70]
jmp 0x408244
push str.__Check_Fail__The_data_write_and_read_does_not_match
call fcn.0040c4e0
add esp, 4
mov edi, 1
mov eax, dword [ebp - 0x5c]
test eax, eax
je 0x408254
push eax
call fcn.00413ba8
add esp, 4
push dword [ebp - 0x60]
call fcn.00413ba8
add esp, 4
cmp dword [ebp - 0x68], 0
je 0x408546
mov esi, 0x431180
mov edi, edi
mov eax, dword [esi]
test eax, eax
je 0x40827f
push eax
call fcn.00413ba8
add esp, 4
add esi, 4
cmp esi, 0x431200
jl 0x408270
mov eax, edi
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004136c0
mov esp, ebp
pop ebp
ret
push str.decompress_finished_failed
mov edi, 1
call fcn.0040c4e0
add esp, 4
jmp 0x408244
push 0x2000000
push str.Failed_to_malloc_whole_img_size__u__now_split_it
call fcn.0040c4e0
add esp, 8
mov dword [ebp - 0x68], 1
mov esi, 0x431180
mov edi, edi
push 0x100000
call fcn.00413be0
add esp, 4
mov dword [esi], eax
test eax, eax
je 0x40823f
add esi, 4
cmp esi, 0x431200
jl 0x4082d0
push str.Malloc_part_img_buffer_success__now_decompress_...
call fcn.0040c4e0
mov eax, dword [0x431180]
mov edx, dword [ebp - 0x4c]
push 0
push 0
push 0x407f00
push ecx
mov ecx, dword [ebp - 0x5c]
mov dword [0x4300f8], eax
call fcn.00413410
add esp, 0x14
cmp dword [0x4300f4], 0x2000000
jne 0x40829c
push str.decompress_finished_success
call fcn.0040c4e0
mov esi, dword [0x430254]
add esp, 4
push esi
push str.VentoyProcSecureBoot__d_...
call fcn.0040c4e0
add esp, 8
test esi, esi
je 0x408362
push str.Secure_boot_is_enabled_...
call fcn.0040c4e0
add esp, 4
jmp 0x408367
call fcn.00407b50
xor ecx, ecx
mov dword [ebp - 0x50], ecx
lea esp, [esp]
push 0
lea eax, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push eax
push 0x100000
push dword [ecx*4 + 0x431180]
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x54]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x40823f
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x42c430]
divsd xmm0, qword [0x42c408]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov ecx, dword [ebp - 0x50]
mov eax, ecx
and eax, 0x80000001
jns 0x408429
dec eax
or eax, 0xfffffffe
inc eax
jne 0x40842c
inc edi
inc ecx
mov dword [ebp - 0x50], ecx
cmp ecx, 0x20
jl 0x408370
mov esi, dword [ebp - 0x58]
lea eax, [ebp - 0x78]
push 0
push eax
push dword [ebp - 0x6c]
mov eax, dword [ebp - 0x64]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
mov dword [ebp - 0x4c], 0
push 0
lea eax, [ebp - 0x54]
push eax
push 0x100000
push dword [ebp - 0x60]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x54]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408232
mov edx, dword [ebp - 0x4c]
mov esi, 0xffffc
mov ecx, dword [ebp - 0x60]
mov edx, dword [edx*4 + 0x431180]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x408232
add ecx, 4
add edx, 4
sub esi, 4
jae 0x4084a1
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x42c430]
divsd xmm0, qword [0x42c408]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov ecx, dword [ebp - 0x4c]
mov eax, ecx
and eax, 0x80000001
jns 0x40852b
dec eax
or eax, 0xfffffffe
inc eax
jne 0x40852e
inc edi
mov esi, dword [ebp - 0x58]
inc ecx
mov dword [ebp - 0x4c], ecx
cmp ecx, 0x20
jl 0x408458
mov edi, dword [ebp - 0x70]
jmp 0x408244
mov eax, dword [0x431180]
test eax, eax
je 0x408558
push eax
call fcn.00413ba8
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
xor ecx, ebp
pop esi
call fcn.004136c0
mov esp, ebp
pop ebp
ret