by SloopJon · 5y ago · 0 comments
I'll have to give this one a try. It would be nice to be able to sift through binary data like bytecode or some non-standard serialization format without writing a one-off utility for it.
https://www.sweetscape.com/010editor/
It lets you write "templates" in a weird hybrid syntax that looks a lot like a C header file but also allows control statements that can decode complicated data structures in a few lines of script. It looks to have very similar capabilities to GNU Poke, but with a GUI.
But it least the VM is much faster than 101
type Packet =
struct
{
byte magic;
uint<16> length;
byte[length] data;
}
It also seems to have optional fields using conditions, using the optional extended header in MP3 id3v2 tag as an example: struct ID3V2_Tag =
struct
{
ID3V2_Hdr hdr;
IDV2_Ext_Hdr ext_hdr if hdr.extended_hdr_present;
}
(this is an alternative to another way it provides by using unions which work similar to C unions but each alternative also has conditions for when it is valid).So at least from the above i think it should be possible to declare types that work with variable length and prefixes like that.