wxHexEditor icon indicating copy to clipboard operation
wxHexEditor copied to clipboard

Feature: File templates

Open vdun opened this issue 9 years ago • 8 comments

Would be great to have the support of file templates/structure like :

  • 010Editor: [http://www.sweetscape.com/010editor/repository/templates/]
    • Helpful tools:
      • [https://github.com/d0c-s4vage/pfp]
      • [https://github.com/d0c-s4vage/py010parser]
  • Okteta: [https://docs.kde.org/trunk5/en/kdesdk/okteta/tools-structures.html]

This by making wxHexEditor able to read .bt or/and .osd files.

vdun avatar Aug 08 '16 20:08 vdun

By the date, Kaitai Struct is the fanciest tool for the task. It is available in form of runtime library and should be easier to support. There are plenty of structure descriptions available in form of .ksy files in the repo.

KillyMXI avatar Feb 11 '17 21:02 KillyMXI

I second the request, another tool i've tried in the past is https://sourceforge.net/projects/ff-extractor/

eadmaster avatar Aug 16 '18 01:08 eadmaster

#124 is an absolute prereq for implementing KS support.

IMHO for KS support it is needed to support dynamic plugins #132, add an API for generating tags, then take some embeddable interpreter, like https://bellard.org/quickjs/ , pass the API there and use it to interpret the KS-generated code.

BTW: https://gitlab.com/KOLANICH/kaitai2WxHexEditor.py

KOLANICH avatar Dec 14 '19 00:12 KOLANICH

i've just found these Okteta Structure Definitions that would be nice to be supported.

eadmaster avatar Dec 22 '19 21:12 eadmaster

I looked Okteta Strutcute Definitions and found that it's Java! Since it's not my favorite programming language, could execute a process to run it. How does it work? I don't know. If the definition just prepare tags for program, than it's easy to support Okteta Structure Definitions. I don't use Okteta, that much. Probably I just look it while I was searching huge file compatible Linux hex editors...

EUA avatar Dec 23 '19 00:12 EUA

Okteta was mentioned in the OP post, although the original link is no longer available.

I downloaded a couple of archives from the site. I got:

  • one .osd file - structure definition in XML format. I see no schema reference anywhere;
  • one .js file - structure definition as JavaScript code.

Okteta/Writing structure definitions wiki page seems to be a documentation for both types of definition.

JavaScript is not Java. JavaScript can be used as a pluggable scripting language much like Lua (and an example of embeddable interpreter was linked above).

I think Kaitai Struct more deserves to be a common language between binary exploration tools. But there might be a use for JavaScript for more tricky structures? - I'm not sure, haven't dig into any of these deep enough myself.

In terms of number of publicly available definitions for common structures and amount of community work around them, Kaitai Struct seems to be a healthier choice.

So I'm quite skeptical about reimplementing Okteta. But as a working model when making own design choice - worth to look at. Other hex editors with custom structure definitions:

And the task of supporting multiple different structure definition formats better be left for another time or another project, I think. (It seems reasonable to have a tool for conversion between formats and to have it as a separate project.)

Update. awesome-kaitai list contains more grammars in "Similar" section.

KillyMXI avatar Dec 23 '19 12:12 KillyMXI

And the task of supporting multiple different structure definition formats better be left for another time or another project, I think. (It seems reasonable to have a tool for conversion between formats and to have it as a separate project.)

What about integrating binspector into wxHexEditor?

  • https://github.com/binspector/binspector

ghost avatar Nov 15 '20 06:11 ghost

Looks like yet another alternative to choose from.

But I can't see why you decided to quote that part of my comment. Binspector seems to bring it's own structure definition format (yet another one) and the quoted part was about a way to support definition formats from different tools.

KillyMXI avatar Nov 15 '20 09:11 KillyMXI