Commit Graph

2895 Commits

Author SHA1 Message Date
radare
d05292e485
Fix 80 warnings coming from gcc8.2 (#12280) 2018-11-22 22:11:43 +01:00
pancake
e821230045 Fix last covs 2018-11-22 16:19:25 +01:00
dav1901
a18fe42d96 Minor cleanups/fixes (#12256) 2018-11-22 15:14:59 +01:00
Riccardo Schirone
300844fa51 Introduce RBinArchOptions to avoid creating fake RBinFile/Objects ##bin 2018-11-22 15:14:37 +01:00
pancake
ef67aefbc2 Fix minor warnings 2018-11-22 12:23:46 +01:00
dav1901
9bcfc5cc20 Fix few covs (#12251) 2018-11-21 13:34:43 +01:00
Riccardo Schirone
f66d965587 Access last ElfSymbol only after reallocating the array ##bin 2018-11-21 10:34:48 +01:00
pancake
0c9c615123 Add emscripten target for the cxx demangler 2018-11-20 22:58:27 +01:00
dav1901
9413169623 Minor cleanups/fixes (#12247) 2018-11-20 17:50:26 +01:00
Riccardo Schirone
d5c8b91c0b
fix some covs (#12238) 2018-11-20 10:15:18 +01:00
Giovanni
dd84bfe3de Fix #12194 - Resolve symbol names in WebAssembly bins ##bin 2018-11-20 01:19:23 +01:00
dav1901
8e7aea3198 Minor cleanups (#12231) 2018-11-19 22:55:34 +01:00
radare
5f270658c5
New RBin plugin for "symbols" files ##bin 2018-11-19 22:54:58 +01:00
radare
50801791e2
Fix #9825 - Wrong import addresses in the ELF for ppc64 elfs ##bin 2018-11-19 18:24:10 +01:00
Riccardo Schirone
9ea01145fe bin/elf: make strttabaddr a ut64 (#12214) 2018-11-19 11:13:45 +01:00
radare
4aacf78447
Fix some bugs in RBin.mdmp ##bin 2018-11-19 02:15:19 +01:00
Riccardo Schirone
015ed58426 ELF plugin code cleaning ##refactor
* clang-format-diff: do not put space after Elf_
* bin/elf: remove warning because it's already printed by R_LOG_WARN
* bin/elf: rename get_static to is_static
* bin/elf: a bit of refactoring in init_dynamic_section
* Revert "bin/elf: other cleaning"
This reverts commit e39af6f69e.
* bin/elf: cleaning in r_bin_elf_get_sections
* bin/elf: refactor a bit get_sections_from_phdr
* bin/elf: fix create_section_from_phdr
* bin/elf: small style fixes in get_boffset
* bin/elf: simplify the code by using READWORD instead of #if/#else
* bin/elf: fix read_phdr because you need to pay attention to the order
2018-11-17 22:45:49 +01:00
p2mate
f074d51bf9 Remove deprecated load methods from MZ parser ##bin 2018-11-17 18:19:39 +01:00
dav1901
558a79cae7 Fix few minor leaks and remove dead code (#12201) 2018-11-17 18:19:04 +01:00
Riccardo Schirone
b93656e8fa Do not try to set the current binfile if it cannot be find 2018-11-16 10:32:24 +01:00
dav1901
20ae946c2f Fix few realloc misusages (#12182) 2018-11-15 18:45:23 +01:00
Riccardo Schirone
1c199adf9b
Vaddr assert (fix #11948) (#12170)
* Use is_vaddr in bin/elf as it is more meaningful

* Do not consider valid symbols with paddr UT64_MAX

This is set when the symbol does not have a paddr, so it means there
cannot be any code there and it's useless analyzing it.
2018-11-15 10:35:47 +01:00
p2mate
39b5d28ff4 Implement load_buffer for MZ parser ##bin
Signed-off-by: p2 <p2@psychaos.be>
2018-11-14 22:29:26 +01:00
dav1901
c1f30de193 Minor code cleanups free/R_FREE (#12157) 2018-11-14 21:23:20 +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
pancake
e3de9f0d4f Fix clusterfuzz-testcase-minimized-ia_fuzz-5664620711247872.dms 2018-11-14 15:39:41 +01:00
pancake
e305313648 Fix oobread in RBin.strings 2018-11-14 15:10:51 +01:00
dav1901
b9c74118e2 Fix minor leaky issues (#12148) 2018-11-14 12:19:24 +01:00
Riccardo Schirone
34a6cda6f8 Mangling functions should accept NULL binfile 2018-11-14 11:20:11 +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
dav1901
dfb9b0e5ae Fix minor leaks in ufs and mz 2018-11-14 01:57:23 +01:00
dav1901
8b83d03c99 Minor code cleanups free/R_FREE (#12145) 2018-11-13 23:41:28 +01:00
Riccardo Schirone
90058945d2 Remove "referenced" from RBinObject and remove get_object ##refactoring 2018-11-13 13:05:18 +01:00
p2mate
d29085336a Cleanup and fix the MZ ##bin
* use virtual addresses to deal with the MZ header and reloc table not being part of the load module
* handle wrapping for CS:IP
* rework r_bin_mz_get_segments

Signed-off-by: p2 <p2@psychaos.be>
2018-11-13 00:28:35 +01:00
Stefan Ilic
7181250017 Fix 2 leaks in RBinInfo.free() 2018-11-13 00:26:45 +01:00
dav1901
9b0fbf1ee4 Minor code cleanups - free/R_FREE/etc 2018-11-13 00:23:49 +01:00
Young-X
99641414fd Fix multiple potential vulnerabilities (#12113)
* bin_xtr_fatmach0.c: fix memory leak in function extractall

Signed-off-by: Young_X <YangX92@hotmail.com>

* check return value of r_list_newf in function oneshotall

Signed-off-by: Young_X <YangX92@hotmail.com>

* ufs: prevent memory leak

Signed-off-by: Young_X <YangX92@hotmail.com>

* minix: prevent memory leak

Signed-off-by: Young_X <YangX92@hotmail.com>

* jfs: fix memory leak in grub_js_find_file

Signed-off-by: Young_X <YangX92@hotmail.com>

* r_anal_plugin_free: fix null pointer deference for para a

Signed-off-by: Young_X <YangX92@hotmail.com>

* fix null pointer deference in function fix_back_edge_dummy_nodes
since ptr from and to may be NULL

Signed-off-by: Young_X <YangX92@hotmail.com>
2018-11-12 12:08:24 +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
Stefan Ilic
a5b01f34ab Fix uninitialised section name (#12106) 2018-11-11 10:46:40 +01:00
pancake
161625dc25 Fix assertion for bitcode mach0s ##bin 2018-11-10 02:41:18 +01:00
Riccardo Schirone
3b2a1de77e Cannot extract reg args if no calling convention is present ##anal
some archs do not even have a default calling convention, so let's just
skip them for now and print a log. It means we probably need to
implement other things to make arguments analysis work on those archs.
2018-11-10 02:36:51 +01:00
Riccardo Schirone
0e688d5660 Implement load_buffer for mdmp and fix RList asserts ##bin 2018-11-09 19:10:30 +01:00
pancake
d2c7275155 Add magic signatures for llvm bitcode and xcode symbols 2018-11-08 17:29:43 +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
radare
71053f17e9
Move trie, mixed, slist into Sdb's Attic, and DES from util to crypto ##refactor 2018-11-07 17:18:14 +01:00
Riccardo Schirone
d6fd896a65 Remove other unused functions in RBin and make others static ##refactor 2018-11-07 10:52:32 +01:00
lzutao
b790439e28 Cast arguments to ut8 when feeding ctype.h functions ##refactor
The behavior of the `<ctype.h>` functions is undefined for negative
arguments (other than `EOF`). In such a situation, the argument should
be cast to `unsiged char` for safety.

References:
 - C Programming: A Modern Approach, 2nd Edition: page 612, chapter 23.5
2018-11-06 13:40:00 +01:00
radare
de309af4d6
Another minor cleanup in RBin and add R_TIME helpers 2018-11-05 16:38:41 +01:00
Stefan Ilic
4e8eed0158 RBinSection now lives in the heap ##refactor 2018-11-05 11:52:40 +01:00