Commit Graph

34 Commits

Author SHA1 Message Date
pancake
ad2df6a14c Fix undefined behaviour in RVector, RPVector, RInterval and container_of ##fix
* All those basic primites were based on wrong assumptions
* Added more return_if preconditions on several anal functions
2022-03-21 12:04:14 +01:00
Dennis Goodlett
cef64fbbb0
Add binary search alg to pvector ##util (#19414) 2021-11-16 23:56:21 +01:00
pancake
a3896df17a
Cleanup codemeta and follow standards in free methods (#18596) 2021-04-19 13:48:58 +02:00
pancake
7337abaddf
Add r_vector_flush() ##api (#18465)
Co-authored-by: Florian M"arkl <info@florianmaerkl.de>
2021-03-15 01:57:10 +01:00
GustavoLCR
203878e60e
Optimize io.cache ##io (#17952)
* Add RSkyline ##util
* Add `r_vector_len()`
* Optimize io.cache ##io
* Use RSkyline instead of RList
* Add cache skyline for faster reads
* Use PJ API in `wcj`
* Add test and fix
2020-11-23 12:36:32 +08:00
Zi Fan
2dfa75cc47
Update record & replay features to trace reg/mem changes ##debug (#17127)
* Update record & replay features to trace reg/mem changes ##debug
* Support tracing in r_debug_continue_kill ##debug
* Fix error writing registers when stepping back and refactor ##debug
* Implement checkpoints for reverse debugging and make tests green ##debug
* Add `dbg.trace_continue` option to enable/disable tracing every instruction when continue
* Fix continue when tracing to allow skipping and continuing ##debug
2020-07-27 12:54:33 +08:00
Giovanni
d7ddba55b4
Various fixes based on fuzz bins for rabin2 (#17199)
* div by 0

* null deref in r_bin_dex_free

* null deref in get_object

* memset to 0 new capacity if we increase, to avoid garbage in the vector.

* null deref in extract_sections_symbols

* printfs. and moved insert after null deref check.

* moved check before adding the cobj into list.

* moved i definition inside if.

* using r2 macros.

* changed condition to sym_size == 0

* changed condition to if (ret) do smth

* refactoring

* code formatting

* added r_pvector_new_with_len to fix issue with bad usage of RPVector

* using r_pvector_new instead DUP

* Removed check which doesn't make sense and formatting

Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-06 20:19:25 +08:00
Florian Märkl
6f424070dd
Fix #16730 - Add bounds check to r_vector_insert ##util (#17142) 2020-06-27 21:49:52 +02:00
Riccardo Schirone
58e5aa0887
Enable unit tests compilation by default in meson (#16990)
Including Fixes for Windows
2020-06-04 12:14:15 +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
dcbb114a9d
Add missing r_vector_fini implementation ##util (#16650) 2020-04-21 17:02:45 +02:00
Florian Märkl
efc067bc8b
Remove r_pvector_upper_bound() and add r_vector_lower_bound() (#16629) 2020-04-18 17:35:42 +02:00
Lowly Worm
2878c18010
fix #16550 - undefined behavior in r_pvector_foreach_prev (#16559)
if the for loop starts at count 0, we have UB from pointer overflow
2020-04-13 06:45:51 +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
Florian Märkl
0eb98d24be
Fix all Warnings for GCC 9 (#16223) 2020-03-17 13:31:28 +01:00
Florian Märkl
a5e11a3f55
Refactor Anal Hints (#15876) ##anal
* Use RVector for Address Hints
* Add Arch/Bits Hint Trees
* Add Unit Tests for Addr, Arch and Bits Hints
* Add unset for newbits
* Fix jmptbl hint fetching
* Fix r_anal_*_bits_foreach
* Print grouped Anal Hints
* Fix arch bit affect on disasm
* Add Reset Hints to Commands
2020-02-13 11:48:24 +01:00
Florian Märkl
599bee4d1e
Fix r_vector.h for C++ build (#13890) 2019-04-25 11:31:54 +02:00
Florian Märkl
838f637ad2 Use RPVector in RLineAutocompletion ##cons
* Use RPVector in RLineAutocompletion
* Fix argc+argv init and clear in RLineCompletion
* Minor changes for RLineCompletion
* Check for completion
* Make r_line_completion_set_weak use argc+argv
* Use only RPVector in RLineCompletion
* Reserve in r_line_completion_set
* Add r_pvector_data() and r_pvector_index_ptr()
* Remove r_pvector_set_free()
2019-04-25 01:58:17 +02:00
Florian Märkl
98308a2617 Add user * to REvent Hooking and add all_callbacks for R_EVENT_ALL ##core 2019-02-04 16:37:06 -06:00
radare
95cd299e8b
Initial import of the REvent API ##refactor 2018-10-26 23:23:51 +02:00
Florian Märkl
c08f651991 RVector Update (#11273)
* Add r_vector_foreach()
* Check elem for NULL in r_vector_assign_at()
* Properly support NULL insertions in RVector
2018-08-31 10:04:08 +02:00
Florian Märkl
62acc1c4e8
Move RVector free into struct (#10882)
* Move RVector free into struct

* Change formatting for inline functions in r_vector.h

* Document differences between vector and pvector
2018-08-03 12:04:19 +02:00
Florian Märkl
12d748f41b Fix r_pvector_insert_range() for C++ 2018-08-01 12:39:29 +02:00
Florian Märkl
72fd977384 Add missing R_APIs to vector functions 2018-07-30 20:58:06 +02:00
Florian Märkl
4028065542 Document r_vector 2018-07-30 18:49:37 +02:00
Florian Märkl
3c1bd9937a Remove r_pvector_clone() bc it's dangerous and currently unused 2018-07-30 18:49:37 +02:00
Florian Märkl
7577c674ef Add RPVector struct 2018-07-30 18:49:37 +02:00
Florian Märkl
95cb69cf28 Move vector ptr/assign functions to header, Fix r_vector_insert 2018-07-30 18:49:37 +02:00
Florian Märkl
ac9fff3c03 Move vector tests to r2r, Fix r_pvector_upper_bound name 2018-07-30 18:49:37 +02:00
Florian Märkl
d5c1fcfd74 Implement flat RVector and pvector 2018-07-30 18:49:37 +02:00
Florian Märkl
38ab82cc7d Add RVectorFree typedef 2018-07-26 07:18:28 +02:00
Fangrui Song
0dfa39590f Faster onIterMap (#8544) 2017-09-18 04:29:29 +02:00
Fangrui Song
ee40472c9f Add io->map_skyline as an RVector of uncovered map parts to enable optimization of r_io_v{read,write}_at in the future (#8332)
* Add binary heap (as priority queue) to util/binheap.c
* Change cmp_less in r_vector.h to 3-way cmp
2017-08-27 18:05:58 +02:00
Fangrui Song
c7467ed31e Add RVector (array of void* objects) to r_util (#8205)
* Add RVector to r_util
* Add r_vector_{lower,upper}_bound
* Add r_vector_sort
* Add r_vector_find r_vector_insert_range and rename some functions to be idiomatic
2017-08-26 13:05:14 +02:00