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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push eax
push esi
push str.FormatPart2Fat__llu...
mov dword [ebp - 0xc], ecx
mov edi, 0xd
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x10], 0
call fcn.00414ac0
add esp, 0xc
push 0x100000
call fcn.0042442e
mov ebx, eax
add esp, 4
mov dword [ebp - 8], ebx
test ebx, ebx
jne 0x40ebc6
push str.Failed_to_malloc_check_buf
call fcn.00414ac0
add esp, 4
lea eax, [edi - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x14]
xor edx, edx
push eax
lea eax, [ebp - 0x10]
mov ecx, str.ventoy_ventoy.disk.img.xz
push eax
call fcn.00414d10
add esp, 8
mov dword [ebp - 0x24], eax
test eax, eax
je 0x40ec0c
push dword [ebp - 0x14]
push dword [ebp - 0x10]
push str.Failed_to_read_img_file__p__u
call fcn.00414ac0
add esp, 0xc
push ebx
call fcn.0042422d
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x30]
push 0
shld eax, esi, 9
push ecx
push eax
shl esi, 9
push esi
push dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0x80
push 0
push 0x44ae18
call fcn.00420f90
add esp, 0xc
push 0x2000000
call fcn.0042442e
add esp, 4
mov dword [0x44ae18], eax
test eax, eax
je 0x40ee3c
push str.Malloc_whole_img_buffer_success__now_decompress_...
call fcn.00414ac0
mov esi, dword [ebp - 0x14]
lea eax, [ebp - 0x18]
push eax
push dword [0x44ae18]
mov edx, esi
push 0
push ecx
mov ecx, dword [ebp - 0x10]
call fcn.0041ee40
add esp, 0x14
cmp esi, dword [ebp - 0x18]
jne 0x40ee28
push str.decompress_finished_success
call fcn.00414ac0
add esp, 4
call fcn.0040e5d0
mov dword [ebp - 0x18], 0
xor ebx, ebx
nop word [eax + eax]
push 0
lea eax, [ebp - 4]
mov dword [ebp - 4], 0
push eax
mov eax, dword [0x44ae18]
push 0x100000
add eax, ebx
push eax
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.00414ac0
add esp, 0x10
test esi, esi
je 0x40edd5
mov ecx, edi
call fcn.00418700
mov ecx, dword [ebp - 0x18]
lea eax, [edi + 1]
test cl, 1
cmovne eax, edi
inc ecx
add ebx, 0x100000
mov dword [ebp - 0x18], ecx
mov edi, eax
cmp ebx, 0x2000000
jl 0x40ecb0
mov esi, dword [ebp - 0xc]
lea eax, [ebp - 0x30]
push 0
push eax
mov eax, dword [ebp - 0x1c]
push eax
push dword [ebp - 0x20]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
mov dword [ebp - 0x18], 0
xor ebx, ebx
nop dword [eax]
push 0
lea eax, [ebp - 4]
push eax
push 0x100000
push dword [ebp - 8]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.00414ac0
add esp, 0x10
test esi, esi
je 0x40edc8
mov edx, dword [0x44ae18]
mov esi, 0xffffc
mov ecx, dword [ebp - 8]
add edx, ebx
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40edc8
add ecx, 4
add edx, 4
sub esi, 4
jae 0x40ed83
mov ecx, edi
call fcn.00418700
mov eax, dword [ebp - 0x18]
add ebx, 0x100000
mov esi, dword [ebp - 0xc]
mov ecx, eax
inc eax
and ecx, 1
mov dword [ebp - 0x18], eax
lea eax, [edi + 1]
cmovne eax, edi
mov edi, eax
cmp ebx, 0x2000000
jl 0x40ed40
mov ebx, dword [ebp - 8]
mov edi, dword [ebp - 0x24]
jmp 0x40eddd
push str.__Check_Fail__The_data_write_and_read_does_not_match
call fcn.00414ac0
add esp, 4
mov ebx, dword [ebp - 8]
mov edi, 1
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x40eded
push eax
call fcn.0042422d
add esp, 4
push ebx
call fcn.0042422d
add esp, 4
cmp dword [ebp - 0x28], 0
je 0x40efcd
mov esi, 0x44ae18
mov eax, dword [esi]
test eax, eax
je 0x40ee14
push eax
call fcn.0042422d
add esp, 4
add esi, 4
cmp esi, 0x44ae98
jl 0x40ee05
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.decompress_finished_failed
mov edi, 1
call fcn.00414ac0
add esp, 4
jmp 0x40eddd
push 0x2000000
push str.Failed_to_malloc_whole_img_size__u__now_split_it
call fcn.00414ac0
add esp, 8
mov dword [ebp - 0x28], 1
mov esi, 0x44ae18
nop word [eax + eax]
push 0x100000
call fcn.0042442e
add esp, 4
mov dword [esi], eax
test eax, eax
je 0x40edd8
add esi, 4
cmp esi, 0x44ae98
jl 0x40ee60
push str.Malloc_part_img_buffer_success__now_decompress_...
call fcn.00414ac0
mov eax, dword [0x44ae18]
mov edx, dword [ebp - 0x14]
push 0
push 0
push 0x40ea50
push ecx
mov ecx, dword [ebp - 0x10]
mov dword [0x44ae14], eax
call fcn.0041ee40
add esp, 0x14
cmp dword [0x44ae10], 0x2000000
jne 0x40ee28
push str.decompress_finished_success
call fcn.00414ac0
add esp, 4
call fcn.0040e5d0
xor ebx, ebx
push 0
lea eax, [ebp - 4]
mov dword [ebp - 4], 0
push eax
push 0x100000
push dword [ebx*4 + 0x44ae18]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.00414ac0
add esp, 0x10
test esi, esi
je 0x40edd5
mov ecx, edi
call fcn.00418700
test bl, 1
lea eax, [edi + 1]
cmovne eax, edi
inc ebx
mov edi, eax
cmp ebx, 0x20
jl 0x40eed2
mov esi, dword [ebp - 0xc]
lea eax, [ebp - 0x30]
push 0
push eax
mov eax, dword [ebp - 0x1c]
push eax
push dword [ebp - 0x20]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
xor ebx, ebx
push 0
lea eax, [ebp - 4]
push eax
push 0x100000
push dword [ebp - 8]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 4]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.00414ac0
add esp, 0x10
test esi, esi
je 0x40edc8
mov ecx, dword [ebp - 8]
mov esi, 0xffffc
mov edx, dword [ebx*4 + 0x44ae18]
nop
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40edc8
add ecx, 4
add edx, 4
sub esi, 4
jae 0x40ef90
mov ecx, edi
call fcn.00418700
mov esi, dword [ebp - 0xc]
lea eax, [edi + 1]
mov ecx, ebx
inc ebx
and ecx, 1
cmovne eax, edi
mov edi, eax
cmp ebx, 0x20
jl 0x40ef48
mov ebx, dword [ebp - 8]
mov edi, dword [ebp - 0x24]
jmp 0x40eddd
mov eax, dword [0x44ae18]
test eax, eax
je 0x40efdf
push eax
call fcn.0042422d
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret