Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just sharing a node cli app for Kaitai Struct JSON dump #1142

Open
Thell opened this issue Nov 13, 2024 · 0 comments
Open

Just sharing a node cli app for Kaitai Struct JSON dump #1142

Thell opened this issue Nov 13, 2024 · 0 comments

Comments

@Thell
Copy link

Thell commented Nov 13, 2024

Thank you for the awesome tools! I'd like to share-back a lightweight tool I made to dump binaries to json using Kaitai Struct and Kaitai Struct Compiler along with json-stream-stringify in order to get away from browser/tab memory limits when dumping large binaries to JSON.

The repo is https://github.com/Thell/ksdumpjs and it is on npm at https://www.npmjs.com/package/ksdumpjs

When installed via npm install -g ksdumpjs the output looks like this:

> ksdumpjs .\test\formats\zip.ksy .\test\samples\sample1.zip -s
►  ksdump           Initialized timer...

Processing:      .\test\formats\zip.ksy
⚙️  Generating:      Zip
  -> Importing common/dos_datetime
     Parsing common/dos_datetime
🔍  Parsing binary:  .\test\samples\sample1.zip
📤  Transforming:    .\test\samples\sample1.zip
📤  Exporting:       jsons\sample1.json
✅  Success          jsons\sample1.json

[█] ksdump           Timer run for: 129ms

The keys for instance values are output in a different order than the web-ide or ksdump but when sorted (using jq) the outputs are equal between ksdumpjs and the web-ide. Perhaps an 'official' dumper that didn't require the Visualizer (along with Ruby) will someday make an appearance but in the meantime this will hopefully help others. :)

Anyhow, just want to say thanks again for the cool tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant