3 ms·
In addition to "pack" and "struct", for prior art (or inspiration), look at any number of structured fuzzing frameworks (Peach might be a good example); constru
by tptacek 8y ago
In addition to "pack" and "struct", for prior art (or inspiration), look at any number of structured fuzzing frameworks (Peach might be a good example); constructing arbitrary binary formats from a recipe is how you build a structured fuzzer. I built one a few years ago that pursued a sort of DOM model, with id's and classes and path strings.
In the other direction, given the ability to spit out one binary character from the shell, you can bootstrap all the rest of this in pure shell script. I cheated and gave myself int{8..64} and did a whole ASN.1/DER in shell script. The shell has better control flow than custom language (but the custom language is a little simpler).
- cryptonector 8y agoI did a KSH DER codec once too! It started out as an attempt to decode OIDs that were all over a codebase, and we had no tools to decode them, and I wanted to see if they were correct (indeed, they were not all correct). Then I extended that script a bit to other types. 'Twas a fun little side project. With an FFI (which Bash has) one could do this much more easily than it was then (about 15 years ago, I think).