Hachoir

From MultimediaWiki
Jump to navigation Jump to search

Hachoir is a file parser framework written in Python, features:

  • Autofix: On error, Hachoir can automatically fix errors on buggy file or parser
  • Lazy: Field value, size, description, absolute address, (...) are computed on demand
  • No arbitrary limit: Hachoir don't have arbitrary limit: addresses can be bigger than 4 Go, an integer can be 64 bits or more, there is no field number limit, etc.
  • Types: Hachoir have many predefined field types: integer, string, boolean, byte array, etc.
  • Bit granularity: Size and address are in bits, so it's easy to mix fields with size in bytes or in bits
  • Unicode: String value are stored in Unicode (if string charset is specified)
  • Endian: You don't have to care about endian: you just need to set it once for the whole parser
  • No dependency: Hachoir just needs Python 2.4 (but some frontends need more libraries)
  • API: Data are represented as a tree of fields where each field is a Python object
  • Parser: 30 parsers are included: JPEG picture, ZIP archive, MP3 audio, etc.
  • Guess parser: An algorithm automatically chooses the right parser using file extension, given MIME type or using validate() function of each parser ;

The tool used to be found at hachoir.org, though that has been taken over by domain squatters. The new homes are: