386 Commits

Author SHA1 Message Date
David CARLIER
bbfc4a8747 Fix the file hash computation ##bin 2019-02-10 01:27:07 +01:00
David CARLIER
5d698c76ae Display file hashes into rabin via new mode ##bin 2019-02-01 17:11:31 -06:00
Maijin
f9d4ab6f65
Add Certificates in rabin2 ##enhancement (#12900) 2019-01-24 17:22:53 +01:00
David CARLIER
3cff12a7c0 Add iF to show file hash and related refactoring ##bin 2019-01-24 17:34:00 +08:00
Riccardo Schirone
3ef9a7cc95 Speed up RBinReloc retrieval ##optimization 2019-01-21 11:40:24 +01:00
radare
ab3a7be704
Almost completely kill RIOSection from io and core (-218LOC) ##refactoring
* Use RBinSection, RDebugMap or RIOMap instead
* Remove omps command
* Fix segfault in ?E+
* Improve anal.eobjmp (bug spotted after almost killing iosections)
2019-01-13 03:07:51 +01:00
radare
7060103292
Improve RBuffer api, start to refactor rbin to use more rbuf ##bin (#12495)
- Added a new rule in the DEVELOPERS.md file
2018-12-17 11:54:46 +01:00
Riccardo Schirone
300844fa51 Introduce RBinArchOptions to avoid creating fake RBinFile/Objects ##bin 2018-11-22 15:14:37 +01:00
radare
5f270658c5
New RBin plugin for "symbols" files ##bin 2018-11-19 22:54:58 +01:00
Riccardo Schirone
37f547a6c5 Use R_BIN_TYPE_METH_STR instead of hardcoding the "METH" string 2018-11-14 17:30:38 +01:00
Riccardo Schirone
f77ecfb357 Upgrade SDB and use the new HtPP, HtUP, HtUU ##refactoring
* sdb-sync: update to commit ea05ca8808605daa683a2b35f143e24c3a70f0c9
2018-11-14 10:47:28 +01:00
Riccardo Schirone
90058945d2 Remove "referenced" from RBinObject and remove get_object ##refactoring 2018-11-13 13:05:18 +01:00
Riccardo Schirone
a6a04332f8 Correctly allocate strings when filtering them ##bin
* bin/filter: correctly allocate strings when filtering them

Directly reallocate strings when filtering them, because it is very hard for
the caller to know before hand the correct size of the string otherwise. The
patch uses r_str_ APIs to makes this easy.
2018-11-12 00:04:41 +01:00
radare
d8269a9e2b
Use ht to query strings for the cfstrings ##bin
* Fix va/pa issue in cfstrings
* Add many more asserts and fixed some bugs with wrong use of apis
* 6x faster loading times for fruity apps
2018-11-07 23:57:24 +01:00
Riccardo Schirone
08e5b4aaad Refactoring RBin.open/close and RBinOptions ##bin
* r_bin_close should be r_bin_file_close
* moved bin/open.c into bin.c
* set BinFile id in r_bin_load_io
* use r_bin_open_io instead of r_bin_load_io
* also prefer RBinOptions instead of multiple arguments
* rename r_bin_load to r_bin_open and use RBinOptions
2018-11-07 17:22:41 +01:00
Stefan Ilic
4e8eed0158 RBinSection now lives in the heap ##refactor 2018-11-05 11:52:40 +01:00
Riccardo Schirone
936512916b Another RBin API cleanup ##bin
* remove R_API from functions not used outside of RBin module
* move not-exported functions to a separate private header
* move bin_private in i/private.h
* fix and use R_IPI
* fix mips_assemble
2018-11-05 11:25:31 +01:00
radare
2f4e97d660
More code cleanup for RBin 2018-10-30 09:07:58 +01:00
radare
d174f66f95
Refactoring and optimization for the RBin.language identification ##bin (#11944)
* More code cleanup and bring back bin.reload for the debugger
* Benchmark: swift: 23/9549 rcore: 17232/37147 (2-400x faster)
* For DVIA iOS app this is 1s less
* Demangle all the symbols, not just few
2018-10-27 05:01:09 +02:00
Riccardo Schirone
6115f00455
remove r_bin_load_io2 and rename MODE defines ##refactor
PR #11888 

* bin: no need for 2 r_bin_load_io APIs
* bin: remove io-related unused functions
* r_bin.h: remove some old comments
* r_bin.h: group together related APIs
* extract print/set modes in r_types, to remove dups in r_bin and r_core
* clang-format-diff: fix ternary operator indent for pancake
2018-10-24 16:54:57 +02:00
pancake
4d4ce2f49c Code cleanup in the mach0 parser ##refactor 2018-10-24 13:05:29 +02:00
Riccardo Schirone
64d16fc506 Some code cleanup and asserts in RBin ##refactor
* libr/bin: no need to allocate RBinOptions on the heap
* bin: start using r_return_* around, that's just the beginning
* bin: remove io_owned since it's not used anywhere
* io: make r_io_bind return nothing
* bin: remove unused functions and simplify r_bin_load_io
r_bin_load_io was calling r_bin_load_io2 with UT64_MAX as sz parameter,
but r_bin_load_io2 just returns false if (st64)sz is less than 0, so
that call is actually useless and can be removed.
* bin/bin: fix some preconditions
* bin/open: fix precondition to check for bin and filename too
2018-10-21 01:27:15 +02:00
davidpolverari
f57a12d6cd Fix #11553 - Remove the R_NOTNULL bad practice ##refactor 2018-10-18 13:10:34 +02:00
pancake
56ac119c07 Fix memleak in r_bin_section_free 2018-10-02 00:46:25 +02:00
David CARLIER
046d840520 Refactor cpp symbols detection. (#11699) 2018-10-01 09:32:38 -04:00
pancake
41ec949204 Fix #11112 - Rename {srwx,flags,perms} to perm. (-21 LOC)
Unify R_IO, R_BIN, R_BP, .. into R_PERM_* using 1 letter syntax
2018-09-22 11:31:45 +02:00
David CARLIER
c64fb327e7 Detect binaries compilers with sanitizers (#11479) 2018-09-13 12:11:09 +02:00
pancake
960b0fc211 Initial cleanup of the rbin api 2018-08-12 03:02:05 +02:00
David CARLIER
b87ae5401e fix dump_strings signature (#11008) 2018-08-09 21:17:43 +02:00
David CARLIER
cc30a38cc0 Detects OpenBSD cookie protection for functions which is added with .openbsd.randomdata elf section. (#10967) 2018-08-07 12:07:43 +02:00
pancake
f2bf39beb5 pemixed is no longer our friend 2018-08-06 09:27:27 +02:00
JohnPeng47
ab92677eda Add pemixed plugin 2018-08-06 01:22:11 +02:00
Khairul Azhar Kasmiran
672b2a3850
Add hvaddr to iee(j) output; haddr -> hpaddr (#10899)
* iee(j): add hvaddr

* haddr -> hpaddr

* Minor realignment
2018-08-04 08:17:37 +08:00
Khairul Azhar Kasmiran
5ef73c0876 Declare elf preinit/init/fini array entries as data (#10858)
* Declare elf preinit/init/fini array entries as data
* Using rva
* Use entry->bits instead of info->bits
2018-07-31 15:24:07 +02:00
Riccardo Schirone
02f9ddefd1
plugins on meson build (#10716)
* asm: use path macros whenever possible
* meson.build: sync asm and bin plugins with Makefile
* shlr/meson.build: apply capstone patches
2018-07-13 18:19:56 +02:00
pancake
0aa64c0296 Fix fatmach0 integer underflow issue 2018-07-09 15:28:54 +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
Rene Laemmert
d11473201a Started changing bin_load to bin_open (#10221) 2018-06-20 16:19:22 +02:00
Florian Märkl
a5b3ff9486 Make izz more task-safe (#10373) 2018-06-17 15:12:54 +02:00
Khairul Kasmiran
e2e9c993a3 Moved segments from iS/'rabin2 -S' to iSS/'rabin2 -SS' 2018-06-10 03:30:25 +02:00
Khairul Kasmiran
80d5d26704 iS ELF: differentiate between sections and segments 2018-06-10 03:30:25 +02:00
radare
6da28493f5
Initial work on using idpool+idstorage from RBin + initial new RBin.open() api (#10160) 2018-05-22 17:48:34 +02:00
Anton Kochkov
c5ab1cf3e6 Restore the semantics of previous commits 2018-04-16 13:34:18 +08:00
Khairul Kasmiran
500c219b71 iee: include preinit funcs 2018-04-09 10:40:42 +02:00
radare
dfcf6f745d
Initial transition to use RBuffer in RBin (#9787)
* Initial transition to use RBuffer.io in RBin

- Fixes loading Core files from Virtualbox (> 2GB ELF64)
2018-04-03 20:23:26 +02:00
pancake
5d59c32db0 Make aac run with O(1) instead of O(n+n*m) on files with class info 2018-03-23 13:51:47 +01:00
Riccardo Schirone
170f80d1d7 Remove R_BIN_SCN_MAP flag (#9744) 2018-03-22 22:10:07 +01:00
Oscar Salvador
362184b722 Loading Core (x86, x86_64, aarch64) (#9669) 2018-03-15 11:46:07 +01:00
pancake
03ff82839d More code cleanup in RBin api for file and obj 2018-03-05 00:05:17 +01:00
pancake
0e692944a4 Refactor RBin for file and obj, mach0 headers to stdout
- Show CODESIGN load command offset+size
2018-03-04 23:52:45 +01:00