195 Commits

Author SHA1 Message Date
pancake
b401cdda8e Fix #10770 - Only gather function metadata for afll and aflj 2018-07-19 11:49:58 +02:00
David Carlier
c5ec231946 Attempt to fix #10693 issue. 2018-07-17 17:41:51 +02:00
pancake
bab054835f Fix warnings and make omo depriorize the new map by default 2018-07-08 23:11:37 +02:00
radare
50e1c69874
Kill anal.split config variable (#10619) 2018-07-04 15:51:37 +02:00
Florian Märkl
f44864c0ea Add in_functions to p- (#10545)
* Use macro in cmd_print_blocks()

* Add in_functions to p-
2018-06-30 01:54:43 +02:00
sivaramaaa
f08d7f4614 Prevent register based var sub in disas 2018-06-29 14:33:11 +02:00
sivaramaaa
6e124742e4 Intial support for register base args 2018-06-29 14:33:11 +02:00
radare
4924d1ff1e
Improve vv visual function browser and add afls to sort function list (#10525)
* Improve vv visual function browser and add afls to sort function list
* afls->afl+, sort afls help
* afls: new command (the old afls is now named alf+)
* Fix glitch in vv and fix behaviour in vb: and vbF
* add the ability to select column with tab to scroll with jk in disasm
* add colors
* enter seeks to the function
* var list row selector fixed
2018-06-28 00:54:50 +02:00
Riccardo Schirone
2df06bd870 Fix ELF issue with null SHT entries (#10449)
* format/elf: extract function to avoid duplicated code
* format/elf: use ut64 to avoid errors in ELF32

Otherwise, while analyzing ELF32, -1 will be interpreted as the unsigned
value 0xffffffff, which is very different from -1 (0xffffffffffffffff).

* format/elf: fix symbols with shndx == SHT_NULL

Symbols with shndx == SHT_NULL should not be listed as symbols but they
should be available when other ELF structures (imports, relocs, etc.)
reference them.

This patch adds those symbols in the symbols_by_ord table but not to the
list of available symbols. Imports/relocs/etc. work by indexing symbols
by symbol index, so they are going to use the symbols_by_ord table and
make everything work.

Moreover, it refactors a bit the relocs function to avoid duplicated
code.

* bin: setimportd/setsymbold should clone the import/symbol
* bin/bin.c: free fields only when sym is not NULL
* format/elf: do not filter out symbols with size == 0 and consider sht_null symbols in shdr too.
* bin/bin.c: create R_STR_DUP macro and use it in _clone functions
* format/elf: when parsing symbols from phdr, stop at first UNK type/bind
* create some R_BIN defines to handle strings related to TYPE and BIND
  in RBinSymbols
* format/elf: add a doc
2018-06-26 13:48:53 +02:00
Vanellope
258fa40ac8 fix some of those defects pointed out by coverity in canal (#10372) 2018-06-17 13:17:02 +02:00
vane11ope
5d4e68d589 covered a coverity defect 2018-06-17 09:20:40 +02:00
sivaramaaa
409419e4b2 Add ahr command to set hint for func ret values 2018-06-10 03:17:33 +02:00
sivaramaaa
c858dae72c Honor op mask in r_core_anal_op 2018-06-10 03:17:33 +02:00
sivaramaaa
e5bbaffbfe Refactor code to change R_ANAL_OP_MASK_ALL to appropriate value 2018-05-31 19:05:54 +02:00
cyanpencil
8a65873b64 Fix graph.from graph.to behaviour
Updated graph.from graph.to help

Updated visual help

Removed cmd.graph unused config variable

Whitespace cleanup
2018-05-24 00:15:35 +02:00
cyanpencil
c774c1209e Fix 'agj @ 0' inconsistency 2018-05-24 00:15:35 +02:00
Adrian Studer
5f3f4bfc99 add missing data xref for xjmp - issue #10066 (#10173) 2018-05-23 22:58:55 +02:00
cyanpencil
4c040aeaca Added agA global graph and agR global graph 2018-05-22 09:36:14 +02:00
pancake
31ad955bab Use r_io_read_at instead of r_core_read_at which is now deprecated 2018-05-21 23:06:00 +02:00
pancake
9bcae5a9d2 Fix last covs 2018-05-21 22:13:07 +02:00
pancake
ceba14c612 Fix last covs 2018-05-21 11:32:37 +02:00
Giovanni
b4b3563567 asm.fcnlines > asm.lines.fcn (#10140) 2018-05-21 02:01:47 +02:00
cyanpencil
2348fdaf69 Added import graph; updated ag? help
Removed agg? help

Removed unused variable warning
2018-05-21 01:55:43 +02:00
cyanpencil
6e7e64f48b Additional fixes in agd output format
Fix rebase

Fix whitespace
2018-05-18 10:42:06 +02:00
cyanpencil
2c95ffc684 Added data graph (aga) with all output formats
Added r_core_anal_datarefs() and finished support for aga
2018-05-18 10:42:06 +02:00
sivaramaaa
49aa74e10f Refactor types and make array of struct work with ts (#10121)
* Refactor and Move anal/types.c to util/
* Make struct of struct work with .ts and fix ts*
* Array of struct works now with ts
2018-05-18 10:32:31 +02:00
Adrian Studer
8b1257f12f Always return sorted xref/ref lists (#10070) 2018-05-16 10:18:12 +02:00
Luca Di Bartolomeo
0c9b96b682 Support for every output format for callgraph (agc and agC) (#10103) 2018-05-15 23:43:51 +02:00
sivaramaaa
0adef36e84 Fix fcn maxstack issue in variable recovery (#10086)
* Fix afv commands and other issues
* Honor anal.vars
* Fix some issue in stackop due to inconsistent esil
* Fix afvd printing issue
* Fix vars summary and add afv* to help
2018-05-15 23:14:09 +02:00
Luca Di Bartolomeo
4364aa3bf0 fixes + refactoring (#10078) 2018-05-12 09:19:58 +02:00
Luca Di Bartolomeo
731b067f25 Add every output support for agg graph + some agf fixes (#10063) 2018-05-11 10:58:33 +02:00
radare
223232737a
Fix #8874 - pdf works as expected now :) (#10061) 2018-05-10 17:33:34 +02:00
Riccardo Schirone
d730bacc08
xrefs fixes (#10034)
* anal/xrefs: more uniform xref type output

* anal/xrefs: reduce confusion of `ax` command

* core/cmd_anal: add commands to add string references

* anal/xrefs: when using radare2 output, ref->at should be the second arg

* core/cmd_anal: remove afx commands, except for listing

Since we removed per-function references, now there are only global
ref/xref info, so there's no need to have per-function commands to
handle refs/xrefs.

* core/canal: use "ax" commands instead of "afx"
2018-05-08 08:41:53 +02:00
Luca Di Bartolomeo
94807b4625 Support every output format for the bb graph (agf) (#10030) 2018-05-07 19:55:54 +02:00
Riccardo Schirone
b703dfbf17 anal/xrefs: single, global xrefs API
* several bugfixes
* Fix xrefs/refs confusion with asm.cmt.refs
* Also check if xref source is valid offset
* Fix ax* to show type of ref
* anal/xrefs: pass the right hashtable to mylistrefs
* r_anal_refs_get should use anal->refs, not anal->xrefs
* anal/fcn: add xref also when there's a CALL to a noreturn function
* projects: use radare2 output of ax command to save/restore xrefs
* core/cmd_anal: when analyzing calls, we should use REF_TYPE_CALL
* core/canal: use xrefs API, because the list is a just a copy
* core/canal: rename "loc." entries to "fcn." when a CALL is found
* sort xrefs to make results consistent
* core/canal: avoid recomputing function every time during `aan`
* anal: move fcn_refs/xrefs functions to the xrefs.c file
* core/canal.c: avoid iterating fcn xrefs list
* anal/xrefs: compute fcn xrefs by analyzing fcn addresses
* remove other unused functions
* anal/xrefs: remove fcn_xrefs_add and fcn_xrefs_deln
* anal/xrefs: remove old fcn->refs/xrefs
* anal/xrefs: directly store RAnalRef objects in the hash table
* libr: prevent memory leaks when using refs/xrefs
* anal/xrefs: merge anal/ref and anal/xref and clean API

Big xrefs/refs refactoring that provides a more uniform and simple API.
It avoids changes to refs/xrefs except through the API and it keeps all
xrefs/refs info in one single place, to improve consistency.

Thanks to:
Riccardo Schirone <sirmy15@gmail.com>
pancake <pancake@nopcode.org>
rene <rlaemmert@gmail.com>
2018-05-04 21:40:47 +02:00
Khairul Kasmiran
2faadf6d86 r_cons_singleton() 🠊 r_cons_singleton () 2018-05-02 21:36:08 +08:00
pancake
99e45f6f54 Fix last covs 2018-05-02 14:49:57 +02:00
radare
000e725b15
Use system diff in graphdiff nodes if possible and improve graphviz style (#9988)
$ radiff2 -g sym._call -A  b c | dot -Tpng > a.png

- we need disasmdiff native in r2, as well as more inter-core commands
2018-04-30 02:47:51 +02:00
pancake
a24eb639e0 Make Travis Green 2018-04-25 12:30:57 +02:00
pancake
709a9c58fe Improve leahints to handle UJMP references 2018-04-25 12:30:57 +02:00
pancake
0a22f4a36b Fix oobwrite in x86.cs and honor anal.depth in more places 2018-04-25 12:30:57 +02:00
pancake
b99bb97def Improve r_cons_is_breaked coverage 2018-04-25 12:30:57 +02:00
pancake
19c4f5223c Fix a lot of things broken in previous merged PRs. grrrrrr 2018-04-24 11:32:51 +02:00
pancake
fdf12b818a Fix #9930 - agv honors asm.comments 2018-04-20 00:24:21 +02:00
pancake
04fe0f711b Remove debug printf 2018-04-11 11:10:08 +02:00
pancake
55e59c11a5 Fix regression in aae for x86 2018-04-11 09:24:42 +02:00
pancake
5cde546971 Fix aae on x86-64, improve Vx, add sys/rebuild.sh tcc, .. 2018-04-11 02:32:27 +02:00
pancake
1adac87918 Update sdb-1.1.0, update calls to sdb_fmt() 2018-04-10 23:52:47 +02:00
pancake
813348d6ab Fix /re for arm64 when using adr instruction 2018-04-10 13:52:40 +02:00
pancake
ecfe83e4b2 Fix /re and aae for Thumb and ARM32 2018-04-10 13:30:08 +02:00