Commit Graph

3762 Commits

Author SHA1 Message Date
pancake
03732b1312
Dont depend on case-sensitive FS to load the DLL sdbs ##bin (#19502) 2021-12-14 17:19:51 +01:00
Sergi Àlvarez i Capilla
4982055f30 Fix the last covs reported in pyc/avr/aao 2021-12-13 23:07:41 +01:00
Sergi Àlvarez i Capilla
1499a9337f Fix last covs related to the py marshall code 2021-12-09 18:00:58 +01:00
pancake
7b9ac97299 Fix #19478 - null deref in symbols file ##bin 2021-12-09 01:25:51 +01:00
Francesco Tamagni
5450345e9b
Support Mach-O DYLD_CHAINED_PTR_64_OFFSET format ##bin 2021-12-09 01:18:02 +01:00
pancake
862fe33631
Handle more ELF relocs for ARM binaries ##bin
* Handle more ELF relocs for ARM binaries ##bin

Inspired by cd6bde4aeb
2021-12-05 04:58:12 +01:00
pancake
e6f2cd0b2a
Remove trailing spaces (#19460)
$ git grep ' $' | grep -v ^test/ | cut -d : -f 1 | sort -u > /tmp/trailing
$ for a in `cat /tmp/trailing` ; do sed -i -e 's/ *$//' $a ; done
2021-12-02 17:39:59 +01:00
pancake
dafa685c24
Fix invalid pointer read issue in dwarf parser ##crash (#19459)
* Exploited by tests_65179, tests_65180 and tests_64901
* Fix out of bounds issue causing memory corruption in unit test
2021-12-02 12:20:30 +01:00
Sergi Àlvarez i Capilla
77d9fedab8 Fix #19455 - Negative tainted offset used in buffer for pyc causing oobread ##crash 2021-12-01 16:33:19 +01:00
pancake
7c20ef7f2a
Fix #19448 - Fix atoi on non-null terminated string in PE section headers ##crash 2021-11-29 10:19:52 +01:00
pancake
99d7b1f7a2 Fix #19443 - Fix the pyc tests and marshall uaf
* Fix memleaks when parsing invalid pyc type objects
* Sometimes valgrind logs are nicer than asan ones
2021-11-28 22:36:11 +01:00
pancake
4327d8322f
Bring back the mingw32 builds ##windows
* Massage conflicting function signatures spotted by mingw
* Fix the spp visibility issue
* Enable 32 and 64bit mingw builds in the CI
2021-11-28 22:10:51 +01:00
pancake
bf7ecde2cd Fix 319443 - pyc uaf marhall bug fixed properly 2021-11-28 02:13:25 +01:00
pancake
e9e5d9c7e1 oopsie 2021-11-28 01:58:54 +01:00
pancake
7ffe8ecaf2 Fix #19443 - UAF in marshall null object ##crash 2021-11-28 01:07:14 +01:00
pancake
0505cac914 Fix #19442 - Fix heap underflow in pyc marshalling ##crash 2021-11-28 00:39:01 +01:00
pancake
a0fd446a7b Fix #19444 - Null derefs in PE signature logic ##crash 2021-11-28 00:36:08 +01:00
meme
fbfebef9e6
Add Plan 9 symbol parsing ##bin
All function and data symbols are now parsed and loaded into radare2. As
well, the BSS segment is now also loaded as zeroed virtual memory.
2021-11-22 01:51:30 +01:00
meme
592e6407d6 Improve Plan 9 support ##bin
Currently support for Plan 9 binaries is limited to i386 and even then
it doesn't work properly (certain sections won't load, the base address
is wrong, etc.)

With these changes, all architectures including ones from 9front are
supported.
2021-11-21 20:15:00 +01:00
pancake
e77b0e7f67 Fix PE Metadata header name parsing (.net related) ##bin 2021-11-18 23:41:09 +01:00
Sergi Àlvarez i Capilla
060479f7e8 Fix null deref in macho rebasing function 2021-11-18 21:30:07 +01:00
Lazula
2255bf8b5d Many indentation style fixes
* Change several 8-space indents to tabs
* Apply tab indent style when breaking long lines
* Move operators from EOL to start of next line
* Fix ternary formatting
2021-11-18 10:43:52 +01:00
Rick de Jager
18a693028f
Fix missing bounds check in dwarf_langs (#19419) 2021-11-17 17:05:38 +01:00
condret
eb301fdea0 Use new rbtree api to store relocs 2021-11-15 03:12:19 +01:00
pancake
7362d74ae4
Use more join_paths along the meson 2021-11-14 22:25:05 +01:00
pancake
8b227868b8
Fix the windows CI workflows
* Use ninja -j2 in the CI, seems like there are less resources for windows
* Add windows configure+make+run CI workflow
* Use more join_paths()
2021-11-14 21:09:42 +01:00
pancake
288d127caf Just disable the sdb-cgen in meson for now 2021-11-14 18:55:49 +01:00
pancake
657524aabc More meson simplifications 2021-11-14 02:35:57 +01:00
pancake
e5f8f9fa3d Add 'make clean' for windows 2021-11-14 02:04:05 +01:00
pancake
e9c6584417 Fixes for the meson-sdb-cgen 2021-11-14 02:02:34 +01:00
pancake
4c9fac84a0
Generate bin/d the same way as other sdb paths with meson ##build
* Add -Dwasan=true for meson to compile with msvc's address sanitizer
* Clear the prefix dir before installing, so we ensure it's more realistic
2021-11-14 00:57:35 +01:00
pancake
3e032073a3
Fix null name maps, workaround msvc-asan compiler crash and acp/utf/wchar fixes for w32 2021-11-14 00:50:54 +01:00
Sergi Àlvarez i Capilla
49cdf48c37 Use r_str_ndup in another bound check in dwarf ##bin 2021-11-02 18:44:08 +01:00
Sergi Àlvarez i Capilla
0f743e088d Fix DWARF unit tests 2021-11-02 14:56:38 +01:00
Sergi Àlvarez i Capilla
7c3e4a6137 Fix null esil issues on avr without aeim 2021-11-02 12:23:38 +01:00
pancake
67b97621d1
Wrong bounds initializing dwarf dies (tests_64901) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-11-02 11:58:25 +01:00
pancake
c344c8a662
Fix oobread crash in the ELF parser (tests_64931) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-11-02 01:04:13 +01:00
pancake
4e9e95fc69
Fix oobread crash in DWARF's parse_die (tests_64926) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-11-02 00:56:12 +01:00
Sergi Àlvarez i Capilla
d8cf7cfa02 Fix r_buf lifecycle in mdmp 2021-11-01 22:21:53 +01:00
Sergi Àlvarez i Capilla
0f656c90a4 Fix oobread crash in DWARF parser (tests_64922) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-11-01 10:35:33 +01:00
Sergi Àlvarez i Capilla
03322e7614 Fix oobread crash in dwarf parser with non-null terminated strings ##crash 2021-11-01 08:43:44 +01:00
Sergi Àlvarez i Capilla
637f4bd1af Fix oobread crash in DWARF parser (tests_64924) ##crash
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-11-01 00:49:50 +01:00
Sergi Àlvarez i Capilla
0f770102a5 Fix crash when elf symbol initialization fails ##bin
Reported by giantbranch of NSFOCUS TIANJI Lab
2021-10-30 16:53:20 +02:00
Francesco Tamagni
bf3dd3ce15 Always init Mach-O options with defaults ##bin 2021-10-29 12:02:57 +02:00
Francesco Tamagni
09e20cd53d
Add Support For dyld4 Atlas-style Shared Library Caches ##bin
* Fix signed overflow in r_buf_fread_at ##util
* Tweak "malformed export trie" debug logs
2021-10-28 12:46:38 +02:00
condret
fe87ab37a0 Remove redundant RPVector maps from RIO 2021-10-26 00:16:09 +02:00
pancake
19588146de
Fix some of the last covs 2021-10-22 10:57:58 +02:00
Jose Antonio Romero
082ded9571 Add MSX rom/bin parser plugin and test ##bin 2021-10-20 11:55:50 +02:00
pancake
e8d4e5cc9f
Fix the windows build regressions 2021-10-19 22:17:47 +02:00
pancake
3548e2e8a4 Final mingw fixes 2021-10-19 12:52:00 +02:00
pancake
c6c9f4fbce
Fix some null checks around the open_many apis ##bin 2021-10-16 14:36:08 +02:00
Sergi Àlvarez i Capilla
4020dfe52a Fix reopen regression on Windows 2021-10-12 20:24:32 +02:00
Antoni Viciano
88d8b622bf Fix #19094 - RBinOptions renamed to RBinFileOptions 2021-10-10 20:52:46 +02:00
Lazula
0747bcd8e2 Fix new defects in various files
* Remove unnecessary NULL check in __demangleAs()
* Remove unnecessary NULL check in r_io_fd_seek()
* Add missing break in ARM32 COFF case and fix test
* Add missing NULL checks for r_io_bank_get() result
* Add missing NULL checks in r_bin_demangle()
* Add missing NULL check for r_io_submap_new() result
* Fix improper failure check in risv_assemble()
* Add missing break in open command
* Document fall-through case in dalvik anal
2021-10-08 01:31:17 +02:00
Sergi Àlvarez i Capilla
e9339bc4c9 Handle the ARM32 COFF case ##bin 2021-10-05 13:22:06 +02:00
Sergi Àlvarez i Capilla
6969ee42ee Sync swift demangler syntax with Apple one and force trylib=0 in r2r.c 2021-10-05 10:10:32 +02:00
pancake
f427fc77cd
Improve swift demangler and add bin.demangle.trylib config ##bin
- May fix the macos testsuite as long as latest macOS comes with libSwift
2021-10-05 09:05:49 +02:00
0mhu
a337ed42e0
Fix #19149: Prevent NULL pointer dereference in line_header_fini() (#19150)
hdr->file_names is set to NULL.
However, the corresponding count variable is not set to zero.
It might stay on a non-zero value and
cause the code in line_header_fini() to dereference the NULL pointer.

Setting hdr->file_names_count to zero solves that issue.
2021-09-30 20:07:33 +02:00
pancake
4a4946cd89
Initial implementation of the HUNK file parser ##bin 2021-09-29 12:34:44 +02:00
pancake
c2e064de08
Detect canary on statically linked RT and stripped PEs ##bin
* Add tests and support 32 and 64bit canaries
2021-09-29 12:08:50 +02:00
pancake
d092285bff Fix #19129 - RBin.getImports() list is unowned 2021-09-23 13:15:41 +02:00
pancake
1398432e97
Fix #19043 - Fix loading MZ with text < bsize aka 1byte ##bin (#19115) 2021-09-20 00:20:35 +02:00
Giovanni
2f3009bcb1 Check for int overflow before allocating segments 2021-09-12 12:26:04 +02:00
Giovanni
eecb66ad04 Fixed OOB read in mach0.c 2021-09-12 12:24:26 +02:00
pancake
eda30ad40b Fix #19061 - Handle ARM COFF files ##bin 2021-09-09 12:37:35 +02:00
guest177
1be3ed58a3
Correct MZ size when bytes_in_last_block = 0 ##bin 2021-09-02 10:06:48 +02:00
pancake
ba375f5702 Code cleanup, somewhat related to windows code 2021-08-27 03:03:34 +02:00
pancake
84e323334c Fix recent android build regression 2021-08-19 18:26:22 +02:00
pancake
fa2e1f9f5a
Fix #18783 - Support ELFs with phnum > 0xFFFF ##bin
* Useful for loading qemu coredumps
2021-08-19 12:12:43 +02:00
pancake
18011597c4
Fix more sign bugs spotted by vs (#18990) 2021-08-17 23:12:22 +02:00
pancake
0acb19b68a
Fix some warnings spotted by visual studio (#18985)
Co-authored-by: pancake <pancake@nopcode.org>
2021-08-16 20:45:17 +02:00
pancake
b235bcbb32
Allow RBinPlugins to use RBinFile at check() ##bin 2021-08-01 12:39:51 +02:00
pancake
5399c90173
Initial support for the TIC-80 Fantasy Computer cartridges ##bin 2021-07-31 02:52:26 +02:00
pancake
f1c81abd53 Improve dupped symbol filter logic 2021-07-29 21:09:08 +02:00
Paul I
a7a26b4f13 Replace SDB with HtPU in RBin.filter_name() ##bin 2021-07-29 21:09:08 +02:00
pancake
e622272d29 Honor Flag.maxLength in more RName.filter calls 2021-07-29 19:53:50 +02:00
pancake
3e90cc00ed Fix memleaks spotted by coverity 2021-07-29 19:53:50 +02:00
pancake
67d43c4865 Fix memleaks in RCons.grep 2021-07-26 12:40:25 +02:00
pancake
352630295e
Polish some asserts here and there (#18927) 2021-07-23 09:36:10 +02:00
pancake
d7ea20fb2e
Fix #18923 - Fix resource exhaustion bug in LE binary (#18926) 2021-07-23 09:29:54 +02:00
pancake
b37c354565 Fully de-assert the codebase. Instead use r_return_if_fail 2021-07-13 01:23:30 +02:00
pancake
90ecd4ea2e Implement ELF relocs for VAX ##bin 2021-06-20 17:13:28 +02:00
pancake
4a2e846943
Dont trust the unaligned rich PEs ##bin 2021-05-31 01:12:52 +02:00
pancake
d2070b7484
Remove empty databases and its references from libr/bin/d/dll (#18762) 2021-05-27 20:43:59 +02:00
pancake
c778d8cf4b Fix more asan issues in charset api and recently introduced memleaks 2021-05-25 11:27:32 +02:00
pancake
3db250f73a
Add initial toy IBM S390 Object File Format parser ##bin (#18747) 2021-05-24 21:17:13 +02:00
pancake
cb8fe1f388
Fix #18724 - Use RCharset in rabin2 -z ##bin (#18743)
* Dont show the offset as its misleading
2021-05-24 18:53:36 +02:00
pancake
d90510f951 Fix more recently introduced memleaks 2021-05-21 11:17:32 +02:00
Murphy
0fbb20a5b3
Remove sdb_fmt references in mach0.c (#18723) 2021-05-20 18:50:22 +02:00
Murphy
7f64b235be
Fix/minor fixes to wad plugin (#18709)
* Remove Debug Message
* Fix wad_header_load to parse header info
* Fix lumplumps type in wad_header_fields parsing
* Verify r_buf_fread_at return value at wad_header_load
2021-05-19 17:43:34 +02:00
pancake
df3f035079 Fix last covs 2021-05-18 20:10:34 +02:00
pancake
374037a4d2 Fix warnings 2021-05-18 19:34:23 +02:00
Murphy
fb141bdb0d
Add WAD file parsing (#18659) ##bin 2021-05-18 18:06:40 +02:00
pancake
049de62730 Fix #18679 - UAF when parsing corrupted pyc files ##bin 2021-05-11 23:54:01 +02:00
pancake
a8b13483af Fix another bound for dex 2021-05-11 23:41:47 +02:00
pancake
f47f58d8f4
Fix last covs (#18674) 2021-05-11 14:49:48 +02:00
pancake
5e16e2d1c9 Fix #18666 - uaf in python bin parser 2021-05-07 21:09:59 +02:00
pancake
a07dedb804 Fix #18667 - division by zero in the macho parser ##bin 2021-05-07 18:44:49 +02:00
pancake
162e223028
Rename sysz to s390 and add the s390.gnu plugin from binutils 2.36 ##asm 2021-05-04 04:01:22 +02:00
pancake
f73003656b Fix null deref in r_bin_addr2line2 2021-04-29 12:01:35 +02:00