A command line interface tool that lets you reverse and freely change CRC checksums through smart file patching.
It's a successor to my previous C++ variant of this project. Even though this version is written in Python, the performance is comparable to the old C++ version.
Patching and calculating CRC checksums for:
- CRC32
- CRC32POSIX (
cksum
from GNU coreutils) - CRC16CCITT
- CRC16IBM
- CRC16XMODEM
It appends a few bytes at the end of the file so that the file checksum computes to a given hexadecimal hash.
$ echo -n hello > test.txt
$ crc32 test.txt
3610a686
$ crcmanip calc test.txt
3610A686
$ crcmanip patch test.txt deadbeef
$ crcmanip calc test.txt
DEADBEEF
$ crc32 test.txt
deadbeef
$ cat test.txt
helloE~40
To install the newest version from GitHub:
$ git clone https://github.com/rr-/pycrcmanip.git
$ cd pycrcmanip
$ pip install --user .
$ crcmanip --help
$ pytest
To set up the project:
pip install --user poetry poethepoet
git clone https://github.com/rr-/pycrcmanip.git
cd pycrcmanip
poetry install
poetry run pre-commit install
To run tests:
poe test
To run the profiler:
poe profile
To clean build artifacts:
poe clean