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

Export to other formats? #22

Open
0ff opened this issue Oct 10, 2018 · 3 comments
Open

Export to other formats? #22

0ff opened this issue Oct 10, 2018 · 3 comments

Comments

@0ff
Copy link

0ff commented Oct 10, 2018

Hi, I'm using ddbug for reverse-engineering a binary (that, as luck would have it, includes dwarf) - in fact, it's pretty much the only tool I was able to find that can understand (the helplessly outdated) DWARF 2 correctly (without segfaulting (dwarfdump, readelf), hanging (IDA), producing completely wrong output (pyelftools) or simply refusing to load the binary (gdb)).

After playing around with the html export, I began wondering if other exports would make sense to you?
How about JSON (for further processing), C-Style header files (at least for functions, structs, enums) and maybe even idc-Files for use with IDA?
I began implementing JSON export by adding serde to many of the internal data structures, but I was wondering if that would even be something you'd be interested in? It would probably require changes in the way you keep track of data - for instance an EnumerationType currently doesn't know any of it's enumerators without being given the File - this doesn't play too well with serde's way of serializing data ;-)

So this "issue" is pretty much a request for discussion - would you like to see more outputs such as JSON and are you open for changes to the data structures should those be needed?

@philipc
Copy link
Collaborator

philipc commented Oct 10, 2018

Hi, I'm glad to hear it's useful!

The requirement for enumerators to be given a file is intentional. This lets us reduce the memory usage. For enumerators this wouldn't be too bad to change, but for functions I definitely don't want to be loading all the inlined functions, variables, and locations up front.

I think adding exports for JSON, C-Style headers and idc-Files would be fine. It may make sense for this to be in another crate, since it wouldn't share much with the existing text/html output. It would be fine for that crate to be kept in this git repo though.

Some changes to the data structures are okay, as long as it doesn't significantly affect performance.

@Bktero
Copy link

Bktero commented Feb 28, 2022

I am just starting to try ddbug, and JSON would be great in order to parse it with other tools (let's say, a Python script) :)

@yoofie
Copy link

yoofie commented Mar 16, 2023

Just a FYI for random people reading this, I made a tool to format the output file to JSON for my own micro controller projects. Only C based projects work at the moment (C++ not supported). Perhaps it may be useful to somebody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants