FileRevivo / Repair guides

Work on a separate copy; preserve the original file.

Large PSB offset and length validation

Large documents use wider length fields in selected structures; a PSD-only parser can misread them.

Recovery procedure

Use the PSB version flag and specification to select length widths for each section, not a blanket 64-bit conversion. Validate offsets before addition, allocation or seeking. Treat an out-of-bounds channel length as an unresolved boundary.

How to verify the result

Check layer and mask extents against decoded data and test regions near the beginning and end of the document.

Technical decision example

A parser designed around 32-bit offsets can wrap when processing a very large section. Treat a computed end position smaller than its start as an error, even if the result happens to land within the file. Verify the field width at that particular structure against the Photoshop specification.

Recovery limits

Correcting offsets does not recreate missing channel bytes.

FileRevivo: supported inspection and recovery options. Check tool limitations before use.

Measured PSB envelope test

A generated 56-byte PSB fixture used version 2, a 2 × 2 RGB canvas, and a complete raw composite. FileRevivo’s inspector accepted the composite length. Removing one byte produced “INVALID: RAW length mismatch.” This tiny synthetic fixture tests boundary handling, not multi-gigabyte documents or native layer reconstruction.

Technical references