Hachoir is a Python library used to represent a binary file as a tree of Python objects. Each object has a type, a value, an address, etc. The goal is to be able to know the meaning of each bit in a file. Hachoir is able to open invalid or truncated files. It only reads or computes data on demand to minimize load times. Many field types are predefined (integer, bit, string, etc.) and strings with a given character set (such as ISO-8859-1 or UTF-8) are supported. Addresses and sizes are stored in bits.
| Tags | Software Development Disassemblers Utilities |
|---|---|
| Licenses | GPL |
| Operating Systems | OS Independent |
| Implementation | Python |
Recent releases


Changes: Field.getFieldType() was created to describe a field type and give some useful information. The TimestampUnix64 field type was created. GenericString now only guesses the character set once. If the charset attribute if not set, a guess is made when it's requested by the user.


Changes: parser.tags was renamed to parser.PARSER_TAGS for compatibility with hachoir-parser 1.0.


Changes: This release has a new type TimestampUUID60 (used in Windows GUID). The SeekableFieldSet class has been fixed. String value is always Unicode. A readBytes() method has been added to OutputStream. hachoir_core.profiler (profile method) and hachoir_core.timeout (call a function with a timeout) modules have been added.


Changes: A string value is now always Unicode, even on a charset conversion error. Creation of field value, display, and raw_display attributes is now fault tolerant and uses the cache. The SeekableFieldSet class is nearly complete and more robust. GenericFieldSet uses a lock to avoid field creation recursion. The limitedMemory() function was added to call another function with a memory limit. The Float80 type was added.


Changes: The HACHOIR_ERRORS constant was created, and is a list of minor errors that can be ignored. setup.py only uses setuptools when it's asked. The "truncate" optional argument was added to GenericString. The hexadecimal() text handler now accepts fields of any size. GenericInteger now raises an error when field size is bigger than 256 bits. humanDuration() was fixed for duration bigger than one year.