Commit graph

29852 commits

Author SHA1 Message Date
billow
697bb8ffbc
linter: update clang-format entries in .git-blame-ignore-revs (#5453) 2025-10-12 12:07:13 +08:00
billow
7a77b8f7bd
linter: update clang-format installation to version 20 (#5451)
* fix: format with clang-format-20
* fix: fix clang-format linter with rewrite '^#define.*/\*.*\\$'
* fix: update clang-format to version 20 in workflows and documentation
* fix: add SPDX license information to .git-blame-ignore-revs
2025-10-12 08:02:03 +08:00
Rot127
4872db027b
librz/bin: fix memory leaks (#5448) 2025-10-11 13:16:04 +08:00
Khairul Azhar Kasmiran
58ab58962f
Touch up rz-run -h (#5450) 2025-10-11 12:25:32 +08:00
NOT XVilka
32921799cc
test: remove external HTTP test (#5449)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-10-11 10:25:59 +08:00
Premade
34933bc525
refactor: rz_mark_foreach_glob to rz_mark_foreach_regex (#5446) 2025-10-11 00:55:10 +08:00
Khairul Azhar Kasmiran
397f03b2a8
Touch up rz-sign -h (#5443) 2025-10-09 21:34:53 +08:00
billow
ac55cf4675
h8500: fix coverity issues (#5442)
- Implement str_replace_once_no_heap function for safer string replacements
2025-10-09 16:13:05 +08:00
Khairul Azhar Kasmiran
7223d182ef
Remove brackets from args in rz-gg -h (#5441) 2025-10-08 10:03:44 +08:00
Rot127
d79ff51157
librz/bin: define string search parameters in plugins (#5406)
* Clarify docs of raw_alignment

* Set Go and Rust string encoding for binary string search.

* Add detailed doxygen about string search in bin plugins.

* Add the number string code points as detail to string search hits.

* Add helper to check if string encoding needs scanning.

* Add helper to generate a string wildcard pattern.

The pattern is supposed to match any human readable string.
Before the string search refactor there was no explicit definition
what characters mark the end of a string and which ones don't.

This pattern should match strings of the old interpretation.

* Enable the RzBin plugin to search strings with direct matching instead of scanning.

This significantly speeds up the string search when a binary is opened.
The prerequisite is that the plugin specifies the string encoding.

* Enforce UTF-8 for initial string search.

* Add custom string search for PE files.

* Clean up and document rz_utf8_encode

* Don't demote explicit UTF-8 encoding to ASCII.

* Increase min JIT stack size due to not reproducable search results.

* Simplify wildcard regex pattern.
2025-10-08 10:02:32 +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
Dhruv Maroo
1d836d7fc6
Type parser can now handle parenthesized declarations correctly (#5436)
* Type parser can now handle parenthesized declarations correctly

    * Also make the type pretty-printer print nested callables
      correctly and also take into account arrays in nested callables

* Add test for nested callable type parsing and printing

* Fix breaking test

* Add a unit test for the new type parsing/printing logic

* Fix the pretty printing by using the correct order for wrapping types

* Fix how the function pointer types look in pdb integration tests

* Format according to clang-format

* Change the logic for adding parens for the innermost wrapping type

* Fix broken integration tests

* Add type annotations for RzPVector; Initialize variable to fix build
2025-10-06 19:47:12 +08:00
Khairul Azhar Kasmiran
65752add5e
Remove brackets from args in rz-diff -h (#5438) 2025-10-05 22:13:35 +08:00
Rot127
92eff78276
librz/util: UTF-16/32 to UTF-8 conversion (#5431)
* Replace rz_str_utf16_to_utf8 with one matching the other string convert functions.
* Add rz_str_utf32_to_utf8
2025-10-05 19:16:53 +08:00
Khairul Azhar Kasmiran
1c5b3e6616
Add unit test for #5425 (#5437) 2025-10-05 19:00:45 +08:00
Rot127
47d2fb1911
librz/util: remove const qualifier from buffer. The ownership is transferred. (#5433) 2025-10-05 14:42:10 +08:00
Rot127
57b008fe78
regex: add some doxygen (#5432)
* Document the MUTF-8 encoding.

* Add comments how to use the regex flags
2025-10-05 14:41:49 +08:00
Rot127
f8c4f38fa1
Add DOTALL flag to regex. (#5434) 2025-10-05 14:41:28 +08:00
Khairul Azhar Kasmiran
7cd1f29c6c
Use internal tail for dbg_dmh test (#5435) 2025-10-05 14:40:03 +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
billow
68da5f7db2
Add Renesas H8/500 plugin (#5340)
* add h8/500 plugin stub

* refactor h8500 instruction parsing and disassembly logic

* fix: remove debug print statement from h8500 EA parsing
fix: correct plugin name from h8300 to h8500
add: new test case for h8500 disassembly

* refactor: improve operand parsing and disassembly logic for h8500

* refactor: update operand representation in h8500 EA parsing

* refactor: enhance operand definitions and add test cases for h8500 instructions

* fix: add h8500 disassembly plugin to command lists

* refactor: enhance H8500 instruction and operand structures for better parsing

* refactor: update H8500 instruction set with size suffixes and enhance operand handling

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: update H8500 operand handling and address mode definitions for consistency

* refactor: update H8500 addressing flags and operand handling for consistency

* refactor: update H8500 immediate operand syntax to use '#' prefix for consistency

* refactor: update H8500 addressing modes and mnemonics for consistency

* refactor: add new H8500 instructions BNOT, BSET, BSR, and BTST with operand handling

* refactor: update H8500 opcode definitions and add new CLR and CMP instructions

* refactor: add DADD instruction to H8500 opcode definitions and update related tests

* fix: correct memory copy size in h8500_instruction_parse function

* refactor: add DIVXU, EXTS, and EXTU instructions to H8500 opcode definitions and update tests

* refactor: add JMP instruction to H8500 opcode definitions and update tests

* refactor: add JSR instruction to H8500 opcode definitions and update tests

* refactor: add LDC, LDM, and LINK instructions to H8500 opcode definitions and update tests

* Update librz/arch/isa/h8500/h8500.c

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: update H8500 addressing mode and operand flags to use ut64 type

* refactor: update H8500 addressing modes and add MOV instruction test cases

* feat: add MOVFPE, MOVTPE, and MULXU instructions to H8500 opcode and assembly

* feat: add NEG, NOT, and NOP instructions to H8500 opcode and assembly

* feat: enhance H8500 opcode with new instructions and EA flags

* fix: change enum to typedef enum for addressing mode definition

* pjmp

* pjsr | prts

* rot*

* rt*

* scb

* sh*

* sleep | stc | stm

* sub*

* swap

* tas | trapa | trap/vs | tst

* fin disas

* fix header

* add h8500_reg_name function to retrieve register names

* implement H8500 instruction analysis and operand value extraction

* refactor H8500 addressing modes and operand definitions for clarity

* fix msvc 2017 build

* fmt

* fix: update description for H8500 disassembler plugin

* fix: cmd test

* fix: coff h8500 support

* add author and cpus

* fix: test cmd

* feat: add instruction operand string retrieval and new instruction test

* fix: change operand length type from size_t to int in h8500 instruction parsing functions

* feat: add dsub instruction and update operand syntax in h8500 assembly files

* feat: update h8500 opcode descriptions and add new branch instructions

* Fix coff permissions when rz_coff_perms_from_section_flags returns 0

* Fix missing op->size

* refactor: update addressing mode macros and improve operand handling in h8500

* Refactor assembly syntax for H8500 instructions

- Added spaces for better readability in the assembly instruction definitions.
- Updated the formatting of operand lists to include spaces around commas.
- Ensured consistency in the formatting of immediate values and register references.
- Adjusted the assembly test cases to reflect the new formatting style.

* fix: correct permissions for .drectve sections in COFF format

* feat: add initial test cases for h8500 registers and analysis

* fix: add comment to clarify H8300 machine definition in COFF specs

* fix: correct typo in expected output for h8500 analysis

* fix: update data type and constants for H8500 pattern checks

* fix: apply suggestion

* fix: update H8500 instruction encoding and address modes

* fix: add cmp.b and cmp.w instructions for H8500

* fix: refactor H8500 analysis for improved address mode handling

* fix: enhance H8500 analysis for improved operand handling and stack operations

* fix: improve operand handling in H8500 analysis for better instruction processing

* fix: update PJSR instruction format for H8500 and enhance CMP instruction handling

* fix: enhance H8500 function analysis with additional metadata for varfunc and leaffunc

* fix: add documentation and clarify PC-relative mode handling in H8500 instruction parsing

* fix: correct PJMP instruction format to include address dereferencing

* Update librz/arch/isa/h8500/h8500.c

Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: wargio <deroad@kumo.xn--q9jyb4c>
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
2025-10-03 13:10:55 +00:00
Khairul Azhar Kasmiran
d3eb97e4b7
rz_print_colored_help: Add guard condition to check options length (#5427) 2025-10-03 19:30:03 +08:00
Khairul Azhar Kasmiran
46bbf79e25
-h: Convert camelCase vars to snake_case (#5426)
* Rename `maxDescLength` to `max_desc_len`
* Rename `descLength` to `desc_len`
* Rename `maxFlagAndArgLength` to `max_flag_and_arg_len`
* Rename `flagAndArgLength` to `flag_and_arg_len`
* Rename `flagLength` to `flag_len`
* Rename `argLength` to `arg_len`
* Rename `maxOptSpaces` to `max_opt_spaces`
* Rename `remainingSpaces` to `remaining_spaces`
* Rename `maxDescSpaces` to `max_desc_spaces`
* Change `flag_and_arg_len` to `flag_n_arg_len`
2025-10-02 23:02:21 +08:00
Khairul Azhar Kasmiran
93af16ea15
rz_vector_insert_range: If count is 0, bypass rz_vector_index_ptr() in returning insert addr (#5425)
* rz_vector_insert_range: If count is 0, bypass rz_vector_index_ptr() in returning insert addr
* Add documentation to rz_vector_insert_range
2025-10-01 22:04:05 +08:00
Rot127
d809a19937
Fix regex of asm operator token by escaping '-'. (#5422) 2025-10-01 10:11:03 +08:00
Zephyr Lykos
8d6685b99e
Fix using system zydis (#5416) 2025-10-01 10:10:41 +08:00
Zephyr Lykos
aadf850e28
Fix using system libpcre2 (#5417) 2025-10-01 10:09:55 +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
Zephyr Lykos
fef5cb03fb
Add option to use system BLAKE3 (#5414) 2025-09-28 13:11:33 +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
Tushar Jain
5cbab45fd8
Devirtualize message dispatch in ObjectiveC (#5328) 2025-09-27 15:37:02 +08:00
Khairul Azhar Kasmiran
ae4ce0dd5d
Ignore subprojects/.wraplock (#5410) 2025-09-25 20:57:27 +08:00
Khairul Azhar Kasmiran
811bd2e7b5
Revert -Wno-error cancel flag (#5408)
* Revert `-Wno-error` cancel flag
* Set `werror=false` in rizin-grammar-c subproject
2025-09-25 20:17:06 +08:00
Khairul Azhar Kasmiran
5fb6d4c58e
Unpin meson in Windows installer builds (#5407) 2025-09-24 22:56:23 +08:00
Rot127
e7c0714b9a
Remove bin.debase64 option. (#5405) 2025-09-23 00:59:12 +08:00
Rot127
3c9dd73f61
hexagon: move might_have_jumped to state. (#5403) 2025-09-22 22:58:44 +08:00
Khairul Azhar Kasmiran
c61e10c61a
Test <program> -h (#5402) 2025-09-22 20:36:47 +08:00
Rot127
fa872fa77f
Add s390x cross build example. (#5384) 2025-09-22 11:44:03 +00:00
NOT XVilka
e70a55b65f
core: remove pg and visual ROP (#5398)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-09-21 22:37:16 +08:00
Khairul Azhar Kasmiran
c538df45aa
Touch up rz-ax -h (#5401) 2025-09-21 19:01:09 +08:00
Khairul Azhar Kasmiran
c9deaf5338
Add 4 minutes to the go1.16 arm32 test (#5399) 2025-09-20 21:09:42 +08:00
Khairul Azhar Kasmiran
1cb28dc1e7
help, scr.utf8=true: Add 1 space after left bar (#5397) 2025-09-19 20:06:18 +08:00
Rot127
41bbed1883
Fix and extend string search integration tests (#5393)
* Remove unused declaration.

* Fix integration test to have a real scan example.

This also fixes a bug that the last NUL/invalid byte in a string
was not included in the UTF-8 bytes -> memory offset map.
2025-09-18 22:54:23 +08:00
Rot127
8c36e6b567
docs: add RzSearch documentation (#5391) 2025-09-18 22:19:25 +08:00
Rot127
2d7b178c84
String search performance improvement (#5383)
* Add speed up search for unaligned buffers and string encodings.

The new search mode adjusts the buffer's data (swap endianness, fix alignment)
so the buffer can be searched with PCRE2 without scanning.

It also enables RzRegexMulti opbjects to have their own JIT stack.
This makes them usable in a thread safe manner.

* Fix regex compilation on big endian systems

* Update the scanning check (UTF needs no scanning anymore).
2025-09-18 00:42:03 +08:00
Khairul Azhar Kasmiran
805600d184
Honor -a, -b & -k on stdin binary (#5388) 2025-09-17 20:21:37 +08:00