Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Tool:crcany

From ReverseEngineering.wiki
Tool
On this wiki Facts · Code · Notes · Topics

Mark Adler's crcany: given any CRC from the RevEng catalogue (or a custom parameter set) it generates C code for bitwise, bytewise and wordwise CRC calculation; its allcrcs.txt is a machine-readable list of the catalogued models with check values.

Overview

crcany (https://github.com/madler/crcany, zlib license) reads CRC models in the form width=32 poly=0x04c11db7 init=0xffffffff refin=true refout=true xorout=0xffffffff check=0xcbf43926 residue=0xdebb20e3 name="CRC-32/ISO-HDLC" and writes C source with bit-at-a-time, byte-table and slice-by-N functions. Because the catalogue is in allcrcs.txt (about 110 models; allcrcs-name-changes.txt maps old to new names, e.g. CRC-16/CCITT-FALSE becomes CRC-16/IBM-3740), it doubles as a reference of parameter sets for Technique:CRC variants and parameters.

Use for reversers

  • Take the check value from allcrcs.txt to confirm that a candidate implementation matches the catalogue, then compare a file's stored checksum against the CRC of the covered bytes, see Technique:Identifying checksums in file formats.
  • crcgen.c emits code you can compare with a decompiled routine; the reflected forms use the reversed polynomial.
  • The catalogue's model comes from Greg Cook's CRC RevEng, whose parameter search recovers unknown parameters from samples.

Code & repositories

  • https://github.com/madler/crcany @ 8fc795d650198a3ffab4bd606ae8b3b2b0361e7d · license: Zlib (declared by the contributor for the files used; GitHub reports Zlib (read from LICENSE; GitHub's detector did not classify it) for the repository)
    CRC code generator whose allcrcs.txt lists the RevEng catalogue models with check values (zlib license).
    Tested on: source read, not run: files read: allcrcs.txt, allcrcs-name-changes.txt, README · checked 2026-10-18; last activity 2025-02-03

See also