I need a command line like "ksc" which can take parameters "binary file" and "yaml file" and dump it in json format. WebIDE is doing the same through "ExportToJson", but i need the same functionality from command line.
Thank You
I need a command line like "ksc" which can take parameters "binary file" and "yaml file" and dump it in json format. WebIDE is doing the same through "ExportToJson", but i need the same functionality from command line.
Thank You
Copyright © 2021 Jogjafile Inc.
Affiliate disclaimer: I'm a Kaitai Struct maintainer (see my GitHub profile).
Use the utility
ksdump
included in the kaitai-struct-visualizer package. You can get it from RubyGems by runninggem install kaitai-struct-visualizer
(this will make the commandksdump
available on yourPATH
). You need to have Ruby installed, though. Alsokaitai-struct-compiler
is required to be installed (see https://kaitai.io/#download for instructions) and set up on yourPATH
.The usage for your case is the following:
Alternatively, instead of installing Ruby, Kaitai Struct compiler and visualizer manually, you can pull the official Docker image https://hub.docker.com/r/kaitai/ksv, which comes with everything included. The usage looks like this (naturally, you need to get Docker in the first place):
But consider that the Docker image
kaitai/ksv
takes up 1.06GB (I didn't expect that - I guess it's quite easy to get Docker images bloated), so you might not want to download it all through a slow network or a connection with data limit.