3529 Commits

Author SHA1 Message Date
Francesco Tamagni
a70b06f1f0 Fix typo in ObjC ivar parsing ##bin
Which caused a NULL dereference in some cases
2020-05-05 18:47:23 +02:00
GustavoLCR
21faee260a
Speedup parsing PE exports (#16762) ##bin 2020-05-05 12:58:06 +02:00
GustavoLCR
aeeb266397 Fix aggressive name filtering for PDB types 2020-05-03 17:55:53 +02:00
Francesco Tamagni
3ad04c79c6 Fix Mach-O relocs on arm thumb ##bin
The word size can’t be 16-bits for data
2020-05-03 17:55:20 +02:00
Alexis Ehret
311ad81894
Change default value inside struct ELF dyn (#16741) ##bin 2020-05-03 16:19:26 +02:00
Khairul Azhar Kasmiran
4ba026258e
bin.str.enc=utf8: Assume ASCII first 🇺🇸 + add some more tests (#16735) ##bin 2020-05-02 18:15:13 +02:00
GustavoLCR
cb7d6b4390
Fix #16737 - PE: fix overly agressive section fixing (#16743) 2020-04-29 12:22:27 +08:00
GustavoLCR
c1e81f4245
Fix #16739 - PE: fix getting import entries from single directory (#16742) 2020-04-29 12:21:56 +08:00
Riccardo Schirone
d4fd59a4e3
Fix some coverities (#16740)
* relocs was leaking otherwise (CID 1427852 and CID 1353777)
* Free RCmdParsedArgs before returning (CID 1427851)
* Do not double free tmp array (CID 1427850)
2020-04-28 18:21:58 +02:00
pancake
7df1b200a6
Reduce memory usage in DEX files by caching the getstr calls ##bin (#16706)
type    top    vsz     rss      time
------------------------------------
calloc  339M   4732640 365452   48s
pvector 338M   4731012 371484   48s // XXX fails somehow with trash indexes
htup    338M   4731556 371620   58s
nocache 350M   4742936 376156   52s
2020-04-28 16:13:20 +02:00
pancake
c88d13e4af
3.5x faster DEX loading parsing debug_info section ##bin (#16733)
* Use proper RBuf api instead of doing bulk reads in DEX ##bin
* Loading an 8MB DEX file: Before:  48s,  After: 17s
2020-04-28 13:50:24 +02:00
GustavoLCR
4c4da83cbe Fix #16702 - Fix PE exports ordinals 2020-04-27 23:13:19 +02:00
Khairul Azhar Kasmiran
670e087795
Fix #16543 - bin.str.enc affects izz + ascii is now alias for latin1 (#16720) 2020-04-26 22:17:41 +08:00
pancake
d511ddcfd3
Hide filehashsize warning under bin.verbose (#16709) ##bin 2020-04-24 17:21:20 +02:00
Alexis Ehret
78de31fe69
Unify the relocations loading (#16705)
* Mov init rel_cache inside the bin init
* Introduce array cache
* Use bin->relocs after loading all relocs
* Handle bin->relocs == NULL
* Remove last free
* Use cache to get relocations
2020-04-24 20:26:30 +08:00
Alexis Ehret
6124df443f
Use DYNAMIC info in get_import_addr instead of just section names ##ELF
PR: #16530
2020-04-22 16:12:09 +02:00
Liumeo
2860c4b327
Remove uleb128 code duplication (#16662)
* Replace dex_read_uleb128
* Remove dex_read_sleb128 and move dex_uleb128_len to util
2020-04-21 11:42:45 +08:00
Liumeo
3c2cd8cbd8
Suppress 2 LGTM alerts (#16631) 2020-04-19 19:05:35 +02:00
Francesco Tamagni
40a81ea51a
Fix dyldcache malformed local symbol ##bin (#16610)
It was a false positive due to wrong boundary check.
2020-04-16 16:18:41 +02:00
Francesco Tamagni
e7007a2fa7
Improve dyldcache v4 for iOS13.4+ with JSON metadata ##bin (#16603)
- carve dependencies looking at load commands when accelerator info isn’t there (important for iOS 13.4+ caches)
- follow upwards deps as well
- expose metadata about all images (addresses and sizes)
- emit header metadata in JSON format
- make sure libobjc is always loaded, to prevent glitches on the slide estimation logic
- blindly support rebase info v4, as it should work like v2
2020-04-16 13:51:19 +02:00
Liumeo
b9786ac7e3
Add header guards in the include files (#16595) 2020-04-15 12:20:02 +08:00
pancake
315050e7ab Fix last coverities 2020-04-13 23:57:16 +02:00
Disconnect3d
7cff993074 Fix off by one when checkinf for .rdata section
The string literal `".rdata"` has a length of 6 so the `strncmp` used should have size argument of 6 instead of 5.
2020-04-13 20:23:55 +02:00
pancake
948fc65491
Fix the last bins/fuzz crash in ELF parser (#16573) 2020-04-13 19:56:41 +02:00
Anton Kochkov
69ad1aeffe
Fix R_PACKED() macro usage (#16571) 2020-04-13 19:55:00 +02:00
Liumeo
21e2ad828a
Proper multiplication overflow test (#16561)
* Fix spacings
* st->ut; remove the last check
2020-04-13 19:52:09 +02:00
pancake
8671892991
Fix infinite loop in macho commands parser (#16562) ##bin 2020-04-13 07:17:49 +02:00
pancake
8b0a051026
Fix heap overflow in the relocs ELF parser ##bin (#16557)
* r2 bins/fuzzed/elf1
* Ref #16464
2020-04-13 06:44:56 +02:00
pancake
e9f5ab05d0
Fix crash (null dereference) in PKCS7 (#16558) 2020-04-13 06:44:28 +02:00
Alexis Ehret
ef07476e38
Fix various lgtm warning (#16497)
* Wrong type of arguments to formatting function root/shlr/mpc/mpc.c
* Overflow in uncontrolled allocation size ./libr/socket/run.c
* Multiplication result converted to larger type ./libr/core/cmd_print.c
* Multiplication result converted to larger type ./libr/bin/p/bin_dyldcache.c
* Multiplication result converted to larger type ./libr/core/linux_heap_glibc.c
* Multiplication result converted to larger type ./libr/core/visual.c
* Comparison of narrow type with wide type in loop condition ./libr/core/p/core_java.c
* Fix various warning -Wall ./libr/core/p/core_java.c
* Multiplication result converted to larger type ./libr/bin/format/mach0/mach0.c
* Multiplication result converted to larger type ./libr/util/print.c
* Multiplication result converted to larger type ./libr/asm/asm.c
* Fix small warning python
* Fix type error and declaration inside loop
* Reset mpc
* replace size_t
* Fix space missing, type and format
2020-04-12 20:45:24 +02:00
Paul I
790100b7bc
Improve COFF symbol info (#16523) ##bin 2020-04-12 18:07:55 +02:00
pancake
54617455de
Initial refactoring of the rap:// protocol (-75 LOC) ##socket (#16534)
* It's implemented in IO, Socket and Core
* Remove duplicated apis and defines, everything in in RSocket now
* RIO now owns an RCoreBind instead of 3 fcn pointers + 1 void*
* Use proper filenames in libr/socket following public api names
* Use RSocket.block apis in the rap client + server apis
2020-04-12 16:40:55 +02:00
pancake
be268d30a2
Fix crash issue induced by an integer overflow in the mach0 parser ##bin (#16544) 2020-04-12 16:37:24 +02:00
pancake
58f0d8343a
Fix segfaults in fuzzed bins (#16538) 2020-04-12 12:16:51 +02:00
pancake
63e8984ab8
Fix double free and uaf in pe parser (#16540) 2020-04-12 10:52:43 +02:00
Liumeo
e7ae72cf9c
keep ut16 (#16499) 2020-04-09 19:02:11 +02:00
pancake
c567465db2
Fix #16495 - Broken build (#16502) 2020-04-09 18:34:03 +02:00
Liumeo
3caf98ecb2
Keep two vars in dex as ut16 (#16487) 2020-04-09 11:06:24 +02:00
pancake
e4818cd5e5
Fix #16418 - Implement blind main detection on endbr+mov files ##bin 2020-04-09 11:49:39 +08:00
Liumeo
2154e13c50
DEX - Keep original type (#16486) 2020-04-09 11:47:46 +08:00
Paul I
7fd737b5ac
Fix COFF symbols/imports info (#16446) ##bin 2020-04-08 20:22:26 +02:00
Alexis Ehret
1c29509145
When computing ELF relocations, use DYNAMIC segment if available (#16419) ##bin 2020-04-08 20:20:23 +02:00
Francesco Tamagni
f9864efc09
Make dyldcache accelerator info optional ##bin (#16469)
* Make dyldcache accelerator info optional ##bin

This allows to open dyld cache files from iOS 13.4 for which
apparently the accelerator info are missing.

What’s lost when this info is missing is the ability to efficiently
detect which single library depends on which other libs when
performing the filtering.

That means that for iOS 13.4 library caches, the user has to
manually specify all the dependencies in the filter.
2020-04-08 12:21:00 +02:00
Florian Märkl
9a2effd5ed
Use RPVector for io->maps - speedup map traversal ##io
- The 64K section bin now loads in 15s instead of 26s
2020-04-07 12:43:41 +02:00
Liumeo
51573ddb58
pointless comparison of ut16 to 0 (#16451) 2020-04-07 11:35:27 +02:00
pancake
e484762fe0
Fix #16266 - Fix two warnings (#16426) 2020-04-07 00:39:51 +08:00
pancake
961d5007a9
Do not use r_buf_data in DEX results in 1.5x faster parsing (22s vs 33s) ##bin
* Fix some memory leaks
* Mark r_buf_data as deprecated
* Remove some spaguetti (-42LOC)
* Fix buf license header authorship
* Make parser functions return void for simplicity
2020-04-05 19:24:36 +02:00
radare
ec49299cb5
Fix memory leak reported by coverity in mach0 (#16405) 2020-04-02 16:40:09 +02:00
pancake
2b0962af31 Add mach0 class fields with padding and sorted by offset ##bin 2020-03-30 15:31:36 +02:00
pancake
77bd3eb05e Add NSString and size_t types in tcc+r2 ##types 2020-03-30 15:31:36 +02:00