After analysing a function and pressing VV to go into graph mode, is it somehow possible to export/render the whole graph to an image?I have some huge main functions and it would be nice to have it all in an image for better exploring it.
radare2 ascii graph to image?
disassembly;radare2
The ag command and subcommands can help you to output the visual graph into Graphviz format.[0x00000000]> ag?|Usage: ag[?f]Graphviz/graph code| ag [addr]             output graphviz code (bb at addr and children)| ag-                   Reset the current ASCII art graph (see agn, age, agg?)| aga [addr]            idem, but only addresses| agc[j] [addr]         output graphviz call graph of function| agC[j]                Same as agc -1. full program callgraph| agd [fcn name]        output graphviz code of diffed function| age[?] title1 title2  Add an edge to the current graph| agf [addr]            Show ASCII art graph of given function... <truncated> ...| agv                   Show function graph in web/png (see graph.web and cmd.graph) or agf for asciiartFor example, you can output the visual graph as a dot file and then convert it to PNG.Here's an example to create an image from the main function of /bin/ls:$ r2 /bin/ls[0x004049a0]> aa[x] Analyze all flags starting with sym. and entry0 (aa)[0x004049a0]> ag main > graph.dot[0x004049a0]> !!dot -Tpng -o graph.png graph.dotThe dot utility is part of the Graphviz software which can be installed using sudo apt-get install graphviz.You can also output the graph into ascii-graph using the agf command.[0x004049a0]> s main[0x00402a00]> agf > ascii_graph.txtMoreover, if you are just searching for a comfort way to view the graph you can simply open the dot file inside Graphviz or use an online Graphviz viewer instead of converting it to an image file.