kaitai-io / kaitai_struct

Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Nim / Perl / PHP / Python / Ruby
https://kaitai.io
4.04k stars 199 forks source link

Question: Can I use Kaitai in opposite direction? (manually fill structure with data->create stream from structure->write raw data f.e. to file) #1003

Closed iboofkratom closed 1 year ago

iboofkratom commented 1 year ago

Hi, I have a question. I know Kaitai can be used to parse raw data into data structures. And I really like it for this purpose. But can Kaitai also be used for the opposite process? For example - what if I wanted to use it for creating communication protocols (custom packets): On one side I want to recieve a packet and parse it. I know Kaitai can do this. But on the other side, I would like to fill my custom data structure with data and than create raw data stream from it, which could be sent to the first device. Is this possible with Kaitai? Sorry for noob question. Thanks!!

generalmimon commented 1 year ago

Duplicate of #27

generalmimon commented 1 year ago

But on the other side, I would like to fill my custom data structure with data and than create raw data stream from it, which could be sent to the first device. Is this possible with Kaitai? Sorry for noob question.

Not yet, see https://doc.kaitai.io/faq.html#writing.

iboofkratom commented 1 year ago

Okay, thanks for response!