Questions tagged [kaitai-struct]

Kaitai Struct is a declarative language used to describe binary data structures.

Kaitai Struct is a DSL (domain-specific language), designed to describe binary data structures in human- and machine-readable way. Description of certain structure ("format") can be written once and then translated using a compiler into a source code for supported programming languages — and then used from any program in that language.

44 questions
0
votes
1 answer

Question: How to write `010 switch and if` in kaitai

I like the kaitai struct very much that I need to rewrite one of 010 binary template in kaitai. I've found structures similar to the following in my 010 template and I would like to know how to handle this in kaitai. Ex:1 typedef struct { WORD…
Tekz
  • 1,279
  • 14
  • 20
0
votes
1 answer

Understanding Kaitai Struct's 32 bit converter better

I am very much a newbie to binary interpretation and want to make sure I understand the data I am looking at. In particular I am looking at 2 bytes in little-endian: This is a timestamp and it shows me the following value in the object tree: In…
zgirod
  • 4,189
  • 3
  • 28
  • 36
0
votes
1 answer

Kaitai Struct - Optional block or attribute

My system has to be able to parse two types of very similar input data. If the data comes from a queue it has the following structure: record record ... record If the data comes from a file it has the following…
jizuel
  • 69
  • 1
  • 6
0
votes
1 answer

representing Double values in Katai

Some of the values I need to read in my ksy file are double's which I assume is a binary64 structure. The native data-types for a float won't stretch that far. Has anyone managed to represent this datatype in Kaitai ?
Alex
  • 1
  • 1
0
votes
1 answer

Ipv6Packet error when using pcap template

Attempting to read a pcap with Kaitai Struct in python. I have created the python files from the pcap.ksy file $ ./bin/kaitai-struct-compiler -t python --outdir xx formats/network/pcap.ksy $ ls xx ethernet_frame.py ipv6_packet.py …
pmqs
  • 3,066
  • 2
  • 13
  • 22
0
votes
0 answers

declarative language for complex & big binary files in .Net

What would be a possible possible solution to define a complex binary file to read and write from C# to it. Currently I access the fields the binary via fixed/hardcoded offsets, but I would like to have a cleaner solution. I looked into Kaitai, and…
thetemplar
  • 97
  • 2
  • 3
  • 9
0
votes
1 answer

Convert kaitai-struct .ksy file to "pretty" tree view

I need to write documentation for a parser that was developed in Kaitai. Given a .ksy file, is there any way to produce "pretty" views of the tree? There is a two year old fork of ksc that supports GraphViz output but the resulting output is pretty…
DKovar
  • 155
  • 1
  • 9
0
votes
1 answer

EOF error is given iwhile using Kaitai Stuct

I'm creating a binary parser using Python. However, it is giving an EOF error even while the bytes on the data file is still left. Did anyone face the same issue? And anyway to overcome this? from btsv3 import Btsv3 import os import…
user8622369
0
votes
1 answer

Using kaitai struct on stm32

Has anyone used kaitai struct on STM32 processor familly? I would like to use it to parse data from serial port and I am a little bit lost.
mravenca
  • 11
  • 5
0
votes
0 answers

kaitai struct code unable to get output in eclipse ide

hi i am very newer to kaitai struct, how do i run a code in eclipse which is parsed to java(target langage) on kaitai struct webide, i have gone through the kaitai struct docs, still i have some doubts, can someone help me? i have posted parsed…
0
votes
1 answer

Parsing Hex dump

I recently came across a kaitai struct to deal with arbitrary binary formats. Now the thing is I have a hex-dump what I mean by that is I have a file which i want to parse and its in hex format when i use the visualizer in the web ide of kaitai for…
Srikar
  • 351
  • 5
  • 16
0
votes
0 answers

c++ parsing binary message library with bit fields

Hi is there any descent binary parser AND builder library with support of bit fields in schema( I mean fields in the protocol which have arbitrary bit length and not standard int 32 bits or such). Protobuf and Flatbuffers does not seam to support…
Boris
  • 1,311
  • 13
  • 39
-1
votes
2 answers

Kaitai code writing

I recently started kaitai-struct for dealing with arbitrary binary formats. I have created the .ksy file for my data and parsed it to targeted language that is java. Now can anyone point me how to pass the input file that has the data and how to get…
Srikar
  • 351
  • 5
  • 16
-3
votes
1 answer

Exceptions in Kaitaistruct code - Parse error: undefined

I am very new to Kaitai, please help me to solve these exceptions. Code: meta: id: picosat.ksy file-extension: picosat.ksy endian: be doc: | :field dest_callsign: ax25_frame.ax25_header.dest_callsign_raw.callsign_ror.callsign …
1 2
3