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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [0x43d004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push eax
push ebx
push str.FormatPart2Fat__llu...
mov dword [ebp - 0x54], ecx
mov edi, 0xd
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x64], 0
call fcn.0040f530
add esp, 0xc
push 0x100000
call fcn.0041c36a
mov esi, eax
add esp, 4
mov dword [ebp - 0x5c], esi
test esi, esi
jne 0x40974a
push str.Failed_to_malloc_check_buf
call fcn.0040f530
add esp, 4
lea eax, [edi - 0xc]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00417710
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x60]
xor edx, edx
push eax
lea eax, [ebp - 0x64]
mov ecx, str.ventoy_ventoy.disk.img.xz
push eax
call fcn.0040f6f0
add esp, 8
mov dword [ebp - 0x6c], eax
test eax, eax
je 0x40979a
push dword [ebp - 0x60]
push dword [ebp - 0x64]
push str.Failed_to_read_img_file__p__u
call fcn.0040f530
add esp, 0xc
push esi
call fcn.0041bffb
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00417710
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x78]
push 0
shld eax, ebx, 9
push ecx
push eax
shl ebx, 9
push ebx
push dword [ebp - 0x54]
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x58], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0x80
push 0
push 0x43f3d0
call fcn.00418c40
add esp, 0xc
push 0x2000000
call fcn.0041c36a
mov ebx, dword [ebp - 0x64]
add esp, 4
mov dword [0x43f3d0], eax
test eax, eax
je 0x409aa3
push str.Malloc_whole_img_buffer_success__now_decompress_...
call fcn.0040f530
mov esi, dword [ebp - 0x60]
lea eax, [ebp - 0x50]
push eax
push dword [0x43f3d0]
mov edx, esi
push 0
push ecx
mov ecx, ebx
call fcn.00417370
add esp, 0x14
cmp esi, dword [ebp - 0x50]
jne 0x409a8f
push str.decompress_finished_success
call fcn.0040f530
add esp, 4
call fcn.00409150
mov dword [ebp - 0x50], 0
xor ebx, ebx
nop word [eax + eax]
push 0
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x4c], 0
push eax
mov eax, dword [0x43f3d0]
push 0x100000
add eax, ebx
push eax
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x4c]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040f530
add esp, 0x10
test esi, esi
je 0x409a33
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x43fc40]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x43b190]
divsd xmm0, qword [0x43b168]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.00401010
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43fc48]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov ecx, dword [ebp - 0x50]
lea eax, [edi + 1]
test cl, 1
cmovne eax, edi
inc ecx
add ebx, 0x100000
mov dword [ebp - 0x50], ecx
mov edi, eax
cmp ebx, 0x2000000
jl 0x409840
mov esi, dword [ebp - 0x54]
lea eax, [ebp - 0x78]
push 0
push eax
mov eax, dword [ebp - 0x68]
push eax
push dword [ebp - 0x58]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
xor ecx, ecx
xor ebx, ebx
mov dword [ebp - 0x50], ecx
nop dword [eax]
push 0
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x58], ecx
push eax
push 0x100000
push dword [ebp - 0x5c]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x4c]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040f530
add esp, 0x10
test esi, esi
je 0x409a26
mov edx, dword [0x43f3d0]
mov esi, 0xffffc
mov ecx, dword [ebp - 0x5c]
add edx, ebx
nop word [eax + eax]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x409a26
add ecx, 4
add edx, 4
sub esi, 4
jae 0x409980
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x43fc40]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x43b190]
divsd xmm0, qword [0x43b168]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.00401010
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43fc48]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov ecx, dword [ebp - 0x50]
lea eax, [edi + 1]
mov esi, dword [ebp - 0x54]
inc ecx
add ebx, 0x100000
mov dword [ebp - 0x50], ecx
test byte [ebp - 0x58], 1
cmovne eax, edi
mov edi, eax
cmp ebx, 0x2000000
jl 0x409930
mov ebx, dword [ebp - 0x6c]
jmp 0x409a38
push str.__Check_Fail__The_data_write_and_read_does_not_match
call fcn.0040f530
add esp, 4
mov ebx, 1
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x409a48
push eax
call fcn.0041bffb
add esp, 4
push dword [ebp - 0x5c]
call fcn.0041bffb
add esp, 4
cmp dword [ebp - 0x70], 0
je 0x409cfa
mov esi, 0x43f3d0
mov eax, dword [esi]
test eax, eax
je 0x409a71
push eax
call fcn.0041bffb
add esp, 4
add esi, 4
cmp esi, 0x43f450
jl 0x409a62
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00417710
mov esp, ebp
pop ebp
ret
push str.decompress_finished_failed
mov ebx, 1
call fcn.0040f530
add esp, 4
jmp 0x409a38
push 0x2000000
push str.Failed_to_malloc_whole_img_size__u__now_split_it
call fcn.0040f530
add esp, 8
mov dword [ebp - 0x70], 1
mov esi, 0x43f3d0
push 0x100000
call fcn.0041c36a
add esp, 4
mov dword [esi], eax
test eax, eax
je 0x409a33
add esi, 4
cmp esi, 0x43f450
jl 0x409ac1
push str.Malloc_part_img_buffer_success__now_decompress_...
call fcn.0040f530
mov eax, dword [0x43f3d0]
mov edx, dword [ebp - 0x60]
push 0
push 0
push 0x4095c0
push ecx
mov ecx, ebx
mov dword [0x43f3c8], eax
call fcn.00417370
add esp, 0x14
cmp dword [0x43f3c4], 0x2000000
jne 0x409a8f
push str.decompress_finished_success
call fcn.0040f530
add esp, 4
call fcn.00409150
xor ebx, ebx
push 0
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x4c], 0
push eax
push 0x100000
push dword [ebx*4 + 0x43f3d0]
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x4c]
push esi
push str.Write_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040f530
add esp, 0x10
test esi, esi
je 0x409a33
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x43fc40]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x43b190]
divsd xmm0, qword [0x43b168]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.00401010
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43fc48]
call dword [sym.imp.USER32.dll_SetWindowTextA]
test bl, 1
lea eax, [edi + 1]
cmovne eax, edi
inc ebx
mov edi, eax
cmp ebx, 0x20
jl 0x409b32
mov esi, dword [ebp - 0x54]
lea eax, [ebp - 0x78]
push 0
push eax
mov eax, dword [ebp - 0x68]
push eax
push dword [ebp - 0x58]
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call eax
xor ebx, ebx
nop dword [eax]
push 0
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x58], ebx
push eax
push 0x100000
push dword [ebp - 0x5c]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x4c]
push esi
push str.Read_part_data_bRet:_u_dwSize:_u_code:_u
call fcn.0040f530
add esp, 0x10
test esi, esi
je 0x409a26
mov ecx, dword [ebp - 0x5c]
mov esi, 0xffffc
mov edx, dword [ebx*4 + 0x43f3d0]
nop dword [eax]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x409a26
add ecx, 4
add edx, 4
sub esi, 4
jae 0x409c60
cmp edi, 0x31
mov eax, 0x31
push 0
mov esi, edi
cmovge esi, eax
push esi
push 0x402
push dword [0x43fc40]
call dword [sym.imp.USER32.dll_SendMessageW]
movd xmm0, esi
lea eax, [ebp - 0x48]
cvtdq2pd xmm0, xmm0
sub esp, 8
mulsd xmm0, qword [0x43b190]
divsd xmm0, qword [0x43b168]
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.00401010
add esp, 0x14
lea eax, [ebp - 0x48]
push eax
push dword [0x43fc48]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov esi, dword [ebp - 0x54]
lea eax, [edi + 1]
inc ebx
test byte [ebp - 0x58], 1
cmovne eax, edi
mov edi, eax
cmp ebx, 0x20
jl 0x409c10
mov ebx, dword [ebp - 0x6c]
jmp 0x409a38
mov eax, dword [0x43f3d0]
test eax, eax
je 0x409d0c
push eax
call fcn.0041bffb
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00417710
mov esp, ebp
pop ebp
ret