"""Subtractive PrOOo-Box tools copy, ready pycdlib/7zz lineage. SPDX-License-Identifier: GPL-2.0-or-later No original ISO, installer, application binary or source code is patched. """ from pathlib import Path from datetime import datetime, timezone from html.parser import HTMLParser from urllib.parse import urlsplit import base64 import json import shutil import pycdlib from cleaned_iso import sha, json_file, windows_text, write_tree ROOT = Path(__file__).resolve().parents[1] EVIDENCE = ROOT / 'docs/research/virtual-media-2026-10-21/prooo321-cleaned-2026-10-22' ORIGINAL = Path('/tmp/svits-software-library/prooo-box-3.2.1-1/prooo-box-3.2.1-1_CD_Win_de.iso') ORIGINAL_SHA = 'e3b2cd55b184ac7a30f2529d7b45df6e6dbab33afc7e2013a56f01b08896a10e' PAYLOAD = Path('/tmp/svits-prooo321-cleaned-20261022/payload_2026-10-22T23-37-09.315371Z') EXACT = { '/misc/7zip/7z465.exe': '8fe800a740fbe1beb1cfbd9ef73e413f5c18d1496741839399c1cefcaee3b211', '/artwork/prooo-box/prooo-box_CD-inlay.svg': '7cfc9a060444a488c0200a58863bbeab467072543265313b7c30c14db45fa950', '/artwork/prooo-box/prooo-box_CD-inlay.png': '0734979c8f9e5303a88c43fd42d1251f966de4299bccc152145d2bb1e44e5082', '/artwork/prooo-box/prooo-box_CD-label.svg': '4bd74a5359de1142b35181713c4f585a839af7e23187d24654f928fb865d01e3', '/artwork/prooo-box/prooo-box_CD-label.png': 'aeb916caa6fe1f1fb3816b963d4b9c10de35e3639163778451b8e4b976ba83b3', } WRAPPERS = {'npp.5.6.8.Installer.exe': '088879babee6525be968976779133eb061cc9c4123f509666496747b0698f42a', 'gvim72.exe': '519ee905654a1527e21e358969309e907b25d3bdf1fab3c5915f4fc6fd2b795e'} NPP_FILES = ['notepad++.exe', 'SciLexer.dll', 'license.txt', 'readme.txt', 'langs.model.xml', 'langs.xml', 'stylers.model.xml', 'shortcuts.xml', 'config.model.xml', 'change.log'] VIM_EXES = {'gvim.exe', 'vim.exe', 'vimrun.exe', 'xxd.exe'} def removal_reason(path): if path in ['/misc/editor/' + name for name in WRAPPERS]: return 'Installer wrapper removed; exact embedded core editor files retained separately, without optional plugins/updater/IDE, diff, libintl or spelling packages.' if '/jre' in path.lower() or '/java' in path.lower(): return 'Entire unretained Java/runtime component removed; conditional redistribution grant not used.' if '/fonts/' in path.lower() or path.lower().endswith(('.ttf', '.exe')): return 'Outside reviewed tools subset: entire unclosed font/runtime/application package omitted; no general redistribution ban asserted.' return 'Outside reviewed tools subset: original office suite, launcher, extensions, documentation/data and other packages omitted.' def menu(): return ''' PrOOo-Box 3.2.1-1 - cleaned tools r1

PrOOo-Box 3.2.1-1

Cleaned tools copy r1 - three retained applications.
Modified by SVITS, 22 October 2026. Not an official PrOOo-Box release.

Only the archiver and two editors remain. OpenOffice, Java, extra fonts and other original CD packages are absent. Core application bytes are unchanged. Read the modification summary.

7-Zip 4.65

Original Windows installer.

Open 7-Zip installer

Matching source
License / unRAR terms

Notepad++ 5.6.8

Portable core editor with Scintilla2.01. Plugins, updater and shell integration omitted.

Open Notepad++

Matching source and build scripts
GPL license / Scintilla notice

Vim 7.2.269

Portable GUI/console editor and text runtime. Optional IDE, translations, diff and compiled spelling packages omitted.

Open graphical Vim

Matching source and build scripts
Vim license and original charity notice

Unchanged historical PrOOo-Box label

Sources and original artwork

Full corresponding program/build sources, licenses and modification manifests are on this CD. The retained editor executables were extracted unchanged from its original installers. No Windows image is included.

Notices / Removed original paths / Byte provenance / Source archive identities

Original artwork: Christian Zwahlen / Bernhard Dippold, LGPL2.1. Exact SVG preferred source and full license are included. The historical cover describes the full original release; accompany it with the separate modified-copy label. No upstream endorsement is claimed.

Save your documents on writable C:, not on the read-only CD. If local settings cannot be written, copy an editor folder to C: first. If AutoRun is disabled, open README.HTM from My Computer. This menu contains no scripts or remote resources.

''' def main(): stamp = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H-%M-%S.%fZ') work = Path('/tmp/svits-prooo321-cleaned-20261022') / ('iso_run_' + stamp) tree = work / 'tree' evidence = EVIDENCE / ('build_' + stamp) tree.mkdir(parents=True) evidence.mkdir(parents=True) if sha(ORIGINAL) != ORIGINAL_SHA: raise ValueError('Original ISO identity mismatch') for name, expected in WRAPPERS.items(): if sha(PAYLOAD.parent / name) != expected: raise ValueError('Original editor wrapper identity mismatch') original = pycdlib.PyCdlib() original.open(str(ORIGINAL)) retained, deleted = [], [] for directory, _, names in original.walk(joliet_path='/'): for name in names: path = directory.rstrip('/') + '/' + name if path not in EXACT: deleted.append({'originalPath': path, 'bytes': original.get_record(joliet_path=path).data_length, 'reason': removal_reason(path)}) continue target = tree / path.lstrip('/') target.parent.mkdir(parents=True, exist_ok=True) original.get_file_from_iso(str(target), joliet_path=path) if sha(target) != EXACT[path]: raise ValueError('Retained original hash mismatch: ' + path) retained.append({'originalPath': path, 'outputPath': path, 'bytes': target.stat().st_size, 'sha256': sha(target), 'change': 'unchanged original file'}) original.close() if {row['originalPath'] for row in retained} != set(EXACT): raise ValueError('Missing expected original file') def copy_embedded(source, relative, original_path): target = tree / relative target.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(source, target) if sha(source) != sha(target): raise ValueError('Embedded copy mismatch') retained.append({'originalPath': original_path, 'outputPath': '/' + relative, 'bytes': target.stat().st_size, 'sha256': sha(target), 'change': 'exact embedded bytes; original installer wrapper removed'}) for name in NPP_FILES: copy_embedded(PAYLOAD / 'notepadpp' / name, 'misc/editor/notepadpp/' + name, '/misc/editor/npp.5.6.8.Installer.exe!' + name) vim = PAYLOAD / 'vim/$0' omitted_embedded = [] for source in sorted(p for p in vim.rglob('*') if p.is_file()): relative = source.relative_to(vim) if any(part.startswith('$') for part in relative.parts) or relative.parts[0] in ['lang', 'spell'] or ( source.suffix.lower() in ['.exe', '.dll', '.lib', '.spl', '.sug'] and source.name not in VIM_EXES ) or relative.as_posix() in ['README_VisVim.txt', 'uninstal.txt']: omitted_embedded.append({'path': relative.as_posix(), 'sha256': sha(source), 'reason': 'Unused integration/helper/translation/spelling package omitted from portable core subset.'}) continue copy_embedded(source, 'misc/editor/vim72/' + relative.as_posix(), '/misc/editor/gvim72.exe!$0/' + relative.as_posix()) json_file(evidence / 'omitted-embedded-files.json', omitted_embedded) sources = [{'filename': '7z465.tar.bz2', 'localFile': '/tmp/svits-openeducation1010-cleaned-20261022/run_2026-10-22T23-25-41.827Z/7zip465-source', 'sha256': 'cce25c2b7c98ccb598b1393c302ff56a5c51fe2a5aae9c3885bec007eb06fc70', 'includedOriginalFiles': 1083}] sources += [{key: value for key, value in row.items() if key not in ['files', 'omittedUnusedFiles']} for row in json.loads((EVIDENCE / 'source-deliveries.json').read_text())] for row in sources: source = Path(row['localFile']) if sha(source) != row['sha256']: raise ValueError('Matching source archive identity mismatch') target = tree / 'sources' / row['filename'] target.parent.mkdir(exist_ok=True) shutil.copy2(source, target) row['bytes'] = target.stat().st_size row['outputPath'] = '/sources/' + row['filename'] shutil.copytree(EVIDENCE / 'notices', tree / 'notices') for source in [Path(__file__), ROOT / 'scripts/cleaned_iso.py']: shutil.copy2(source, tree / 'sources' / source.name) json_file(tree / 'manifests/retained-original-files.json', retained) json_file(tree / 'manifests/deleted-original-files.json', deleted) json_file(tree / 'manifests/omitted-embedded-files.json', omitted_embedded) json_file(tree / 'manifests/source-payloads.json', sources) for name in ['source-deliveries.json', 'retained-editor-pe-imports.json', 'artwork-readiness.json']: shutil.copy2(EVIDENCE / name, tree / 'manifests' / name) windows_text(tree / 'README.txt', 'PrOOo-Box 3.2.1-1 - CLEANED TOOLS COPY R1\nModified by SVITS, 22 October 2026. Not an official upstream release.\n\n' 'Retained: original 7-Zip4.65 installer, portable Notepad++5.6.8/Scintilla2.01, portable Vim7.2.269.\n' 'Core EXE/DLL and retained runtime bytes are unchanged. All matching sources and full licenses are on this CD.\n' 'Open README.HTM for the local menu. Direct paths:\n' ' misc\\7zip\\7z465.exe\n misc\\editor\\notepadpp\\notepad++.exe\n misc\\editor\\vim72\\gvim.exe\n\n' 'OpenOffice, Java/JRE, extra fonts, original launcher and other CD packages are absent.\n' 'Notepad++ installer, plugins, updater and shell integration are omitted.\n' 'Vim installer, diff/gettext DLL, IDE integration, translations and compiled spelling data are omitted.\n' 'Save on writable C:, not on the read-only CD; copy editor folder to C: if local settings require it.\n' 'No original application binary was patched. No Windows image is included.\n' 'Historical cover/source SVG is unchanged, LGPL2.1, Christian Zwahlen/Bernhard Dippold.\n' 'Use it with artwork\\cleaned-label.svg which clearly describes this reduced copy.\n' 'Full removed-file and source manifests are in manifests. Original ISO SHA256: ' + ORIGINAL_SHA + '\n') windows_text(tree / 'notices/README.txt', 'Modified PrOOo-Box tools copy r1. Not an official upstream release.\n' '7-Zip4.65 Copyright1999-2009 Igor Pavlov, LGPL2.1-or-later plus original unRAR restriction.\n' 'Notepad++5.6.8 Copyright Don Ho and contributors, GPL2-or-later. Full Scintilla2.01 notice retained.\n' 'Vim7.2.269 Copyright Bram Moolenaar and contributors, original Vim license: unmodified parts may be redistributed with its full license.\n' 'Vim program code and executable bytes are unchanged; only unused independent package components omitted.\n' 'All program/build source and required original notices are supplied on the same CD.\n' 'Source deliveries omit unused prebuilt helpers/compiled help/spelling data, with full file-level manifests.\n' 'Retained text runtime files are themselves preferred source and remain directly readable on the CD.\n' 'Original PrOOo-Box art by Christian Zwahlen/Bernhard Dippold: LGPL2.1, exact SVG preferred source and full LGPL included.\n' 'The new composite label is LGPL2.1 with preferred SVG source included; original art bytes are unchanged.\n' 'SVITS menu/build glue is GPL2-or-later, without warranty. No upstream endorsement claimed.\n') windows_text(tree / 'README.HTM', menu()) windows_text(tree / 'autorun.inf', '[autorun]\nshellexecute=README.HTM\nlabel=PrOOo-Box cleaned tools r1\n') png = base64.b64encode((tree / 'artwork/prooo-box/prooo-box_CD-inlay.png').read_bytes()).decode('ascii') label = ('' 'PrOOo-Box cleaned tools r1, modified copy; LGPL2.1Original artwork Christian Zwahlen / Bernhard Dippold. Composite label modification SVITS2026, LGPL2.1. Original SVG sources accompany this copy.' '' '' 'MODIFIED COPY / NOT AN OFFICIAL RELEASE' 'PrOOo-Box 3.2.1-1 - cleaned tools r1' '7-Zip4.65 / Notepad++5.6.8 / Vim7.2.269' 'Full matching sources and notices included' 'OpenOffice, Java, extra fonts and other packages removed' 'Original SVG art sources and full LGPL2.1 included') (tree / 'artwork/cleaned-label.svg').write_text(label) class Links(HTMLParser): def handle_starttag(self, tag, attrs): for key, value in attrs: if key in ['href', 'src'] and value: if urlsplit(value).scheme or value.startswith('/') or not (tree / value).is_file(): raise ValueError('Non-local or missing menu reference: ' + value) Links().feed(menu()) output = write_tree(tree, work, 'PrOOo-Box-3.2.1-1-cleaned-tools-r1', 'PROOO_TOOLS_R1', evidence) if sha(ORIGINAL) != ORIGINAL_SHA: raise ValueError('Original ISO changed during build') for name in ['README.HTM', 'README.txt']: shutil.copy2(tree / name, evidence / name) shutil.copy2(tree / 'artwork/cleaned-label.svg', evidence / 'cleaned-label.svg') for name in ['retained-original-files.json', 'deleted-original-files.json', 'source-payloads.json']: shutil.copy2(tree / 'manifests' / name, evidence / name) proof = {'created': stamp, 'status': 'all-files-dual-namespace-readback-passed; native-Windows/public-Insert-pending', 'id': 'prooo-box-3.2.1-1-cleaned-r1', 'title': 'PrOOo-Box 3.2.1-1 - cleaned tools r1', 'original': {'localFile': str(ORIGINAL), 'bytes': ORIGINAL.stat().st_size, 'sha256': ORIGINAL_SHA, 'immutableBeforeAfter': True}, 'output': output, 'applications': ['7-Zip4.65', 'Notepad++5.6.8 with Scintilla2.01', 'Vim7.2.269'], 'matchingProgramSourceFiles': sum(row['includedOriginalFiles'] for row in sources), 'sourceArchiveBytes': sum(row['bytes'] for row in sources), 'retainedOriginalFiles': len(EXACT), 'retainedEmbeddedFiles': len(retained) - len(EXACT), 'deletedOriginalFiles': len(deleted), 'readback': {'allFiles': True, 'namespaces': ['ISO9660-primary', 'Joliet'], 'allMenuReferencesLocalAndPresent': True}, 'artwork': 'Exact original PNG/SVG, full LGPL2.1 and attribution on ISO; new LGPL composite label clearly identifies modified copy.', 'localTree': str(tree), 'evidenceDirectory': str(evidence), 'boundary': 'No VM, Worker/provider/catalog edit or production deployment by builder.'} json_file(evidence / 'ready-artifact.json', proof) print(json.dumps(proof, indent=2)) if __name__ == '__main__': main()