Kaitai Struct: a tool for dealing with binary formats — Petr Pucil

Join us at hack.lu 2025 — Info & Registration

Duration: 30 min

Type: Talk

Speakers: Petr Pucil

Abstract

Kaitai Struct is a tool for dealing with binary formats. Binary formats are everywhere: archive files, executables, filesystems, multimedia files, network protocols, etc. If your application needs to read data in a specific binary format, you need a parser that unpacks the bytes into meaningful data structures that you can work with. There are libraries doing that for popular formats, but what if there is no suitable library in your programming language for the format you need?

Description

Kaitai Struct has got you covered: it introduces a declarative domain-specific language (based on YAML) for describing the structure of arbitrary binary formats. Format specifications in this language are consumed by a compiler, which generates ready-to-use parsing modules in 12 programming languages (C++, C#, Go, Java, JavaScript, Lua, Nim, Perl, PHP, Python, Ruby, Rust). It is also possible to generate Java and Python modules that support both parsing and serialization (writing structures to bytes in the specified binary format). There are more than 180 format descriptions in the format gallery and hundreds more in various GitHub projects.

This talk will focus on visualization and dumping tools that are part of the Kaitai project: the console visualizer and Web IDE. They are invaluable for debugging file formats, reverse engineering and forensic analysis.

View on pretalx