Commit graph

319 commits

Author SHA1 Message Date
Ashish Kumar
882ca0c6fb
rz-find: add -R option to execute rizin commands (#5981)
`-E` option now executes shell commands instead
2026-03-21 13:49:58 +08:00
Alok Kumar Mishra
470b1b1eb7
rz-ar: add archive extraction utility (#6036) 2026-03-18 03:51:18 +08:00
Ehab-24
9f85d684a1
Emacs style case conversions (#5898)
This PR introduces the following changes to rizin shell:

- Use Meta-L to lowercase the following word
- Use Meta-U to uppercase the following word
- Use Meta-C to capitalize the following word

The behavior of these actions is the same as in zsh.
2026-03-11 16:52:52 +00: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
Giovanni
17e19ac887
Log an error when endianness change is not compatible with arch (#5945) 2026-02-23 11:06:41 +08:00
Ehab-24
799dd7a57b
rz-hash: allow wildcard path expansion on *nix system shells (#5899) 2026-02-10 23:25:31 +08: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
Alok Kumar Mishra
d5bccae8e1
shell: add support for multiple paths in rz-find (#5875)
* rz-find: support multiple input paths

Fix multipath exit status, JSON framing, recursive error propagation; docs/tests. Also route rz-find to rz_main_rz_find in main dispatcher.
2026-02-06 21:56:30 +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
Giovanni
6926b6a65d
Rewrite C compiler code for rz-gg (#5761) 2026-01-10 13:36:51 +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
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
Zapper9982
fe14cdf1b5
rz-find: add -V (verbose) CLI flag (#5621) 2025-12-15 16:49:53 +08:00
Muhammed Answar C K
61f06f07ee
Fix rz-find ignoring RZ_LOGLEVEL. (#5592) 2025-12-10 14:51:06 +08:00
Giovanni
2f97762b09
librz/core: Remove rizin command output (#5540)
* Remove RIZIN command output for the old projects

* Fix cmeta.c

* Fix ik command

* Revert back pc*

* fix formatting cmd_descs_generate.py

* Fix rz_cons_pal_list_as_css

* Fill all info about colors for ec commands.

* Fix all tests
2025-11-28 23:41:47 +08:00
Khairul Azhar Kasmiran
f150e1859b
Fix quite and relocatons typos (#5549)
* Fix quite -> quiet typo

* Fix relocatons -> relocations typo
2025-11-25 12:04:11 +08:00
Khairul Azhar Kasmiran
58ab58962f
Touch up rz-run -h (#5450) 2025-10-11 12:25:32 +08:00
Khairul Azhar Kasmiran
397f03b2a8
Touch up rz-sign -h (#5443) 2025-10-09 21:34:53 +08:00
Khairul Azhar Kasmiran
7223d182ef
Remove brackets from args in rz-gg -h (#5441) 2025-10-08 10:03:44 +08:00
Khairul Azhar Kasmiran
04714648bb
Remove arg for -X in rz-gg -h (#5440) 2025-10-07 21:43:06 +08:00
Khairul Azhar Kasmiran
1edfc2f7c1
Remove brackets from args in rz-find -h (#5439) 2025-10-06 21:17:27 +08:00
Khairul Azhar Kasmiran
65752add5e
Remove brackets from args in rz-diff -h (#5438) 2025-10-05 22:13:35 +08:00
Khairul Azhar Kasmiran
deeaa15c90
Remove brackets from non-optional args in rz-bin -h (#5430) 2025-10-04 21:52:28 +08:00
Khairul Azhar Kasmiran
c65f79fff5
Remove -X from rz-bin -h (#5429) 2025-10-04 16:58:52 +08:00
Khairul Azhar Kasmiran
ff79a14c04
-h: Refactor out colored help printing code (#5421) 2025-10-01 06:02:15 +08:00
Khairul Azhar Kasmiran
3a4134280f
-h: Refactor out column width code (#5420) 2025-09-30 17:46:45 +08:00
Khairul Azhar Kasmiran
697bfa8b70
Update -h handling code to be consistent with latest (#5419)
* Rename `totalFlagAndArgLength` to `flagAndArgLength`
* Rename `maxOptionAndArgLength` to `maxFlagAndArgLength`
* Rename `optionLength` to `flagLength`
* Rename `totalLength` to `flagAndArgLength`
* Replace `sizeof(options) / sizeof(options[0])` with `RZ_ARRAY_SIZE(options)`
2025-09-28 22:36:07 +08:00
Khairul Azhar Kasmiran
a60c32b46e
Colorify rz-ax -h (#5413)
* Colorify `rz-ax -h`
* Hardcode `rz-find` binary name
2025-09-27 16:24:11 +08:00
Rot127
e7c0714b9a
Remove bin.debase64 option. (#5405) 2025-09-23 00:59:12 +08:00
Khairul Azhar Kasmiran
c538df45aa
Touch up rz-ax -h (#5401) 2025-09-21 19:01:09 +08:00
Khairul Azhar Kasmiran
805600d184
Honor -a, -b & -k on stdin binary (#5388) 2025-09-17 20:21:37 +08:00
Rot127
699c7d2dff
Improve performance of string search. (#5262)
* Make checks against defined Unicode points optional

* Allow to decode UTF-16 without writing the result.

* Remove PCRE2_NO_UTF_CHECK as default, since it can lead to undefined behavior.

* First refactor regex to support utf16 and utf32

* Add UTF-16-BE encoding function

* Add UTF-8 counting helper functions.

- One for counting the number of Unicode code points.
- The other to get the number of bytes required to represent the given UTF-8 string in UTF-16.

* Remove unused code

* Add UTF-8 to UTF-16 conversion function.

* Add type annotations

* Implement utf8 to utf32 string conversion

* Add UTF-16/32 versions of all other necessary regex functions for str search.

* Another regex refactor for utf16/32

* Add UTF16/32 regex matching tests.

* Implement still segfaulting (possibly JIT double usage) regex search.

* Duplicate match_first functions to reduce necessary branch predictions.

* Reduce number of required branches for encoding UTF16/32 to one.

* Duplicate match_all_internal functions to reduce necessary branch predictions.

* Fix too early free

* Only allocate match vector when needed.

* Fix: use code point size of buffer.

* Add missing return

* Normalize pointers to UTF16/32 strings to use proper code point with

* Also replace spaces with in utf16/32

* Add an additional host endian tests for UTF16/32 string encodings.

* Ensure thread savety.

JIT compiled patterns need to be owned by a single thread.
For the search we need to clone it.

JIT matching structures are optionally cloned as well.

* Enforce NO_UTF_CHECK in regex search.

This improves performance and currently is
default because we always match on binary data.

* Fix matching of UTF strings which are not suported by direct buffer matching.

PCRE2 only supports matching against memory which is aligned
to a code point width of the encoding.

These changes prevent taking the fast (direct matching with PCRE2) path
and use the slow string search path if the alignment doesn't match
the UTF string encoding.

To not complicate the change and additional alignment member
is added to each searched string in the search collection.

* Create search hit description on the stack

* Unset complete JIT matching if user provided custom jflags.

* Document what passing NULL to copy function pointers does.

* Replace the retarded idea of tracking offsets with a hashmap with a linear buffer.

This improves performance something like 10x.

* Remove const for the non-JIT builds.

* Remove additional flags for skip checking.

It is not needed because each decoded character is checked for printablity below anyways.

* Enfore no setup of IO mem with 0xff

* Fix: Set JIT complete flag for multi regex patterns

* Fix heap.

* Add note about worsed performance path.

* Fix unit test with string terminated by undefined code point.

* Run clang-format

* Fix order of arguments

* Add warning about string search with encoding=guess to tests.

* Fix string lengths, they no longer count the final invalid code point.

* Fix endian macro on Windows

* Fix NULL dereference

* Fix number tests

* Use endianness check not dependent on stdbit

* Fix type annotations.

* Reintroduce rz_str_len_utf8char

* Fix command description.

* Fix and unify RZ_SYS_ENDIAN macros.

- Don't allow unhandled architectures anymore.
- Check endianness for Sparc and PPC using non GCC/Clang compilers.
- Fix several endianness checks using the value instead of the macros.

* Fix tests

* Apply review comments.
2025-09-11 22:29:20 +08:00
Rot127
cb3e09aa4e
Fix SPARC/MC680x0 Mach-O fat binary issues (#5338)
* Add thread_state register layouts for Mac-O Sparc and MC680x0 binaries.

* Prevent hitting assert by passing NULL in some cases.

If name is not a valid arch identifier, it should complain later.

* Switch to m68k name, to match the asm.arch plugin name.

* Don't ignore endianess of fat Mach-O binaries.

And if it isn't ignored check for actual endianess,
not for being a PPC binary.

* Add `obs` command to select the different versions of fat binaries.
* Fix import tests of mach-o
* Properly rest xtr_data->loaded
* Update doxygen and remove RZ_DEPRECATED flag
2025-09-09 11:51:17 +08:00
Khairul Azhar Kasmiran
6d4385420b
Add missing quote marks to rizin -h (#5343) 2025-09-07 15:44:06 +08:00
Khairul Azhar Kasmiran
965ed766e3
Add I=RzIL to rz-asm -L help (#5341) 2025-09-06 17:49:36 +08:00
Khairul Azhar Kasmiran
844bde3878
Remove brackets from option args in rz-asm -h (#5339) 2025-09-05 22:18:44 +08:00
Khairul Azhar Kasmiran
4ec0863eab
Remove brackets from option args in rizin -h (#5336)
* Remove brackets from option args in `rizin -h`
* Update rizin man page
* Remove unused `USE_THREADS` and `ALLOW_THREADED` code
2025-09-03 23:14:31 +08:00
Nir Lichtman
255e3a3451
librz/main/rz-ax: fix bug of stdin mode (#5319) 2025-08-26 18:46:17 +08:00
NOT XVilka
1b60bf4335
search: remove ESIL search (#5258)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-07-11 14:19:08 +00:00
Ahmed Kamal
362bac16e2
Remove crash_handler_cmd && rz_sys_crash_handler (#5219) 2025-06-22 16:30:38 +08:00
Ahmed Kamal
93d914bd81
Remove Global/Static variables in path.c to make it thread safe (#5148) 2025-06-13 21:34:33 +08:00
Giovanni
181c74f4f2
librz/hash: add descriptions to all crypto & hash plugins (#5194) 2025-06-10 23:21:45 +08:00
Rot127
9ca4d81c42
Fix leak in error case (#5170) 2025-05-27 22:40:43 +08:00
Rot127
51f9509d61
Enable rz-test asm tests to test for multiple instructions in a single test. (#5166)
This allows to test for assembly characteristics which are only valid in a certain context.
Here we also fix a bug in rz-asm, which didn't incremented the address before disassembly.
2025-05-26 14:05:19 +00:00
Peiwei Hu
1d9eac6b6d
Refine the output of iz command and remove ordinal in RzBinString (#5122)
* Refine the output format of iz command

* fixup! Refine the output format of iz command

* fixup! fixup! Refine the output format of iz command
2025-05-23 13:46:30 +00:00
Giovanni
144b47d455
Move RzBreakpoint into RzDebug (#5124)
- Move trap/sw breakpoint into RzArch
- Remove RzBreakpointPlugin & RzBreakpointArch
- Add get_sw_breakpoint_at/get_sw_breakpoint_size_at binds
- Remove `dbh-`
- Change `dbh` to just list supported archs for sw breakpoints
- Implement correct PPC traps
- Add missing x86 breakpoint callback
2025-05-13 01:57:37 +08:00
NOT XVilka
132683d3bd
rz-find: print filename for symbol and import search (#5129)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-05-06 01:12:44 +08:00
NOT XVilka
610af0111a
rz-find: do not print filenames without match (#5113)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-05-03 17:32:41 +08:00
Giovanni
dbe651db33
Normalize the output of L subcommands (#5077) 2025-04-08 16:46:27 +08:00
Rot127
99efcb6c42
Fix asm tokens leaks because they used Vector and PVector (#5019)
* Fix asm tokens leaking horrendously because they used Vector and PVector.

* Fix some resource leaks related to asm tokens

* Fix some resource leaks of the hexagon module error cases.

* Fix possible NULL ptr dereference

* Fix leak of asm tokens by fun fini on RzAsmOp.

The RzAsmOp passed here could be a previously initialized one.
With allocated asm_tokens. Doing memset just leaks those tokens.

* Simplify the copy_asm_op function

* Always fini RzAsmOp before initializeing it.

* Set asm_toks to NULL after freeing

* Fix leak in asm_bf

* Fix leaks in test_token

* Initialize all RzAsmOps with 0 and free the asm_toks on init.

In practice rz_asm_op_init() is the best place to free the asm_toks reliably.
Simply because this is always called in the old code, before an instruction is disassembled.
Only in fini() is not enough, because there are too many place it is not called, leaking the tokens.

* Fresh mind, new attempt. Fini asmop at all occurrences of rz_asm_disassemble
2025-03-31 10:39:53 +08:00