HPI icon indicating copy to clipboard operation
HPI copied to clipboard

Possible feature: Parse binary data using Kaitai Struct

Open Joshfindit opened this issue 2 years ago β€’ 2 comments

Parsing binary files has historically been a challenge for users who want access to the data contained within them, but I’ve recently come across (and successfully used) Kaitai Struct to do exactly that.

While of course HPI users can write their own binary parser, output JSON or some other human-friendly format, and then write an importer for that output, Kaitai has a library of parsable files already as well as a repo that accepts pull requests to add to that library.

Adding this as a suggestion, though it’s more of a way to open the discussion to HPI devs and community

Joshfindit avatar Apr 10 '22 16:04 Joshfindit

Thanks, I've heard of Kaitai as well, but haven't had a chance to try it yet! Will keep it in mind.

Luckily :sweat_smile: I haven't had many binary formats that I had to handle yet, maybe the only exception is Kobo parser which has some interesting code... https://github.com/karlicoss/kobuddy/blob/6aeaf69a3fee1574a88b19ca28e3608b605a8827/src/kobuddy/init.py#L670-L683

karlicoss avatar Apr 10 '22 16:04 karlicoss

Luckily πŸ˜… I haven't had many binary formats that I had to handle yet, maybe the only exception is Kobo parser which has some interesting code...

Looks like me trying to reverse engineer binaries in the before times. if blob[pos:].startswith(wtf): is very relatable πŸ˜‚

Joshfindit avatar Apr 11 '22 11:04 Joshfindit