Skip to main content

Recover Amiga XPK files, including files written through XFH

Project description

xfh

xfh is a pure-Python data-recovery library and command-line tool for files compressed with the Amiga XPK system, including files written transparently through DiskExpander.

The project is under active format-recovery work. It currently supports the later XPKF container, the DiskExpander 2.1 wrapper, and 41 codec identifiers in pure Python. Historical compatibility identifiers CBR1 (CBR0) and FRHT (RAKE) are accepted as exact stream-format aliases. See the codec support table for the evidence and limitations behind each codec.

Installation

xfh requires Python 3.10 or newer and has no runtime dependencies. After the first release is published to PyPI, install it with:

python -m pip install xfh

Until then, install a checkout directly:

python -m pip install .

Quick start

Inspect a stream before writing anything, strictly verify it, and then unpack it:

xfh info packed-file
xfh verify packed-file
xfh unpack packed-file recovered-file

Existing output files are not overwritten unless --force is supplied. Decompression is limited to 256 MiB by default; use --max-output-size to set an appropriate byte limit for a known larger file.

For a damaged stream, salvage mode writes only the prefix decoded before the first failing chunk. Its exit status is 4 when recovery is incomplete:

xfh unpack damaged-file recovered-prefix --salvage --report recovery.json

The public Python API accepts bytes-like input:

from pathlib import Path

import xfh

packed = Path("packed-file").read_bytes()
info = xfh.inspect(packed)
plain = xfh.decompress(packed, limits=xfh.Limits(max_output_size=512 * 1024 * 1024))
Path("recovered-file").write_bytes(plain)

print(info.codec, len(plain))

Use xfh.decompress_file() when writing to disk: it uses an atomic destination write and refuses to replace an existing file by default.

Recovery and stability

Strict decoding validates the container, declared sizes, checksums, chunk output sizes, and initial-byte prefix where the format provides them. It either returns the complete declared output or raises an xfh.XfhError subclass. Password-protected streams are detected but not decoded.

Salvage is deliberately opt-in. Its output can be useful evidence, but an incomplete result is not proof that every returned byte represents an intact original file. Keep the source media and packed files unchanged, work on copies, review the recovery report, and validate recovered data with tools specific to its file type.

This is alpha software reconstructed from historical implementations and surviving samples. Codec support varies in strength from headless-UAE packer fixtures to source-derived decoder tests; the support table records that distinction. The API and command-line interface may change before 1.0.

Development

Development follows the template workflow:

make dev
make test
make coverage
make lint
make dist

See the original investigation for the provenance of the project and the format notes for current support boundaries. The oracle matrix records results from the isolated original Amiga implementation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xfh-0.1.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xfh-0.1.0-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file xfh-0.1.0.tar.gz.

File metadata

  • Download URL: xfh-0.1.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for xfh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a0c83a251fac17f02c2bdbb0af7c34831d3305d46958ac227b0ac6466d32a8a
MD5 58934a805852dbea0e6dbaa42768e493
BLAKE2b-256 1d4def219cafd4feb98ae76654e0bb5d935359336f4d8ec654faeefa551bbc61

See more details on using hashes here.

File details

Details for the file xfh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xfh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for xfh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3975dc6268dfdf52625f027aab7cec593a00fc8724420d3be09b53394f78dec
MD5 aa88bf4fcb3dbed69d3d48ffea1d8d9e
BLAKE2b-256 64d61362cbbf63f0d3e840c2a281ea8177e1ef6d7f7b57e38775ebf6ba69e907

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page