Commit graph

75 commits

Author SHA1 Message Date
Farhan Saiyed
e4464a1c55
blake2 hash support (#5995) 2026-03-06 22:17:59 +08:00
Maijin
129903687e
doc(hash): improve README and add example (#5135) (#5614)
Improved `librz/hash/README.md` documentation to accurately reflect API usage, specifically `RzHash` vs `RzHashCfg`. Added a working C example `examples/api/hash/md5.c` demonstrating proper initialization and hashing workflow.
2025-12-14 02:39:34 +08:00
Anton Angelov
c186f1ec83
Enhance performance of rz_bv_copy_nbits (#5541)
* Add benchmark for rz_bv_copy_nbits
* Improve performance for large to large and small to small bitvector copy
* Fix bug with nbit=64 and simplify code
* Add test for same bitvector copy
* Move bit copy logic to separate function in rz_bits.h + improve comments
* Support same vector copy for unaligned case
* Expect non-null RzTable in bench utils and add comments
* Test against reference implementation instead of hardcoded values
2025-11-23 21:52:23 +08:00
Zephyr Lykos
fef5cb03fb
Add option to use system BLAKE3 (#5414) 2025-09-28 13:11:33 +08:00
Giovanni
3efdc9a318
Add rz-libswift as dependency and disable globally use_swift_demangler (#5298) 2025-08-16 00:03:55 +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
Khairul Azhar Kasmiran
602b1ae187
Show RZ_LOG_WARN warnings by default for all build opt levels (#5084)
* Show RZ_LOG_WARN warnings by default for all build opt levels
* Check for unsupported `checks_level` values
2025-04-13 21:08:17 +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
Dhruv Maroo
19ec6ba298
Use SoftFloat 3e for implementing arithmetic operations in RzFloat (#4535)
* Add a new test for checking 80-bit floating point operations

    * New test `f80_ieee_div_test` tests the division of two 80-bit
      floats

* Add SoftFloat 2c as a meson subproject

* Add softfloat code to make the failing test case pass

* Update the hash for the latest softfloat revision

* Implement `rz_float_sqrt` using SoftFloat

* Run the `f80_ieee_div_test` only for x86

* Replace SoftFloat version 2c with 3e

    * 3e has less bugs and more features
    * Modify the implementation in accordance

* Update SoftFloat revision and add a guard around the 80-bit div test

* Use SoftFloat for add, sub, mul operations as well

* Make rem and mod also use SoftFloat functions

    * Also add test for mod and rem, and fix behavior of rem

* Add comment about behavior of mod and rem

* Add comments for tests which have different results for mod and rem

* Simplify usage of loop variable as suggested in review

* Remove unused macro from float.c

* Implement `FMA` and `ROUND` using SoftFloat API

* Add more tests for 80-bit floats

* Change remote to a repository under rizinorg

* Add info about the rounding mode in the Doxygen for rem and mod

* Add comments in tests for rem and mod in `test_float.c`

* Use bitvectors to initialize 80-bit soft floats

    * This makes the tests more portable and hence they can be run on
      any platform

* Remove guards for f80 tests since they are portable now
2024-06-25 22:06:24 +05:30
wargio
c613ac3b70 Revert back only the changes for the threads code and ignores rz-test 2024-06-02 18:11:06 +08:00
Khairul Azhar Kasmiran
7b91fb69c2
Revert #4506 (#4519) 2024-05-27 21:50:58 +08:00
Giovanni
d19fc9d0d8
Add N_THREAD_LIMIT to limit the max number of threads (upper limit). (#4510) 2024-05-24 16:12:08 +08: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
Rot127
b16471fa53
Remove Capstone 3 (fix CS 4 & 5) (#3934)
* Remove macros checking for CS_API_VERSION 3

* Remove CS 3 from meson_options and subprojects.

* Remove Capstone v3 from CI

* Remove CS_API_VERSION >= 4 checks since always true from now on.

* Add CSv5 workflow to CI.

* Handle ARM pre v6 build errors.

* Fix PPC build errors for CS < v6

* Fix correct macro name

* Remove wrong include.

* Fix fallthrough warning

* Fix getter macros for WB and post-fix flags.

* Fix faulty macro name

* Check for all float extensions for vabs.

* Add return to assert cases.

* Update cs to 46154e8605aaefdcca5fecf4ea88b92db5a40ad3

* Remove cs3 wrap file.

---------

Co-authored-by: wargio <wargio@libero.it>
2023-10-25 18:30:15 +08:00
Riccardo Schirone
738be8e7e4
build: allow to use system libzstd and fix includes/lib installation (#3858) 2023-09-15 14:38:37 +08:00
yossizap
4aadd18f7e Set the default capstone version to v5 instead of v4
Co-authored-by: wargio <wargio@libero.it>
2023-07-16 13:22:47 +08:00
Riccardo Schirone
478f74a95e build: Introduce EXTRA_PREFIX for loading plugins/resources from another path 2023-05-19 16:42:35 +02:00
Riccardo Schirone
497c2b2e05
Remove old bash-based rz-pm (#3360) 2023-02-07 18:26:38 +08:00
Giovanni
f8d15acd8b
Disable rz-pm (script) installation (#3007) 2022-09-05 20:15:46 +02:00
Riccardo Schirone
d1feb6cea3
Build: add option to choose to regenerate cmd_descs.[ch] (#2934) 2022-08-19 16:15:56 +02:00
Florian Märkl
b85636317c Drop libuv dependency
libuv was only ever used for the tcp server for almost 4 years. Since
the non-libuv implementation of that is working now, it can be dropped
entirely without sacrificing functionality.
2022-08-06 13:20:52 +02:00
Khairul Azhar Kasmiran
fc24887c5c
Update on every build the git hash shown by rizin -v (#2863) 2022-08-01 23:28:34 +08:00
Riccardo Schirone
33974fccc8 util: make zlib dependency optional 2022-07-18 08:39:11 +02:00
Khairul Azhar Kasmiran
0603a78871
meson: Remove unused version_commit (#2808) 2022-07-14 23:09:49 +08:00
Riccardo Schirone
2f1e39818e Add liblzma subproject 2022-07-02 10:12:26 +02:00
Giovanni
ea02b0d25f
Remove zignatures and move aaF[l] -> F[al] , zf[sdc] -> F[sdc] (#2682) 2022-06-29 07:49:43 +08:00
Giovanni
648882d544
Add libmspack and add idpx to extracts compressed pdb (#2728)
* Add libmspack, cabextract and add idpx to extracts compressed pdb
* Remove cabextract from CIs since it is not anymore required.
2022-06-27 23:52:07 +02:00
Giovanni
bfec86a12e
Add option to install sigdb systemwise and custom user location for additional signatures (#2328) 2022-02-28 14:32:38 +01:00
Riccardo Schirone
6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00
Riccardo Schirone
64469f2811
Changes in how paths are handled (#1997)
* Remove `RIZIN_EXTRAS` because useless

Extras plugin should be treated as any other regular plugin, they should
not have their own directory. I believe we did not have anyway any
plugin using that directory.

* Do not use `<version>` in `/usr/share`

Users can only install one version of Rizin at a time anyway, thus
splitting the `/usr/share/rizin` directories does not really bring
multi-version install possible. At the same time, we stick to what's
common for other tools, which do not use version in `/usr/share`

* Move plugin directory to `/usr/lib64/rizin/plugins`
* Remove `RZ_HOME_BIN` env var because not useful anymore
* Introduce `rz_util/rz_path` to provide rizin paths
* Use `rz_path_system_sdb_types` whenever it makes sense
* Use some others `rz_path_*` functions instead of custom ones
* Use `rz_path` APIs for themes, fortunes and signatures
* Remove `rz_sys_prefix`
* Reduce the number of defines needed to handle home and system paths
* Reduce the number of `rz_path` functions
* Make the lib debug depending on log level and `RZ_LOG_DEBUG`
* Refactor a bit how directory of plugins are loaded
* Keep supporting old plugins directory for at least 0.4.0
2021-11-30 13:36:38 +08:00
Florian Märkl
d8450b8e75
Add local=absolute option to meson for absolute rpaths (#1911) 2021-11-09 07:04:34 +08:00
Giovanni
e224ee7b28
Add demangling as plugins and libdemangle as external dependency (#1656)
* Added demangling as plugins and libdemangle as external dependency
* Added iDl to return the list of demanglers
* moved demangling tests into rz-libdemangle and keep only bin tests
2021-10-01 10:45:38 +00:00
Riccardo Schirone
db04bed503
Fix autocompletion of rz- commands in rizin shell and rename wrong rz_ (#944) 2021-03-31 16:10:54 +02:00
Riccardo Schirone
53b4537160 Introduce portable build option to use relative paths
`portable` makes rizin use paths relative to the executable binary path,
so that all resource files (e.g. SDB files) can be retrieved without
having an hard-coded prefix in the binary. By doing so, rizin
installation directory can be moved from location to location and still
work. This is useful when having a static rizin that you want to execute
on another system.

It makes sure that all PATHs defined in rz_userconf.h are just relative
to the prefix and that, in the code, the prefix is prepended to all
these paths.
2021-02-25 19:41:38 +08:00
Riccardo Schirone
1ea1d265b6 Move libuv to meson subproject wrap
* disable werror on libuv, it would fail otherwise
* ci.yml: use --werror instead of changing CFLAGS
* keep libuv optional but used by default
2021-02-12 11:08:51 +08:00
Riccardo Schirone
9349b2f3ed Move libzip to meson subproject wrap
* optionally depend on lzma, bzip2 and openssl for additional zip support
* add use_sys_libzip_openssl meson option to choose if openssl should be
  used in libzip or not
* avoid optional dependencies on windows to avoid troubles
2021-02-12 11:08:51 +08:00
Riccardo Schirone
43e4269d34 Make use_sys_* meson option features instead of boolean
* Use the features directly as argument of `dependency`.
* Remove doc/capstone.md doc file because already in PACKAGERS.md
2021-02-12 11:08:51 +08:00
Riccardo Schirone
f8291ee3c1
Switch to meson subprojects and wraps
* Remove tree-sitter/sdb git submodules and move them to meson subprojects/wraps
* Use meson subprojects/wraps to get capstone
* Remove capstone patches as they are already applied to rizinorg/capstone repository
* Use meson from master branch to create the release tarball, as all released versions so far have a bug that prevent wrap-git to be patched correctly when creating the tarball with meson dist
* Add check_meson_subproject script to do a quick check if the currently downloaded subprojects are updated
* Add subprojects_check meson option to skip the check_meson_subproject script
* Update documentation to remove references to git submodules.
2021-02-03 14:31:11 +01:00
Riccardo Schirone
11ed71244c
Search for static dependencies/libraries when static_runtime is set (#473)
Do not search for static windows-specific libraries, they will be
handled by /MT.
2021-01-29 16:54:18 +08:00
Riccardo Schirone
301e5af217 Remove RZ_GITTAP 2021-01-28 11:57:28 +01:00
Riccardo Schirone
018c0eaa53
Change how version is reported in -v command flag 2021-01-27 16:42:47 +08:00
Riccardo Schirone
564e64be3e
Improve meson information, structure and move fortunes (#213)
* Simplify a bit meson.build
* Use meson summary and move fortunes install dir
* Use 0.55.0 meson version
* Use /CURRENTUSER to select local installation
2020-12-18 11:28:19 +01:00
Riccardo Schirone
bbccf28ee0
Use RPATH when the prefix is not the standard /usr (#164)
This is to make it easier for people to install rizin without dealing
with LD_LIBRARY_PATH, while at the same time avoiding RPATH when things
are installed in the system-wide path (for most systems, at least). In
any case, people can disable this behaviour by using `-Dlocal=disabled`.
2020-12-11 00:07:39 +08:00
Riccardo Schirone
7ceebc725e Mass renaming r2 to rz/rizin 2020-10-13 12:43:34 +02:00
Riccardo Schirone
778978022b
Move tree-sitter to a submodule (#29) 2020-10-13 12:40:03 +02: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
Ole André Vadla Ravnås
8681963bce
Add Meson option to specify whether CLI tools should be built (#17625) ##build 2020-09-10 14:55:06 +02:00
Riccardo Schirone
3e3efcc005 Test compilation with various capstone versions ##build
Do not use #include <capstone/..>

This ensures compatibility with both capstone v3 and capstone as
installed on most distributions, where the pkg-config file of capstone
already adds -I/usr/include/capstone (with that dir directly containing
the headers).
2020-09-09 15:39:33 +02:00
Riccardo Schirone
d6c9bd4542
Add support for binr/blob and fix android build ##meson ##build (#17150)
* Make sure meson can build with `system` = `android`.

* Add support for binr/blob in meson build

* Add also r_util as dependency

* Create sdb_version.py to get the SDBVER value from config.mk

* Set unknown sdb version if something fails
2020-07-05 10:53:37 +08:00