4 ms·
Looks cool, but in my view a key feature is: can it save a file back, using the same grammar?
by wlievens 12y ago
Looks cool, but in my view a key feature is: can it save a file back, using the same grammar?
- MontagFTB 12y ago(This response is a repost from here: http://binspector.github.io/blog/2014/10/13/binspector-a-binary-format-analysis-tool/#disqus_thread http://binspector.github.io/blog/2014/10/13/binspector-a-bin...) I have given a lot of thought into the question of output. Throughout the parse tree there is an implicit DAG of dependencies - this value affecting that read operation over there, etc. The real trick in making a generic output routine from a bfft is reversing this DAG, so e.g., if I add a pixel down here the parse tree can re-stabilize automatically into something valid. This also opens the door to generic editing of binary formats. My understanding is that DAG reversal is an NP-complete problem, but I suspect with file formats we're dealing with a subset of the space and it might not be as difficult as I am imagining.
- wlievens 12y agoI would think that for some formats it's trivial whereas for others it's neigh impossible. There's nothing wrong with offering that feature to a subset of grammars though. similar idea: generating a nicely formatted spec document from the grammar.