Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured document helpers #3222

Open
3 tasks
radare opened this issue Sep 2, 2015 · 5 comments
Open
3 tasks

Structured document helpers #3222

radare opened this issue Sep 2, 2015 · 5 comments
Labels
good first issue high-priority High priority bugs json Parsing and producing JSON format r2r Regression tests RBin test-required XML Parsing and producing XML format

Comments

@radare
Copy link
Collaborator

radare commented Sep 2, 2015

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.

@radare radare added the RBin label Sep 2, 2015
@radare radare added this to the 0.10.0 milestone Sep 2, 2015
@radare
Copy link
Collaborator Author

radare commented Sep 2, 2015

Related https://github.com/radare/alt

@radare radare modified the milestones: 1.0.0, 0.10.0 Sep 2, 2015
@radare radare modified the milestones: 1.1.0, 1.0.0 Oct 27, 2016
@radare radare modified the milestones: 9999, 1.1.0 Dec 18, 2016
@radare
Copy link
Collaborator Author

radare commented Oct 16, 2017

I have implemented this for JSON, we will need that for XML too

@XVilka
Copy link
Contributor

XVilka commented Mar 8, 2019

See

@XVilka XVilka added json Parsing and producing JSON format XML Parsing and producing XML format labels Mar 8, 2019
@XVilka
Copy link
Contributor

XVilka commented Mar 8, 2019

There is even more - we can consider to reuse Tree Sitter library to generate parsers for all these languages:

@XVilka
Copy link
Contributor

XVilka commented Apr 15, 2019

See also CSV support request

@XVilka XVilka modified the milestones: 9999, 4.6.0 Apr 15, 2020
@XVilka XVilka added the high-priority High priority bugs label Apr 15, 2020
@XVilka XVilka pinned this issue Apr 29, 2020
@ret2libc ret2libc removed this from the 4.6.0 milestone Jul 17, 2020
@XVilka XVilka added test-required r2r Regression tests labels Sep 24, 2020
@XVilka XVilka unpinned this issue Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue high-priority High priority bugs json Parsing and producing JSON format r2r Regression tests RBin test-required XML Parsing and producing XML format
Projects
None yet
Development

No branches or pull requests

3 participants