Commit Graph

566 Commits

Author SHA1 Message Date
Riccardo Schirone
90058945d2 Remove "referenced" from RBinObject and remove get_object ##refactoring 2018-11-13 13:05:18 +01:00
Stefan Ilic
7181250017 Fix 2 leaks in RBinInfo.free() 2018-11-13 00:26:45 +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
Riccardo Schirone
d6fd896a65 Remove other unused functions in RBin and make others static ##refactor 2018-11-07 10:52:32 +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
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
radare
744d47b5d8
Fix crash in fuzzed sega master system rom ##bin (#11921)
* clusterfuzz-testcase-minimized-ia_fuzz-5712659681378304.dms
2018-10-24 16:20:46 +02:00
davidpolverari
6742bbd2c1 Fix #11915 - Early null check in RBinObject.get_baddr() 2018-10-24 13:07:03 +02:00
davidpolverari
b47666b409 Fix #11881 r_list_length assert for o->libs ##refactor 2018-10-23 21:38:17 +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
pancake
4205cdabee Fix memory leaks in RReg 2018-10-16 00:17:44 +02:00
bannsec
4b69a0c0c7 Fix memleak in RBin (#11775) 2018-10-11 01:06:07 +02:00
Francesco Tamagni
4db87cb034 Create o->classes list before using it (#11729)
to silence the runtime warning on r_list_length
2018-10-04 15:21:04 +02:00
pancake
56ac119c07 Fix memleak in r_bin_section_free 2018-10-02 00:46:25 +02: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
Neven Sajko
4a722e80d8 Add braces to if, else, for, while ... (#11504) 2018-09-13 10:17:26 +02:00
Neven Sajko
d8784641ee Add parentheses in macros where needed for safety (#11290) 2018-08-30 13:16:50 +02:00
pancake
6d05365f30 Make RAsmOp use RStrBuf instead of fixed-size buffers
* Seems to work, but there are many things to improve and fix
* Fixed some bugs (overflow, sandbox bypass, ..)
* Exposes some memleaks and bad api usages.
* Refactor all the things! \o/
* Fix z80, tms320 disasm and x86.as
* Care about memleaks
* Support meson
* And fix more tests related to pda and pdj and m68k
2018-08-22 11:43:05 +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
pancake
adf3f3aab4 Fix psx strings 2018-08-09 11:41:21 +02:00
pancake
7444d55483 Disable pemixed inside the plugin 2018-08-06 10:34:21 +02:00
pancake
f2bf39beb5 pemixed is no longer our friend 2018-08-06 09:27:27 +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
Florian Märkl
a5b3ff9486 Make izz more task-safe (#10373) 2018-06-17 15:12:54 +02:00
pancake
7fb3381f80 Fix last covs 2018-06-11 11:48:22 +02:00
pancake
4ec3ef1041 Fix #10242 - empty files throw no warning now 2018-06-10 04:59:57 +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
pancake
e216f08826 Lowercase some help messages 2018-05-07 12:26:01 +02:00
xarkes
7b70fbc717 Remove useless memcheck (#10021) 2018-05-06 13:17:35 +02:00
Anton Kochkov
2af8364a4b Back to static 2018-04-16 13:41:52 +08:00
Anton Kochkov
526927963d Fix Linux build [2] 2018-04-16 13:06:11 +08:00
Anton Kochkov
f1b0e1759f Fix Linux build 2018-04-16 13:00:00 +08:00
pancake
5c380693ab Make r_bin_load_io_at_offset_as static, in order to reduce public RBin api 2018-04-16 00:44:02 +02: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
9c4dc3b3c7 Fix leaks in RSyscall.srdb 2018-03-14 12:41:39 +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
Khairul Azhar Kasmiran
3c7ee36386 izz/izzj works with -n without using rabin2 (#9561) 2018-03-04 22:04:56 +01:00
pancake
0eff809098 Implement obf (fix #6367) and fix uaf in ob-*;i 2018-01-28 00:45:29 +01:00
pancake
e5e1f39cba Fix UAF in RBin.load() 2018-01-22 18:25:46 +01:00
Khairul Azhar Kasmiran
89c309a900 bin.strpurge: added fine-grained purging of strings to iz (#9210) 2018-01-17 20:34:53 +01:00
pancake
69f9584095 Fix last covs 2018-01-16 12:39:09 +01:00
Khairul Azhar Kasmiran
b117fbd12e bin.strpurge: allow more fine-grained purging of strings (disasm only) (#9194) 2018-01-14 18:09:22 +01:00
sivaramaaa
74a5b55925 Honor *q in izzz 2018-01-12 10:02:22 +01:00