$Input_File = @ScriptDir & "\test.iso" $Partial_File = $Input_File & ".parz" $aZero = _Generate_1_Megabyte_EmptyArray() ;read input file $v1 = Read_1Megabyte_to_Array($Input_File,0) ;write partial file Write_File_From_Array($Partial_File,$v1,0) ;write zero to original file Write_File_From_Array($Input_File,$aZero,0) MsgBox(0,"recreate original file","recreate original file") $v1 = Read_1Megabyte_to_Array($Partial_File,0) Write_File_From_Array($Input_File,$v1,0) FileDelete($Partial_File) ;************************************************************************************************** Func Read_1Megabyte_to_Array($Path_Input_File_Func,$Offset_Func) ;************************************************************************************************** Local $Array_Return[0] $file = FileOpen($Path_Input_File_Func,16) if $Offset_Func >= 0 Then FileSetPos($file, $Offset_Func, 0) ;pos from begin file Else FileSetPos($file, $Offset_Func, 2) ;pos from end of file EndIf for $i=0 to 512-1 $line = FileRead($file,2048) If @error Then return -1 ReDim $Array_Return[UBound($Array_Return) + 1] $Array_Return[$i]=$line Next FileClose($file) Return $Array_Return EndFunc ;************************************************************************************************** Func Write_File_From_Array($Path_Input_File_Func,$aInput_Func,$Offset_Func) ;************************************************************************************************** $file = FileOpen($Path_Input_File_Func,17) if $Offset_Func >= 0 Then FileSetPos($file, $Offset_Func, 0) ;pos from begin file Else FileSetPos($file, $Offset_Func, 2) ;pos from end of file EndIf for $i=0 to UBound($aInput_Func)-1 FileWrite($file,$aInput_Func[$i]) Next FileClose($file) EndFunc ;************************************************************************************************** Func _Generate_1_Megabyte_EmptyArray() ;************************************************************************************************** $ZeroLine = "0x" for $i=1 to 41 $ZeroLine &= "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" Next $ZeroLine = StringTrimRight($ZeroLine,4) Local $aReturn[0] for $i=0 to 512-1 ReDim $aReturn[UBound($aReturn) + 1] $aReturn[$i]=$ZeroLine Next Return $aReturn EndFunc