Commit graph

107 commits

Author SHA1 Message Date
Florian Märkl
e8d6c98fcb
Patch Zydis for Mac OS X ppc support (Fix #6584) (#6587)
Port of upstream
1561ba3596
until released

Co-authored-by: Sergey Fedorov <vital.had@gmail.com>
2026-07-02 15:18:09 +02:00
Anton Kochkov
83749dfbed subprojects: update zlib to 1.3.2 2026-06-21 05:16:57 +08:00
Anton Kochkov
c5344d3c8a subprojects: update xz to 5.8.3 2026-06-21 05:16:57 +08:00
Anton Kochkov
401efa2af4 subprojects: update tree-sitter to v0.26.9 2026-06-21 01:09:02 +08:00
Khairul Azhar Kasmiran
486dc11548
Rename capstone-6.0.0-alpha8 patch dir to capstone-6.0.0-alpha9 (#6446) 2026-05-31 20:52:43 +08:00
billow
9e7cc02fcf
Update Capstone and add M68k ColdFire support (#6399)
* Update Capstone and add m68k ColdFire support
* Fix test 'core regs linux m68k'
* Add M68K ColdFire integration coverage
* Update Capstone v6 to version 6.0.0-Alpha9
* Refactor CPU mode detection to use case-insensitive string comparison
* Update Capstone next revision to 3df6ff0
2026-05-31 16:15:56 +08:00
Florian Märkl
f1251293a4 Patch zydis to work on OpenBSD/sparc64
This combines the following patches already sent upstream:
https://github.com/zyantific/zycore-c/pull/97
https://github.com/zyantific/zydis/pull/603

...and introduces a workaround to fix segfaults caused by accesses into
arrays of the packed ZydisShortString struct. The final solution will
likely be an upstream rework of this structure:
https://github.com/zyantific/zydis/issues/263

Finally, we adjust the condition for when ZydisStringAppendHexU32 is
used, since it is not defined by default. This is already solved more
elegantly in Zydis development upstream, but it requires more changes,
so we stick to a smaller patch on top of the latest release for now.
2026-05-11 11:54:02 +08:00
Florian Märkl
1cb5859f8e Apply patches/fix_zydis_amalgamated_riscv32_build to subproject
We already vendor a patched zydis and this fix should be available to
everyone, not only CI.
2026-05-11 11:54:02 +08:00
Jagath P
3e39942e70
Added disassembly support for cBPF (#5988)
* Added disassembly support for BPF

* Added the analysis plugin file and test file for classic bpf
2026-03-24 16:56:25 +00:00
Farhan Saiyed
e4464a1c55
blake2 hash support (#5995) 2026-03-06 22:17:59 +08:00
Naren Sirigere
ab82fc9fa3
Add SerenityOS Support (#5905)
* Add serenity to librt whitelist

This patch adds serenity to the list of operating systems that dont require librt to be explicity linked

* Disable PCRE2 JIT compilation

* Remove resolve_heap_tcache implementation

Serenity doesn't implement thread caching in its memory allocator, so tcache resolution is not applicable.

* Define rz_sys_pipe as pipe2 for serenity

* Add serenity identifier to rz_types.h

Define serenity as __UNIX__ like, and set RZ_SYS_OS to 'serenity' if __serenity__ identifier is defined

* Add zlib dependency for libzip
2026-02-23 16:34:05 +00:00
Rot127
42dbdd7900
Fix meson build warning about empty config data. (#5957) 2026-02-22 21:10:09 +00:00
مصطفي محمود كمال الدين
158765163a
librz/arch: rewrite the RISC-V support to use Capstone (#5482)
* remove GNU plugin and remove the pseudo-assembly test
* modernize Capstone-based RISC-V plugin and add huge test coverage
2026-02-17 03:35:37 +08:00
Naren Sirigere
f6c4f76380
Updated to pcre2 10.47 (#5830) 2026-01-27 14:44:51 +00:00
NOT XVilka
3ed43c4c77
Update Capstone v6 from Alpha5 to Alpha6 (#5842)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2026-01-27 12:08:05 +08:00
Maijin
07d3a812f7
subprojects: update libzip 1.11.4 (#5701)
Update libzip to 1.11.4

---------

Co-authored-by: Maijin <maijin21@gmail.com>
2025-12-30 05:29:39 +08:00
IndAlok
666d0ba8a0
Implement unified API for describing addresses (name+offset format) (#5571)
* core: Add unified API for describing addresses (resolves rizinorg#4993)
* core: Fix pxW and prompt tests by adding backward-compatible delta limit

This commit fixes the test failures caused by behavioral changes in the
unified address description API:

1. pxW tests failing (cmd_pxw, helloworld-gcc-elf):
   - The old pxW code had a hardcoded 8192 limit for flag delta
   - Added max_flag_delta option to RzAddrDescribeOptions
   - rz_core_addr_get_flag_offset() now uses max_flag_delta=-1 (8192 limit)

2. prompt settings test failing (test/db/tools/rz):
   - The old prompt code used spaces around +/- (e.g., 'entry0 + 1')
   - Added use_spaces_around_delta option to RzAddrDescribeOptions
   - Added rz_core_addr_get_flag_offset_prompt() for prompt display

* core/caddr: Add proper error handling and API improvements

- Add RZ_NONNULL annotations to helper function parameters
- Add null pointer checks after rz_str_dup() to detect allocation failures
- Change helper functions to return bool for error propagation
- Handle memory allocation failures in rz_core_addr_describe() by
  checking helper return values and cleaning up on failure
- Use RZ_STR_ISEMPTY macro for consistent empty string checks
- Extract rz_core_addr_description_to_pj() as separate API for
  converting RzAddrDescription to JSON format

* core: Add unified API for describing addresses (resolves rizinorg#4993)
 core: Fix pxW and prompt tests by adding backward-compatible delta limit

This commit fixes the test failures caused by behavioral changes in the
unified address description API:

1. pxW tests failing (cmd_pxw, helloworld-gcc-elf):
   - The old pxW code had a hardcoded 8192 limit for flag delta
   - Added max_flag_delta option to RzAddrDescribeOptions
   - rz_core_addr_get_flag_offset() now uses max_flag_delta=-1 (8192 limit)

2. prompt settings test failing (test/db/tools/rz):
   - The old prompt code used spaces around +/- (e.g., 'entry0 + 1')
   - Added use_spaces_around_delta option to RzAddrDescribeOptions
   - Added rz_core_addr_get_flag_offset_prompt() for prompt display
2025-12-10 19:11:31 +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
NOT XVilka
58644c8fe2
subprojects: fix PCRE2 cross build (#5379)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-09-16 00:21:17 +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
Khairul Azhar Kasmiran
369f290ac4
Add -Wno-error to relevant meson.build and unpin meson (#5327) 2025-08-29 20:46:40 +08:00
Rot127
72bf85309b
Bump Capstone to latest next (v6-Alpha5 + two fixes). (#5308)
- Fix LoongArch absolute address usage.
- Sparc: update to use new Auto-Sync module.
- Sparc: Fix unconditional delayed branch instructions with annul bit.
2025-08-22 09:29:04 +08:00
NOT XVilka
ba8c170852
Migrate from Capstone to Zydis (x86 architecture) (#5164)
* Added build files [Capstone to Zydis]

* x86 Analysis [Capstone to Zydis]

* Changed x86 RzIL [Capstone to Zydis]

* Changed asm and arch files [Capstone to Zydis]

* Compilation, build error and test fixes [Capstone to Zydis]

* Test changes [Capstone to Zydis]

* Remaining changes [Capstone to Zydis]

* Added BE support [Capstone to Zydis]

---------

Co-authored-by: tushar3q34 <tushar3q34@gmail.com>
2025-05-23 13:03:46 +00:00
Giovanni
edbd019943 Update capstone-v6 to 6.0.0-Alpha4 (#5085) 2025-04-14 23:22:12 +04:00
NOT XVilka
52cadeeb5f
subprojects: update xz to 5.8.1 (#5067)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-04-05 12:30:58 +08:00
Khairul Azhar Kasmiran
84c7d84d58
Prevent installation of libzstd.pc (#5008) 2025-03-18 00:39:59 +08:00
Anton Kochkov
d253d24d07 subprojects: update tree-sitter 2025-03-07 09:45:07 +00:00
NOT XVilka
495a79bfaf
subprojects: update lz4, xz, zstd libraries (#4958)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-03-04 02:44:53 +08:00
Anton Kochkov
c8e653fbc1
subprojects: update libzip from 1.9.2 to 1.11.3 (#3667) 2025-03-01 15:25:09 +08:00
Rot127
309f57434d
PCRE2 10.45 update. (#4889)
* PCRE2 10.45 update.
* Clone with depth 2 to get SLJIT project.
2025-02-11 02:00:50 +08:00
Rot127
d61b1c95e8
Bump Capstone version to newest next. (#4869) 2025-01-30 00:23:39 +08:00
Rot127
8d391b7b38
Bump Capstone v6 to Alpha3 (#4867) 2025-01-29 11:22:29 +08:00
Giovanni
b019d9d4ca
Add initial support to loongarch 32/64 (#4810) 2025-01-01 15:36:23 +08:00
billow
c3c494d961
librz/arch: migrate Xtensa to Capstone (#4654)
* Add xtensa arch capstone plugin
* Remove xtensa-gnu
* fix: `asm.cpu` is not set correctly, when there is no “,” in asm plugin -> cpus
* fix core_disassembly when n_bytes==0
* fix xtensa_analyze_op_esil
* fix xtensa esil pc mod
* fix xtensa esil l32r
* fix xtensa esil call0
* fix xtensa esil extui
* fix xtensa esil store
* fix xtensa stack inc and ret
* keep `asm.cpu` when valid in cb_asmarch
* fix cb_asmarch
* fix max op size
* xtensa: add cpu select
* xtensa: mark PUSH POP
* xtensa: set src dst
* xtensa: set dir
* xtensa: fix stackframe
2024-11-11 00:38:54 +08:00
amibranch
8e6b764fb5
build: Improved meson-build to use rizin as subproject (#4684)
* Setting GNU99/C99 standard for subprojects
* Remove use of `add_global_arguments`
* Added extern "C" linkage specification to some public headers of rizin
* Changed the meson_git_wrapper.py-script to explicitly specify the output-path
* Made the RIZIN_BUILD_PATH conditional in the integration-test meson-build

Co-authored-by: amibranch <amibranch@users.noreply.github.com>
2024-10-29 23:59:42 +08:00
Rot127
f82993a30d
librz/arch: capstone v6 update (without MIPS) (#4662)
* Bumps Capstone version to newest Capstone next (beyond first v6-Alpha1).
* Fixes leaks
* Fixes build and change to AArch64 and SystemZ compatibility headers.
* Marks M68k test as broken (see commit message).
* Fix AArch64 and SystemZ tests
* Handle op.size == 0 for x86 IL ops
2024-10-25 00:07:07 +08:00
Anton Kochkov
6f0d6750d1 subprojects: rename tree-sitter-c into rizin-grammar-c 2024-09-12 00:41:23 +08:00
Anton Kochkov
a9fc1bd458 subprojects/zlib: bump version to 1.3.1 2024-08-15 22:51:42 +08:00
Rot127
032b2903e4
Update to PCRE2-10.44 (#4541) 2024-06-08 14:54:22 +08:00
Anton Kochkov
c530cc9cae capstone: update to the latest next 2024-04-27 16:44:21 +08:00
Khairul Azhar Kasmiran
d9d066a377
Use fallback repo for xz 5.2.9 (#4403)
* Downgrade to xz 5.2.9
* Patch xz-5.2.9's src/common/tuklib_integer.h
2024-03-30 21:47:49 +08:00
Khairul Azhar Kasmiran
29f9c8a9da
Update tree-sitter to 0.21.0 (#4338) 2024-03-06 20:42:39 +08:00
Rot127
de1b126b5d
Disable PCRE2 JIT for Darwin (#4329) 2024-03-05 17:07:07 +08:00
Rot127
905416f928
Disable usage of wx pages on darvin. (#4311) 2024-03-03 11:39:12 +08:00
Rot127
a84c7897fc
pcre2: fix NetBSD build by using different allocator. (#4259) 2024-02-18 18:22:06 +08:00
Rot127
1311b75c75 Bump PCRE2 to 10.43 release. 2024-02-18 07:26:08 +00:00
Rot127
5afc51f0e2
Replace current regex engine with PCRE2 (#4185)
* Replace OpenBSD regex library with PCRE2.

PCRE2 has way better performance than the OpenBSD
library (something around 20 times faster).

The following flags are enabled for every pattern:

- PCRE2_UTF
- PCRE2_MATCH_INVALID_UTF
- PCRE2_NO_UTF_CHECK

All the others are optional.

Changes made:

- Adds PCRE2 as subproject.
- Changes the API away from POSIX to PCRE2.
- Edits many regex patterns because:
 - ' ' is skipped in patterns, if the EXTENDED flag is set for matching. '\s' must be set now.
 - '.' doesn't match newlines by default.
- Changes the API so matches and their groups are bundled into PVectors.
- Moves the regex component to rz_util.

* Fix cross build - add copy of PCRE2 dependecy

Meson currently doesn't support subprojects to be native and non-native at the same time.
See: https://github.com/mesonbuild/meson/issues/10947
Unfortunately, sdb depends on rz_util which in turn depends on PCRE2.
Excluding PCRE2 from the native build makes linking of rz_util not possible anymore.
Adding it, will make Meson complain that the dependencies cannot be mixed.

Hence, we compile a copy of PCRE2 for the native build if required.
2024-02-05 12:51:16 +08:00
Khairul Azhar Kasmiran
54842b8eb8
Drop -fno-strict-aliasing flag from capstone next build (#4149) 2024-01-24 23:24:46 +08:00
Khairul Azhar Kasmiran
63d3369538
Use -fno-strict-aliasing with Capstone next build (#4060) 2024-01-01 22:49:01 +08:00
Khairul Azhar Kasmiran
d9ca656907
Downgrade Capstone next build to -O1 on gcc release build (#4054) 2023-12-30 16:03:27 +08:00