Commit graph

227 commits

Author SHA1 Message Date
pancake
a02cdf666d Fix aagraph help and add '!' to toggle experimental disasm color 2015-07-15 16:11:39 +02:00
pancake
df25085ffe Add custom color support for graphs and handle VVR and VVVq 2015-07-15 15:54:20 +02:00
pancake
390a0e61bc Fix some coverities 2015-07-15 15:08:56 +02:00
Riccardo Schirone
11c495a0b5 core/graph: fix a null dereference 2015-07-14 19:03:05 +02:00
Riccardo Schirone
66753a1050 core/cmd_anal: accept spaces in title and body for 'agn' and 'age' 2015-07-14 18:39:31 +02:00
Riccardo Schirone
a6c23407b2 cons/cons.c: avoid printing last line
fix #2908
2015-07-14 18:06:55 +02:00
Riccardo Schirone
be7b1edd2e core/graph: when re-adding edges, put them in the original position
fix #2936
2015-07-13 20:33:52 +02:00
Riccardo Schirone
6c6e9f5f3c util/graph: RGraphEdgeCallback now accepts a RGraphEdge 2015-07-13 20:33:52 +02:00
pancake
8e9058ed26 Avoid using keywords like class 2015-07-13 14:43:13 +02:00
Riccardo Schirone
4eedd69a91 core/cmd_anal: implement ag-/agn/age/agg to work with core->graph 2015-07-13 13:48:31 +02:00
Riccardo Schirone
3d29108225 core/graph: add r_agraph_print 2015-07-13 13:48:31 +02:00
Riccardo Schirone
975e30ac6c core/graph: add r_agraph_get_node 2015-07-13 13:48:31 +02:00
Riccardo Schirone
9391131479 core/graph: add r_agraph_add_edge 2015-07-13 13:48:31 +02:00
Riccardo Schirone
6c55098a44 core/graph: add r_agraph_add_node 2015-07-13 13:48:30 +02:00
Riccardo Schirone
e58bf2350f core/graph: change name AGraph => RAGraph and make it a public structure 2015-07-13 13:48:30 +02:00
Riccardo Schirone
c667b65479 core/graph: remove RCore,RAnalFunction dependencies from AGraph
core/graph: initialize movspeed outside the constructor

core/graph: change RANode "text" field to "body"

core/graph: free the history stack when reloading nodes

core/graph: make coverity happy. No need to check for NULL

core/graph: increase the minimum height of a node
2015-07-13 13:48:30 +02:00
pancake
5cf8dc1c36 Honor graph.scroll by default 2015-07-09 01:38:36 +02:00
Riccardo Schirone
a13f04ba58 core/graph: print the whole graph when the graph is not interactive 2015-07-07 00:54:38 +02:00
Riccardo Schirone
42e1bab640 core/graph: use get_anode instead of explicit casting 2015-07-07 00:54:38 +02:00
Riccardo Schirone
316a529a80 core/graph: fix a regression where dots are printed out of node 2015-07-07 00:54:38 +02:00
Riccardo Schirone
261dd145d9 core/graph: fix memleaks in combine_sequences 2015-07-07 00:54:38 +02:00
Riccardo Schirone
f6774e5938 core/graph: traverse nodes with based on (x,y) coordinates 2015-07-04 02:34:59 +02:00
Riccardo Schirone
fe794fcc16 core/graph: const-ify 2015-07-04 02:34:58 +02:00
Riccardo Schirone
937d87f893 core/graph: fix warnings 2015-07-04 02:34:58 +02:00
Riccardo Schirone
b3589b4a0c core/graph: move reversed edges, when possible, to make more space 2015-07-03 09:40:35 +02:00
Riccardo Schirone
5dad19fb06 core/graph: implement place_originals
core/graph: implement place_single
core/graph: implement combine_sequence
core/graph: implement collect_left/right_changes
2015-07-03 09:40:35 +02:00
Riccardo Schirone
b0aa2add3b core/graph: better implementation of dist_nodes
core/graph: add set_dist_nodes
2015-07-03 09:40:35 +02:00
Riccardo Schirone
d2c362344a core/graph: implement place_dummies
core/graph: compute vertical partitions and left classes
core/graph: implement place_left
core/graph: implement adjust_left_class
core/graph: implement methods called in place_virtuals for left/right
2015-07-03 09:40:35 +02:00
Riccardo Schirone
60107b1652 core/graph: refactoring creation of ascii_node and add is_reversed field
an ascii_node (ANode) is reversed when it's a dummy node and it's part
of a back edge that is reversed during the layout algorithm
2015-07-03 09:40:35 +02:00
Riccardo Schirone
57f8c7506f core/graph: count crossing also between layer i and layer i+1 2015-07-03 09:40:35 +02:00
Riccardo Schirone
e5bd85eb06 core/graph: make alternative movement speed configurable 2015-07-02 18:23:10 +02:00
Riccardo Schirone
647e957707 core/graph: add commands to toggle between different movement speeds 2015-07-02 18:23:09 +02:00
Riccardo Schirone
baeab6eeae core/graph: print some dots when cropping text because of zoom 2015-07-01 13:46:41 +02:00
Riccardo Schirone
687b255665 core/graph: use '0' to set zoom to the default value
In this way we have a key to center the screen in every mode we have
(graph, minigraph, etc.)
2015-07-01 13:46:41 +02:00
Riccardo Schirone
5036518c0a core/graph: allow to zoom out until the minigraph appears 2015-07-01 13:46:41 +02:00
Riccardo Schirone
3829b1a82b core/graph: set minimal dimensions for nodes 2015-07-01 13:46:41 +02:00
Riccardo Schirone
ceeaa36620 core/graph: fix out of nodes text when zoom < 100 2015-07-01 13:46:41 +02:00
Riccardo Schirone
0749329762 core/graph: fix out of screen nodes when zoom > 100 2015-07-01 13:46:41 +02:00
Riccardo Schirone
822c6704d1 core/graph: . should center the graph to the current node 2015-07-01 13:46:40 +02:00
Riccardo Schirone
8c0bb719c2 core/graph: code refactoring, make zoom a field of the AGraph structure 2015-07-01 13:46:40 +02:00
pancake
fbc1746ffa Add +/- keys for zoom in/out 2015-06-29 17:00:12 +02:00
pancake
47cbce50c4 Deprecate WASD keys in ascii graph to make azerty users happy 2015-06-28 02:24:46 +02:00
Riccardo Schirone
1b69ac97d5 core/graph: not remove nodes while traversing them 2015-06-17 23:20:28 +02:00
Riccardo Schirone
b5b548255e core/cmd_debug,core/graph: fix warning types with sdb_num_get 2015-06-17 23:20:28 +02:00
Riccardo Schirone
814bf3a49c core/graph: implement layering and ordering of nodes in each layer 2015-06-17 11:22:10 +02:00
Álvaro Felipe Melchor
53badd517d Fix COVs 2015-06-17 00:22:40 +02:00
Anton Kochkov
c871d8e155 Fix CID 1306716, 1306711 2015-06-15 21:15:57 +03:00
Anton Kochkov
966744b4c2 Fix CID 1306706 2015-06-15 20:44:37 +03:00
Riccardo Schirone
b279f282ba Refactoring ascii art graph
util/stack: extend stack api with r_stack_size
core/graph: use RStack instead of a custom implementation
util/graph: change implementation to use lists and extend api
core/cmd_debug: avoid free r_graph_get_nodes
core/graph: rename some functions and use typedefs for graph struct
core/graph: use RGraph for the ascii art graph
util/list: add const whenever possible
util/graph: add const on r_graph_get_nodes/neighbours
core/graph,core/cmd_debug: use const
core/graph: clean the code (add comments, use const, remove magic nums)

* use r_graph_node_iter for the current node
* reset graph when reloading nodes
* on callgraph edges printing, nth should be 0
* force seek of current node when reloading nodes
* use graph_foreach_node
* core/graph: remove get_current_node because useless
2015-06-14 00:46:11 +02:00
pancake
3013b98099 Add key.s/key.S config vars and fix aagraph glitch 2015-06-12 02:19:58 +02:00
Riccardo Schirone
33a550aa23 core/graph: fix undefined behaviour in event_resize callback
* fix bug in VV introduced by f802bdf3b1
* code refactoring
2015-06-11 12:46:36 +02:00
pancake
f802bdf3b1 Add afg command to print non-interactive ascii-art graph 2015-06-11 03:55:15 +02:00
pancake
03aa69b261 Implement reverse rap for system() 2015-06-09 01:45:39 +02:00
Riccardo Schirone
8cb35540c7 cons: use all the available space in the screen
* r_cons_get_size should return the number of rows, why is there a "-1"?
* the newline at the end of the canvas converted to string (in
  r_cons_canvas_to_string) make things shift up one line
* r_cons_canvas_write should consider "left" (which is the number of
  chars available from x until the right side of the screen) and not
  "left - 1". Moreover, since "slen" is at most the maximum number of
  characters that we can print in that row, there is no need to check
  if we can write those bytes
* r_cons_flush usually add a newline, but we shouldn't print it because
  otherwise everything will shift up by one line
2015-06-04 19:11:16 +02:00
Riccardo Schirone
225cc70e37 core/graph: do all update of the state in the graph_refresh function 2015-06-03 17:59:53 +02:00
Riccardo Schirone
ad59230ef9 core/graph: push also tab/TAB movements in the history
core/graph: rename + moving functions
2015-06-03 17:59:53 +02:00
Riccardo Schirone
e9facfe535 core/graph: clean graph_reload_nodes
leave the selection of the right thing to do to sub-functions.
reload_nodes choose which node to reload based on the status of g.
graph_set_layout choose which layout to apply based on the status of g.
2015-06-03 17:59:53 +02:00
Riccardo Schirone
e189a9ba49 core/graph: use a function to update the is_small_nodes flag
in this way we can always update the size of the nodes at the right
moment.
2015-06-03 17:59:52 +02:00
Riccardo Schirone
823c7f8b1b core/graph: extract function graph_print_nodes/edges 2015-06-03 17:59:52 +02:00
Riccardo Schirone
5505d59a81 core/graph: avoid realloc of edges at every step of the loop 2015-06-03 17:59:52 +02:00
Riccardo Schirone
91c4229660 core/graph: use n_edges/n_nodes instead of NULL terminating the list 2015-06-03 17:59:52 +02:00
Riccardo Schirone
cfa69ae7a8 core/graph: choose type of printing in graph_reload_nodes
extract graph_prev/next_node to move to the previous/next node in the
graph.
2015-06-03 17:59:52 +02:00
Riccardo Schirone
78471faf98 core/graph: code refactoring
core/graph: extrat struct graph

core/graph: replace updateSeek with graph_update_seek

core/graph: change names to some functions

core/graph: refactoring of graph_set_layout

core/graph: make ostack part of the struct graph
2015-06-03 17:59:52 +02:00
Riccardo Schirone
3315382895 core/graph: null check should be before dereferencing the pointer 2015-06-03 17:59:52 +02:00
jvoisin
7c096bb1f4 Fix various coverity issues 2015-06-01 21:10:37 +02:00
pancake
a793859d5b Fix some COVs 2015-06-01 11:20:53 +02:00
pancake
c27327cac5 Fix #2648 - save restore arg/var name and type 2015-05-31 23:46:32 +02:00
Riccardo Schirone
676453db6e Simplify canvas boundary check for node text 2015-05-31 23:11:03 +02:00
pancake
bb151c1607 Fix two out-of-canvas node location and missing box lines issues 2015-05-31 22:27:47 +02:00
Riccardo Schirone
da16e1424d core/graph: when printing the text inside a node, consider borders 2015-05-31 20:20:31 +02:00
Riccardo Schirone
17cc0e3c41 core/graph: support partial writing of node title 2015-05-31 20:20:31 +02:00
Riccardo Schirone
e6500b2ec1 core/graph: use constants for the margin of the text inside the node 2015-05-31 20:20:31 +02:00
Riccardo Schirone
14e8c9aead core/graph: remove duplicated print of title in normal_Node_print 2015-05-31 20:20:31 +02:00
Riccardo Schirone
212dbc1024 core/graph: split Node_print in two sub functions, based on small_nodes 2015-05-31 20:20:31 +02:00
Riccardo Schirone
9ec497ccd8 core/graph: check for NULL values at the very start of Node_print 2015-05-31 20:20:31 +02:00
Riccardo Schirone
c60e009cd7 core/graph: code refactoring
core/graph: use while-loop instead of goto
core/graph: use constants instead of numbers
2015-05-31 20:20:31 +02:00
Riccardo Schirone
a104185d69 core/graph: avoid macros in the middle of the file 2015-05-31 20:20:31 +02:00
Anton Kochkov
4d58edede2 Prevent segfaults 2015-04-11 02:41:02 +03:00
pancake
eb42823a51 Add esil.gotolimit to restrict the number of words to run after an esil goto 2015-04-01 00:38:24 +02:00
Jonathan Neuschäfer
dcc1a15749 more EOF fixes 2015-03-23 16:16:37 +01:00
pancake
28d6c12043 V! -> V!!, VV(nofn) -> V!
- VV only opens if there's a function analized
- V! now opens the panels view
- V!! launches the 2048 game
2015-03-05 23:33:28 +01:00
pancake
ef293e4b66 Initial PoC for the Visual 2.0 (for now: VV) 2015-03-05 02:07:53 +01:00
jvoisin
838c467724 Coverifix once again 2015-02-19 15:04:58 +01:00
pancake
beda5fd111 Handle mouse wheel in Ascii Art graph - press 'm' 'M' to change mouse mode 2015-02-17 01:28:51 +01:00
pancake
d3ddbea631 Colorize node box 2015-02-15 21:48:46 +01:00
pancake
40edd608d1 Bring back the old edge style in the aa graph. Fix self loops 2015-02-15 21:34:12 +01:00
r0nk
5b8c813268 fixed offsets for graph` 2015-02-15 13:34:12 +01:00
pancake
1ba75dbd2a Fix support for RGB ascii-art graph lines within RConsCanvas 2015-02-14 05:10:03 +01:00
pancake
421dd1243f Obey scr.color in RConsCanvas from RCore.cmd("VV") 2015-02-14 04:50:29 +01:00
pancake
f2351636fe Fix r_cons_readline() signature and some code cleanup 2015-01-31 00:50:05 +01:00
pancake
d15d4daa25 Fix VV stepping with esil. Code cleanup in cmd_anal.c 2015-01-30 01:55:21 +01:00
pancake
86b3fa2a4c Fix graphs in debugger, only follow rip when stepping with 'z' 2015-01-13 03:18:42 +01:00
pancake
d9d9ac827b Implicitly ignore return value of some canvas gotos 2015-01-11 20:01:44 +01:00
pancake
377ec87272 Fix two null deref in RConsCanvas and another left border glitch 2015-01-11 02:54:27 +01:00
pancake
d713debdfc Fix left and top border issues with canvas text (nicer graphs) 2015-01-11 02:28:59 +01:00
pancake
c61368a0f3 Add support for asm.pseudo and asm.varsub for ARM and ARM64 2015-01-11 01:48:20 +01:00
pancake
c7e1fad6bc Add Vn (mini-ascii-art graph visual mode) 2015-01-09 11:39:25 +01:00
pancake
9bb64f1a4c Enhace Capstone-SPARC code analysis 2014-11-11 00:46:46 +01:00
pancake
658d6deee8 Initial add 'C' to toggle colors in ascii graph (buggy+experimental) 2014-11-07 09:56:39 +01:00
Jeffrey Crowell
9a44fbc8f4 Fix crash in graph where you print the current node twice. 2014-11-01 22:08:04 +01:00
pancake
a004393b32 Add more help for VV 2014-10-28 17:17:10 +01:00
pancake
d69175f38f Make graph debugger mode work and add cmd.gprompt 2014-10-23 03:29:05 +02:00
pancake
bc658c8a4e Fix #1553 - node select history and autoscroll, fixes tfu keys 2014-10-23 02:13:25 +02:00
pancake
238bd6b6c4 Fix VV: wheel issue and set scr.highlight via Vdh, V/ or VV/ 2014-09-28 04:01:31 +02:00
Jody Frankowski
320c43b262 Use get_fcn_in where it used _at 2014-09-26 18:14:09 +02:00
Jody Frankowski
df289d8611 Unify fcn_find and get_fcn_at in get_fcn_in and get_fcn_at 2014-09-26 17:16:28 +02:00
pancake
a18f7819d9 Fix the support for 0x0 sized terminals (adb shell) 2014-09-24 03:17:43 +02:00
pancake
932279ed7e Initial work to disable FCN_OLD. 2014-09-23 00:40:35 +02:00
pancake
a071ee29d7 Fix ascii art graph for one block graphs 2014-08-08 21:08:47 +02:00
pancake
c91f838821 Handle ':' prompt in aa graph too 2014-08-05 19:49:33 +02:00
pancake
0a292c936a Add asm.indent, handle 'xX' in aa graph and enhace ptr references 2014-08-05 18:03:14 +02:00
pancake
06108516b0 Allow resizing window when in aa-graph-view (VV) 2014-08-04 01:30:29 +02:00
jvoisin
69fa33ce78 Fix some coverity issues 2014-08-03 14:43:44 +02:00
pancake
29c3e1ba7a Fix more CIDs assigned to me 2014-08-01 12:07:08 +02:00
pancake
3fc1e58bc3 Fix oob glitch in ascii art graph 2014-08-01 00:54:04 +02:00
pancake
0f24b905f6 Initial implementation of VVV for ascii-art callgraphs 2014-07-09 05:05:22 +02:00
jvoisin
bc30cb72c6 Fix some coverity issues 2014-07-07 16:09:03 +02:00
pancake
0d68756791 Add r_str_crop() will be used by canvas to shifted render text 2014-05-18 03:41:39 +02:00
pancake
1ce6e7c45b Add rahash2 -d and -D to encode/decode base64 strings and files 2014-05-16 14:34:36 +02:00
pancake
ee276298b2 Fix memleaks in radiff2, segfaults in 8051 and aagraph 2014-05-09 03:06:05 +02:00
pancake
201231a7a5 Fix remaining segfault in RCons.canvas, still trashy output 2014-05-08 02:58:20 +02:00
pancake
7fa79a3f36 Fix some RCons.canvas bugs 2014-05-08 02:26:42 +02:00
Anton Kochkov
28e6648e62 Fix CID 1211141 2014-05-06 01:17:02 +04:00
pancake
1b37861c38 Fix null deref in graph 2014-05-05 14:03:27 +02:00
pancake
f9256d83de Add initial ascii-art graph layout and implement RCons.resize() api 2014-05-05 03:15:28 +02:00
pancake
71a105e444 Oops fix aagraph 2014-04-29 04:22:21 +02:00
pancake
7028b225bd Added 'VV' command to run the visual graph mode 2014-04-29 03:54:20 +02:00