from pathlib import Path import zipfile,io p=Path('C:/Users/Public/Documents/Amiga Files/Titles/Systems/Alberto2 (Commodore-Amiga, 1992, Amiga).rp9') z=zipfile.ZipFile(io.BytesIO(p.read_bytes())) out=io.BytesIO() with zipfile.ZipFile(out,'w') as w: for i in z.infolist(): data=z.read(i.filename) if i.filename=='rp9-manifest.xml': assert b'type="68030"' in data data=data.replace(b'type="68030"',b'type="68040"') w.writestr(i,data) p.write_bytes(out.getvalue())