Skip to content

Kaitai Struct: visualizer and hex viewer tool GUI in Java

License

Notifications You must be signed in to change notification settings

pfroud/kaitai_struct_gui

 
 

Repository files navigation

Kaitai Struct: visualization GUI tool in Java

This is a Java-based GUI for data structure visualizations in binary formats, based on Kaitai Struct project. This vis tool uses Java's Swing for its GUI elements.

screenshot

Its functionality is akin to similar projects:

... but this Java version is significantly simpler and is no longer under active development.

Kaitai Struct is a declarative language used to describe various binary data structures, laid out in files or in memory: i.e. binary file formats, network stream packet formats, etc.

The main idea is that a particular format is described in Kaitai Struct language (.ksy files) only once and then can be compiled with this compiler into source files in one of the supported programming languages. These modules will include the generated code for a parser that can read described data structure from a file / stream and give access to it in a nice, easy-to-comprehend API.

Build

Install Java (JDK 8 or newer) and Apache Maven. If on Windows, also install Git.

Download or clone this repository. Run this command:

mvn install

then the output will be in a subdirectory called target.

Compilation steps

When a ksy file is selected in the gui, two things happen:

flowchart LR
  KSYFile[Kaitai Struct YAML file\nmy_type.ksy]
  JavaSourceCode[Java source code file\nmyType.java]
  ClassFile[Java class file\nmyType.class]
  KSYFile -- kaitai-struct-compiler --> JavaSourceCode
  JavaSourceCode -- javac --> ClassFile
Loading

Usage

Depending on the system, double-clicking on the jar file may launch the GUI.

Otherwise, launch the GUI via the command-line. The exact name of the jar file will vary. The form is:

java -jar kaitai_struct_visualizer_java.jar

The input files can be specified as arguments, in this order:

java -jar kaitai_struct_visualizer_java.jar binaryFileToParse ksyFile

Licensing

This GUI vis tool project itself is copyright (C) 2016-2022 Kaitai Project.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Libraries used

Vis tool depends on the following libraries:

About

Kaitai Struct: visualizer and hex viewer tool GUI in Java

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Java 94.3%
  • Kaitai Struct 5.7%