radareorg/radare2

Structured document helpers

Open

#3222 opened on Sep 2, 2015

View on GitHub
 (5 comments) (0 reactions) (0 assignees)C (23,826 stars) (3,229 forks)batch import
RBinXMLgood first issuehigh-priorityjsonr2rtest-required

Description

R2 already have a json tokenizer, writing an xml one should be simple, and we can also use a C one using shlr/tcc or ALT to parse the structured code and define flags for every opened bracked etc. This can be useful to find and analyze binary stuff inside structured text documents like XML or JSON.

  • Add RBin plugin to load XML/JSON "symbols"
  • Add commands for text files
    • Seek to source line Nth
    • Seek to column Nth
    • Seek to token Nth
    • Seek to the end of the current scope (like % in vim ?)
    • Enumerate all start/end tokens

This way we can also replace ed.

This stuff can be implemented in RBin as a plugin that detects XML and JSON documents by checking the first bytes of the file.

Contributor guide