Skip to main content

Split binary files on content boundaries

Project description

Command-line tool like unix csplit but which splits binary files based on content boundaries rather than index boundaries.

This is particularly useful for salvaging jpegs from a corrupted disk image.

Example usage:

$ csplitb –prefix photo –suffix .jpg –number 4 ffd8ffe1 corrupted-disk-image.raw

This will split the disk image, keeping the header, into photo0000.jpg, photo0001.jpg, etc. Because a disk image represents a potentially fragmented file system, some (or all) of the jpeg files may be corrupted.

The “ffd8ffe1” here is a jpeg header. I’m not an expert on the jpeg format, so it’s possible that you may need to use a different hex search term. Use a hex editor or viewer such as xxd to find what content you want to split on.


pip install csplitb

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

csplitb-1.0.1.tar.gz (9.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page