Commit graph

28 commits

Author SHA1 Message Date
Giovanni
e7be5c5f1d
Cleanup endianness on rz_buf_fread/_at (#3109) 2022-10-19 11:04:21 +08:00
wingdeans
a6a7a5f530 Fix annotation inconsistencies 2022-08-03 00:29:56 -04:00
GustavoLCR
55fc4dfac1
Implement new rz_buf_fwd_scan() API (#2530) 2022-04-17 15:08:08 +02:00
wargio
90dea96fbc Refactoring rz_buf_uleb128 & rz_buf_sleb128 2022-04-12 22:14:05 +02:00
GustavoLCR
7a4d3f3d79 Fix rz_buf_new_with_bytes() annotation 2022-02-20 01:42:48 -03:00
Florian Märkl
86a7439519
Add IO/Map-based RzBuffer Implementation (#2147)
This adds an RzBuffer implementation that binds against RzIO's
rz_io_read_at/rz_io_write_at in order to access the mapped memory. This
is in contrast to the previous io RzBuffer, which has been renamed to
..._io_fd and which reads directly from a single file descriptor without
mapping.
To keep bf working, bin_bf now maps an area of zeroes because
otherwise the initial memory contents in RzIL would read as 0xff.
2021-12-29 10:28:55 +01:00
Anton Kochkov
91ef6da7ad
Various memleak fixes (#1893)
* Fix CID 361180
* Fix CID 359879
* Fix CID 358574
* Fix CID 358570
* Fix CID 358569
* Fix CID 358559
* Fix CID 354016
* Fix CID 352581
* Fix CID 352498
* Fix CID 352484
* Fix CID 352451
* Fix CID 348953
* Fix CID 348937
* Fix CID 348935
* Fix CID 344518
* Fix CID 316930

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2021-10-27 16:32:45 +08:00
Anton Kochkov
fff938a8b9
Fix ASAN buffer overflow in rz_buf_get_nstring() (#1891) 2021-10-27 13:27:39 +08:00
Florian Märkl
3e7cdf58ed Remove strnlen() calls and replace by rz_str_nlen() 2021-10-26 10:50:22 +02:00
Riccardo Schirone
75fc447873
Fix some memleaks in unit tests (#1869)
* Cleanup RzAnalysisRzil when freeing RzAnalysis

* Fix str leaking in rz_core_write_string_at

* Fix buf leaking in rz_core_yank_paste

* Fix memleak in json unit tests

* Fix features leaking in RzBinInfo

* Fix features leaking in RzAsm

* Fix memleaks in RzTable

* Fix test_str_search memleaks

* Fix memleak in test_io.c

* Fix memleaks in RzBuf and test_buf.c

* Fix memleaks in test_cmd.c

* Fix memleaks in test_config.c

* Fix memleaks in RzCons

* Fix hashes leaking in test_bin.c

* Fix memleaks in test_id_storage.c

* Fix memleaks in test_il*.c and adjust APIs
2021-10-22 09:33:20 +08:00
Alexis Ehret
09d5b01b67 Add macro to simplified rz_buf_read_* and rz_buf_write_* definition 2021-09-17 16:18:03 +02:00
Alexis Ehret
47c58d3a51 Add rz_buf_write_* API to read ut16, ut32, ut64 from a buf 2021-09-17 16:18:03 +02:00
Alexis Ehret
1c7daaf12e
Modification of rz_buf_read* API (#1440)
* Small cleanup RzBuffer constructors
* Small cleanup RzBuffer methods
* Refactor rz_buf_read* for a better error handling
* Add documentation for RzBuffer API ##doc
2021-08-16 18:23:46 +08:00
Riccardo Schirone
ff2c350361
librz/util: Fix double free in buf when whole_buf is not allocated (#1362)
Inspired by
6fb0ba39ed

Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
2021-07-27 12:52:42 +08:00
Alexis Ehret
8e61ef212e Add function rz_buf_get_nstring 2021-07-07 12:01:17 +02:00
Florian Märkl
a019616afd Add rz_buf_new_with_methods() 2021-05-30 10:53:13 +02:00
Florian Märkl
8e97bf218f Replace rz_buf_new() by rz_buf_new_with_bytes(NULL, 0) 2021-05-30 10:53:13 +02:00
Florian Märkl
63410b43df
Add Overlay Functionality to Sparse RzBuffer (#1124) 2021-05-12 12:52:46 +02:00
Florian Märkl
de8767938f Rewrite Sparse RzBuffer for Efficient Reading 2021-05-11 09:53:51 +02:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Alexis Ehret
2d12d2423b Fix dead assignment librz/util/buf.c 2021-02-09 10:37:25 -01:00
Anton Kochkov
a0be4e2e64 Run clang-format 2021-01-21 22:05:44 +08:00
Alexis Ehret
90033b8fe3 Fix dead increment librz/util/buf.c 2021-01-16 14:08:11 +00:00
Riccardo Schirone
0cf9979f42 Add fd to RzBuf and add mode to mmap RzBuf 2021-01-03 11:42:38 +01:00
Anton Kochkov
7ee14fb853 More renames 2020-11-12 12:27:04 +08:00
Florian Märkl
6572b63794
Use Standard SPDX Header Comments (#51) 2020-10-27 09:04:11 +01:00
Riccardo Schirone
502e91aff7
Rename R_ and R2_ to RZ_ (#8)
* Rename R2_ -> RZ_
* Rename R_ -> RZ_
* Rename R2R_ -> RZ_TEST_
* Rename R2R defines and types to RZ_TEST/RzTest
* Keep R_ for REIL registers
2020-10-02 16:09:13 +02:00
Riccardo Schirone
721609a17b
Rename to rizin (#2) 2020-10-01 16:13:03 +02:00
Renamed from libr/util/buf.c (Browse further)