0

So i have written a python tool using capstone that disassembles the code section of a ELF binary using capstone.

now i want to also create and show the call-graph of this binary in a dot format, I tried googling but couldn't find how to do this with capstone or if its possible with it or not, i also heard about some other frameworks like radare2 and such but I'm still not sure which framework is good for this purpose

so what do you guys suggest? how can i make the call-graph by using some framework in my own code? ( i don't want a tool for this, i already know there are tools/programs for this out there, and i dont want to copy their code for this i want to write my own)

is it even possible with static analysis, meaning just by reading the file? considering some function calls might be indirect? ( i only need to do this using call and ret instructions)

1

My suggestion is that you generate a graphviz (https://graphviz.org/) file with all the nodes and all the information that you want and then with the command dot you paint the graph. However, if you want to make it on realtime or on a fancy UI I will suggest you use networkx (https://networkx.github.io/)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.