Commit graph

789 commits

Author SHA1 Message Date
Rot127
f84510dc08
Add rz_set_u_take(). (#6137) 2026-04-04 12:04:25 +00:00
Rot127
a1012b5305
Improve performance of rz_bv_set_from_Xt64() at least for the value 0. (#6147) 2026-04-04 12:01:44 +00:00
Khairul Azhar Kasmiran
815c86a8f7
Inline rz_list_iter_set_data() and shorten it to rz_list_set_val() (#6131) 2026-04-02 06:04:54 +08:00
NOT XVilka
e26ed3a0ff
librz/util: remove unused rz_range functions (#6083)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2026-03-24 16:44:22 +08:00
Giovanni
70fdd67278
Allow rizin tools to run as standalone binaries (#6011)
* Implement TOOL/ENVS/EXIT_STATUS for rz-test

* update readme
2026-03-11 16:24:23 +00:00
Khairul Azhar Kasmiran
690daa2f54
ht_inc: Rename slots to slots_ (#6021) 2026-03-10 22:33:12 +08:00
Anton Angelov
95f94ae258
refactor: SwissTable implementation for ht (#5860)
* Add ht benchmarks
* Initial implementation
* Finalize native per-group lookup support
* Lookup SSE2 implementation
* Improve hashing
* Add support for custom elem_size
* Avoid double h2 hashing when reserving slot
* Make custom elem_size support conditional
* Fix issues with bitwise and default lookup implementations
* Implement deletion trick optimization
* Track growth_size instead of deleted_slots
* Refactor SDB to access ht via API instead of internals
* Modify SDB tests which rely on hashtable order
* Fix SDB build warnings
* Fix bug with finding next power of two
* foreach_kv to return a bool result
* Change SDB diff order expected by serialize_analysis unit test
* Fix bug in the bitwise lookup implementation
* Remove second call to rz_core_init() which causes memory leaks
* Update some regression tests to accept reordered output
* Adapt ht clear to new implementation
* Use fini_kv_pair and fix 1 potential leak on malloc failure
* Fix cmd/types test after merge
* Avoid second call to calsize_key and avoid iter leaks on malloc failure
* Improve hash distribution
* Extend benchmark suite
* Fix bug with string hashing
* Branchless write to mirrored ctrl bytes
* Simplify string hash and remove potential UB
* Move RZ_PREFETCH macro to rz_types.h
* Add SSE2 discovery in Meson
* Forward SDB string hash function to ht string hash
* Try to revert test_cpu_profiles() to avoid relying on a baked SDB file
* Revert SDB/CDB hash function change
* Fix SDB reference to HT hash function instead of CDB hash
* Change calloc to malloc
* Avoid storing/checking key_len and key_value if they are ut64
* Improve string hash function
* Rename default hash functions
* Improve bench code
* linter.yml: set clang-path to point to llvm-18
2026-03-02 12:31:35 +08:00
Ehab-24
492addb3a1
Enc: add unicode case mappings (#5956) 2026-03-01 15:06:28 +00:00
Thomas Strömberg
a65be1e6cd
Fix Illumos/Solaris platform support (#5972) 2026-02-27 13:01:40 +08:00
Rot127
d7111d056c
librz/util: add rz_vector_contains() and rz_vector_insert_sorted() (#5892)
* Add rz_vector_contains().
* Add rz_vector_insert_sorted().
* Pointer arithmetic fix for Windows.
2026-02-11 02:45:12 +08:00
Rot127
6a8d2ecf57
Check for empty vector to prevent OOB reads and writes. (#5591)
* Check for empty vector to prevent OOB reads and writes.

* Add tests to check for OOB reads/writes.
2026-02-10 16:57:12 +00:00
Khairul Azhar Kasmiran
2d49628aee
Remove rz_list_iter_get_data() (#5900)
* Remove rz_list_iter_get_data()
* Use rz_list_val() instead of rz_list_iter_get_data()
2026-02-10 22:03:37 +08:00
Giovanni
dfdd062f14
Rewrite of zImage bin parser & new structured data methods (#5893) 2026-02-09 19:00:42 +08:00
Rot127
dcb4acf661
Rename clean -> clear to match common API names. (#5891) 2026-02-08 15:03:52 +00:00
Rot127
0d5e300874
librz/util: add clean() function to hash tables and sets. (#5889) 2026-02-08 14:42:48 +08:00
Rot127
aaf9588c44
Constify rz_set_u/s_contains() (#5888) 2026-02-08 14:40:14 +08:00
Anton Angelov
067e319bac
Use ht_xx_size() instead of reading ht internal state (#5885) 2026-02-07 16:17:18 +00:00
Khairul Azhar Kasmiran
0e6b255519
Remove deprecated rz_list_get_next() (#5879) 2026-02-06 21:57:33 +08:00
Anton Angelov
0ff186d8e2
Improve performance of mem.c::read_n_bits() (#5819)
* Add micro benchmark
* Add implementation for rz_bv_set_from_buffer_*()
* Implementation for BE host
* Fix incorrect size parameter when calling rz_bv_set_from_buffer
* Warning when reading beyond ST64_MAX
2026-01-26 12:19:21 +08:00
Rot127
65ef6e3ed9
Fix return type description. (#5838) 2026-01-25 13:11:11 +00:00
Rot127
4675f5cafe
Add getter for the current log level. (#5807)
The getter is useful if a module outputs debug logs buts also some updated status update in a single line with rz_cons_printf("\r...").
The status update should not happen if the log level is below warning.
2026-01-23 18:52:45 +00:00
Khairul Azhar Kasmiran
d9f41e8074
Shorten rz_list_iter_has_prev/next() to rz_list_has_prev/next() (#5822)
* Shorten rz_list_iter_has_prev() to rz_list_has_prev()

* Shorten rz_list_iter_has_next() to rz_list_has_next()
2026-01-21 13:53:43 +00:00
Florian Märkl
c594b413ff
Swap argument order of rz_bv_copy* (#5793)
This brings these copy functions in line with the more common order of
dst, src as used in memcpy and rz_bv_*_inplace functions.
This is a breaking change and callers of rz_bv_copy() and
rz_bv_copy_nbits() must adjust to the new order.
2026-01-14 23:18:34 +08:00
Anton Angelov
602781b2dc
Implement rz_sys_backtrace() for Windows/MSVC (#5784)
* Implement rz_sys_backtrace for Windows/MSVC
* Add dbghelp.lib to dependency list
2026-01-13 00:55:20 +08:00
Giovanni
141f05b126
Remove rz_io_read_at and use only rz_io_read_at_mapped (#5777) 2026-01-11 22:50:50 +08:00
Anton Angelov
b2fb8bbec5
Improve performance of rz_bv_add_inplace() (#5751)
* Add rz_bv_add_inplace benchmark for 256-bit vectors

* Improve performance of rz_bv_add

* Simplify helper function and fix bug

* Minor changes
2026-01-11 00:14:19 +00:00
Giovanni
6926b6a65d
Rewrite C compiler code for rz-gg (#5761) 2026-01-10 13:36:51 +08:00
Khairul Azhar Kasmiran
e4ed1d3436
Fix "exeeds" typo (#5760) 2026-01-09 21:26:26 +08:00
Rot127
960dc17b23
util/bitvector: return successfully for bit vector shift of 0. (#5747)
The result of shift with 0 is perfectly well defined.
2026-01-08 23:27:38 +08:00
Rot127
4213ddfecc
Fix reachable invalid state, for bitvector in-place casts from large to large. (#5746) 2026-01-08 13:47:53 +00:00
Maijin
797fcd0ff6
test: increase coverage for RzCons and its components (#5735)
- Added tests for Cons Canvas, Histogram, HUD, Pal, Pager, Pipe, RGB, HTML, Line.
- Fixed rz_str_ansi_filter null terminator bug.
- Refactored test_cons.c by splitting it into smaller files.
- Improved many existing assertions to verify actual output content.
- Restored mu_assert_notnull checks for better reliability.

Co-authored-by: Maijin <maijin21@gmail.com>
2026-01-07 12:27:45 +08:00
Rot127
a89bbe5cf2
librz/util: implement inplace rz_bv_div and rz_bv_mod. (#5742) 2026-01-07 12:26:06 +08:00
Giovanni
ea21a4a7b4
Implement colors for tables and move RzListInfo out of table.c (#5729) 2026-01-05 21:34:41 +08:00
Khairul Azhar Kasmiran
37d2e2ff41
Readd deprecated rz_list_get_next() for rz-bindgen (#5718) 2026-01-01 23:54:53 +08:00
Khairul Azhar Kasmiran
ca47373fb7
Shorten rz_list_safe_prev/next to rz_list_prev/next (#5710) 2025-12-30 22:03:11 +08:00
SSharshunov
b4160d8050
New function rz_pvector_uniq (#5705) 2025-12-30 21:07:45 +08:00
SSharshunov
fb4822d658
librz/util: new function rz_pvector_find_index (#5700) 2025-12-30 03:33:54 +08:00
Arya H R
a6edb4ecc5
Fix various Coverity findings (#5668) 2025-12-30 02:02:56 +08:00
Khairul Azhar Kasmiran
2eac3fce25
Use macro versions of rz_list_iter_get_prev/next() instead (#5696)
* Add rz_list_safe_prev/next macros
* Remove rz_list_iter_get_prev/next() functions
* Use rz_list_safe_prev() macro instead of rz_list_iter_get_prev() function
* Use rz_list_safe_next() macro instead of rz_list_iter_get_next() function
2025-12-28 21:05:49 +08:00
Khairul Azhar Kasmiran
bd29b70793
Touch up rz_list_find() doc (#5693) 2025-12-27 22:38:52 +08:00
Giovanni
5ef76f42b8
Fix small mistake on x509 structure. (#5690)
* Fix small mistake on x509 structure.
* Add test with ed25519 certificate
2025-12-27 19:00:27 +08:00
Khairul Azhar Kasmiran
edfe7d3380
rz_list_contains: Return bool instead of iter (#5692) 2025-12-27 18:59:36 +08:00
Khairul Azhar Kasmiran
c93841de48
Remove rz_list_split() and rz_list_split_iter() (#5678)
* Remove rz_list_split() and rz_list_split_iter()
* Add RZ_OWN tag to rz_list_delete()
2025-12-26 22:32:24 +08:00
Khairul Azhar Kasmiran
c1fc1419e4
Rename some rz_list funcs to rz_list_XXX_val (part 1) (#5671)
* Rename rz_list_find_ptr() to rz_list_find_val()
* Rename rz_list_delete_data() to rz_list_delete_val()
2025-12-25 22:01:49 +08:00
Rot127
472819aa92
librz/util: add in-place bitvector operations (#5569)
* Add an in-place addition of bitvectors.

* Decouple _elem_len from assumption it has just enough bytes to hold len in bits.

* Add in-place copy of bits.

* Use default copy bits bitvector function.

* Mark stack allocated bit vector.

* Add inplace variant of complement_1

* Implement inplace bitvecotr not.

* Add inplace variant of rz_bv_and

* Implement inplace variant of rz_bv_or

* Implement inplace variant of rz_bv_xor

* Constify rz_bv_lsb/msb

* Implement inplace variant of rz_bv_neg

* Fix inplace add. Add inplace SUB

* Remove prefix

* Remove invalid const

* Implement in-place casting of bit vectors.

* Add a hash test

* Fix unnecessary &

* Prevent OOB reads & writes by copying only the minimum of bytes.

* Add inplace MUL

* Add ble version for bitvector set/get with bytes.

* Add documentation for inplace bitvector functions.

* Add bench of add/sub() and sub/add_inplace().

* Remove rz_bv_copy_nbits_inplace because it was the same as rz_bv_copy_nbits.
2025-12-23 13:56:06 +08:00
Giovanni
99c1a22d69
Extend ASN.1/PKCS7/X.509 to dump structures (#5656) 2025-12-22 09:41:56 +08:00
Peiwei Hu
8ca45d1ea5
Fix the missing release of RZ_OWN parameters (#5641) 2025-12-21 13:48:48 +08:00
Khairul Azhar Kasmiran
b96202ad48
Rename rz_list_first() / rz_list_last() to rz_list_first_val() / rz_list_last_val() (#5654) 2025-12-20 17:08:59 +08:00
Giovanni
f2f26b4466
Add pF8 for decoding PKCS8 & add info on /cm (#5647) 2025-12-20 16:28:10 +08:00
Giovanni
0a0e6c0b88
Optimize queue to act also as proper channel (#5627) 2025-12-20 00:40:13 +08:00