bdec 0.7.2

bdec project is an attempt to specify arbitrary binary formats in a markup language.
Binary formats typically aren't easily specified; they are rarely specified in a high level marked language such as ASN.1 (and such specifications cannot be retro-fitted to existing binary formats). The bdec project is an attempt to specify arbitrary binary formats in a markup language, and create a decoder and encoder automatically for that binary format given the high level specification.

The bdec xml specification uses constructs based on the constructs found in ASN.1.


The bdec library consists of a decoding / encoding library and command line decoding and encoding applications. Given a specification, the command line application will create an xml representation of the data contained in the binary file, and can (for some representations) convert the xml back to binary.

The library is capable of creating such xml output, or optionally a python object representing the constructs contained in the binary data.

For example; the xml representation of a FAT bootsector generated by running:

dd if=/dev/sda1 bs=512 count=1 | decode bootsector.xml

Main features:

  • It is easy to quickly write (and read) a specification
  • No need to write a custom decoder (all error conditions are handled internally; decoding either passes or fails).
  • The command line application allows visual inspection of problematic files.
  • Unicode aware, little-endian / big-endian aware
  • Specify fields down to the bit (eg: single bit flags)

last updated on:
July 11th, 2011, 14:36 GMT
license type:
BSD License 
developed by:
Henry Ludemann
ROOT \ Utilities
Download Button

In a hurry? Add it to your Download Basket!

user rating 10



Rate it!
What's New in version 0.7.0
  • Encoding data structures to binary is now supported.
  • This includes encoding from Python instances, XML, and C structures.
  • Specifications can now be split into multiple files by simply passing all of the specification files to the decode/encode/compile programs.
read full changelog

Add your review!