Commit graph

796 commits

Author SHA1 Message Date
مصطفي محمود كمال الدين
cf39746a03
add RISC-V 32-bit env to CI (#6109) 2026-04-14 15:39:39 +08:00
Rot127
d474c1f2a9
Fixes the leak checking workflow. (#6205)
- It uses now the changed lines provided by the get_real_shas workflow,
  which prevents failing if PR gets out of sync with base branch.
- Fixes a bug in lsan_check.py which used the wrong line number as reference.
- Moves the whole leak detection workflow out of ci.yml to simplify it.
- Uploads the leak stack traces as artifact for local analysis.
2026-04-13 09:36:24 +00:00
bubblepipe
bb76233c2e
Refactor windows heap parser (#6014) 2026-04-10 15:46:11 +08:00
مصطفي محمود كمال الدين
8d459b218d
librz/bin: fix patching relocations for RISC-V ELFs
* fix unused return value in patch_relocs_riscv and unreachable code in extension parser
2026-02-26 12:17:03 +08: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
bubblepipe
7f57ae2c70
heap: refactor glibc heap parser (#5880) 2026-02-12 03:20:28 +08:00
bubblepipe
f28915f246
heap: refactor jemalloc 4.5.0 heap parser (#5800) 2026-01-19 23:45:20 +08:00
Giovanni
6926b6a65d
Rewrite C compiler code for rz-gg (#5761) 2026-01-10 13:36:51 +08:00
Rot127
b58e9a6a4a
ci: lsan - wrap git command into try block for debugging (#5595) 2025-12-16 00:08:44 +08:00
Rot127
2fa0c2c96f
Fix LSAN workflow when run outside of PR. (#5568) 2025-12-04 16:28:10 +00:00
Rot127
22099333e6
Add leak check in CI (#5553)
* Remove no longer supported option.

suggestion_mode was removed with 4.0:
https://pylint.readthedocs.io/en/latest/whatsnew/4/4.0/index.html5

* Add script to detect leaks in PRs.

The script fails if any of the changed lines appear in a leak stack trace produced by LSAN.
2025-12-04 11:02:01 +00:00
Rot127
a0b28bc574
Re-format Python files according to black v25. (#4921) 2025-02-22 03:01:14 +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
wargio
d6fc5845aa clang format files that previously were incorrectly excluded. 2024-03-07 18:38:49 +08:00
wargio
d47ceedbd3 Merge rz_asm and rz_analysis into one library but keep deprecated apis.
The tms320c64x has been merged into tms320.
2024-03-07 18:38:49 +08:00
Marcin Sobczyk
067c32ad18 Fix syscall preprocessing
'rizin' is missing a lot of syscalls for i.e. arm. We can check that
with:

 rizin -a x86_64 -b 64 -k linux -q -c asl

vs

 rizin -a arm -b 64 -k linux -q -c asl

'rz_syscall_item_new_from_string' splits the incoming string by commas
and expects at least 3 items as a result. This patch fixes
syscall preprocessing by appending empty strings to match the expected
number of items after a split.

This is a clone of a fix posted to radare2 [1].

[1] https://github.com/radareorg/radare2/pull/21508
2023-08-25 12:04:32 +08:00
Anton Kochkov
3278ec77d0
ci: use clang-format from LLVM 16 (#3696)
Co-authored-by: wargio <wargio@libero.it>
2023-08-01 09:11:26 +08:00
wargio
bc5eb09782 Removed rzbochs 2022-12-04 16:53:58 +01:00
Khairul Azhar Kasmiran
5eda15a45e Add librz/asm/arch/include/opcode/ to clang-format skiplist 2022-10-18 18:54:57 +08:00
Khairul Azhar Kasmiran
dc8cd44db4
gittip: Use subprocess.PIPE instead for Python 3.6 compatibility (#2873) 2022-08-06 21:21:07 +08:00
Khairul Azhar Kasmiran
2588aa8a1a
gittip: Use Meson's capture: true for Python 3.6 compatibility (#2869) 2022-08-04 22:37:58 +08: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
BraveBoii
782fcd5257 Updated sflib 2022-06-08 20:50:31 +08:00
Anton Kochkov
22131cbd43 Ignore jni.h for clang-format 2022-06-06 00:02:09 +08:00
Nicolas Jeker
cb9e96679e
Fix build with use_sys_tree_sitter (#2562) 2022-04-28 01:38:03 +08:00
Giovanni
5e09c02109
Remove eprintfs (part 1) and rz-bin -X (#2558)
* Removed eprintfs from librz/bin/bfile.c
* Removed rz_bin_package and rz-bin -X because untested and not implemented
* Removed eprintfs from librz/bin/bin.c
* Be verbose on clang-format and not on command execution
* Removed eprintfs from librz/bin/bobj.c
* Removed eprintfs from librz/bin/dwarf.c
* Removed eprintfs from librz/bin/format/coff/coff.c
* Removed eprintfs from librz/bin/format/dmp/dmp64.c
* Removed eprintfs from librz/bin/format/luac/luac_bin.c
* Removed eprintf from librz/bin/format/luac/luac_common.c and refactoring
* Removed eprintf from librz/bin/format/luac/v53/parse_53.c
* Removed eprintf from librz/bin/format/mach0/coresymbolication.c
* Removed eprintf from librz/bin/format/mach0/dyldcache.c
* Removed eprintf from librz/bin/format/luac/v54/parse_54.c
* Removed eprintf from librz/bin/format/mach0/dyldcache_rebase.c
* Removed eprintf from librz/bin/format/mach0/fatmach0.c
* Removed eprintf from librz/bin/format/mdmp/mdmp.c
* Removed eprintf from librz/bin/format/mz/mz.c
* Removed eprintf from nso/nxo bin format
* Removed eprintf from librz/bin/format/objc/mach0_classes.c
* Removed eprintf from librz/bin/format/omf/omf.c
* Removed eprintf & bprintf from librz/bin/format/pe/pe.c
* Removed eprintf from librz/bin/format/pe/pemixed.c
* Fixed luac test
2022-04-23 18:43:43 +02:00
Riccardo Schirone
3fd578ef7a build: use run_command(..., check: false) as return code is used
run_command(..., check: true) was introduced because of a breaking
change in newer meson versions
(https://github.com/mesonbuild/meson/issues/9300), however Rizin uses
the return code to see if the subproject is in the right state or not.

Revert back to check: false, so that meson will not fail and we can
detect the failure in our meson.build files.

Signed-off-by: Riccardo Schirone <sirmy15@gmail.com>
2022-03-29 16:53:15 +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
47e1cb8335
Provide CMake config files for CMake projects (#2057)
* Remove wrong librz.pc.in file
* Add plugindir variable to .pc files to allow easy plugin configuration
* Add CMake config files to find Rizin in CMake projects
* Add CI jobs to check cmake files
* Provide workaround for mesonbuild/meson#9702
* Use .lib suffix and no prefix on MSVC to make CMake files work
* Disable cmake files on static libraries build
2021-12-17 09:16:25 +00:00
Riccardo Schirone
24af48b6e4
Add dist script to remove .git folders from subprojects (#1998) 2021-12-16 11:37:13 +00:00
GustavoLCR
53a7694631
Add support for Windows on ARM (#1502)
* Support building for Windows on ARM

* Fix usage of reserved function name on ARM
* Fix architecture dependent `CONTEXT` fields access

* Fixes for debugging on Windows on ARM

* Fix breakpoint behavior on windows on ARM
* Fix register profile when debugging
* Remove `drx` error message if not supported
* Add support for hardware breakpoints
* Disable support for hardware single-stepping

* Fix Windows Message breakpoints on ARM

* Fix software single-stepping on return instruction on ARM

* Consider link register as destination for return instructions

* Fix setting debug bits to 16

* Rename `r12` to `ip` for windows arm register profile

* Remove debug bits hardcoding on windows

* Add 32bit registers to Windows ARM64 register profile

* Fix software step breakpoint alignment when entering thumb mode

* Define `RZ_TEST_ARCH` for `arm` and `arm64`

* Use `StackWalk64` API for backtracing on Windows

* Fix software single-stepping ARM in thumb mode

* Sync `asm.bits` with debugger

* Cleanup windows_debug.c

* Add SPDX for cross-arm64-windows.txt

* Add floating point control register flags

* Fix Windows Arm register profile alignment

* Keep `drx` warning
2021-11-24 20:13:42 +08:00
Giovanni
19bdac1502
Allow dirs within packagefiles (#1976) 2021-11-13 21:32:31 +01:00
Riccardo Schirone
86f6fec835
Add rzshell_which script to look for the handler of a rzshell cmd (#1839)
* remove isort linter on CI
2021-10-19 15:43:11 +02:00
Riccardo Schirone
9c05850d85 Fix python linter 2021-08-30 17:31:09 +02:00
Anton Kochkov
3c59df7e98
Refactor RzTypes to use structs instead of SDB + New Tree-Sitter based C Parser (#1047)
- Removed oldshell version of `t` (types) commands
- Removed `tk` command because types storage switched to the hashtable
- Added `tfc` command to show the calling convention of the function or set it
- Added `tsl` (RZ_OUTPUT_MODE_LONG) to show structure members' sizes and offsets
- Added `tul` (RZ_OUTPUT_MODE_LONG) to show union members' sizes
- Switched the types storage to the hashtable instead of SDB
- Added load and export from/to SDB for standard type libraries and serialization for Projects
- Changed all `char *type` occurences to the proper `RzType`
- Added `RzCallable` type for the function/class method types
- Changed all function types API to use the `RzCallable` API
- Switched the function types (`RzCallable`) storage to the hashtable instead of SDB
- Added a connection between `RzAnalysisFunction` and `RzCallable` - `rz_analysis_function_derive_type()` API function to derive new `RzCallable` type from the `RzAnalysisFunction` even if it doesn't exist in the RzTypeDB.
- Moved type links to the RzAnalysis where they belong
- Removed TCC and MPC-based parsers
- Added Tree-Sitter-based parser for C grammar (see `librz/type/parser/*`)
- Reworked type databases in `librz/analysis/d/` to be consistent with C standard, libc, platform-specific definitions
- Switched the type links from `char *` to `RzType`
- Switched the type links from SDB to the hashtable
- Added concept of the "type paths", e.g. `a.b[20].c` where `b` is a member of `a` (`a` is either structure or a union) and `c` is a member of `b`, and `b` is an array where we take 20-th element.
- Added concept of the typeclasses (a bit similar to Haskell) for numerical types: `None` (the most generic one), `Num` (includes `Integral` and `Floating`), `Integral` (includes `Signed Integral` and `Unsigned Integral`), `Floating`.
- Added concept of type equality (`rz_types_equal(a, b)` API function)
- Added Doxygen documentation to every API function in the `librz/type/*`.
- Updated the project format from **V2** to **V3**, added migration.
2021-07-20 01:46:45 +08:00
Riccardo Schirone
d6319c0d2c
Few SPDX info addition and REUSE lint to CI (#1274)
* Download missing MS-PL license
* Missing copyrights + some licenses
* Add REUSE linter to CI
* Python linter fixes on cmd_descs_generate.py
* Remove unused MPL-1.1 license
* Use with in check_meson_subproject.py script
2021-07-07 16:09:57 +08:00
JunWei Song
ba1dd1c5ed
Using with for resource-allocating operations ##refactor 2021-06-28 17:24:39 +08:00
Riccardo Schirone
f4304f17f4
Update rizin-shell-parser to tree-sitter 0.19.4 (#928) 2021-03-29 19:14:16 +02:00
Anton Kochkov
b633341344 Remove sdb_version.py as unused 2021-03-29 15:39:31 +08:00
Florian Märkl
820615969a
Make clang-format.py call clang-format just once (#801) 2021-03-09 23:31:58 +08:00
Riccardo Schirone
53bf5c497f SPDX Copyright text for all files based on history
- Add LICENSES directory
- Download additional licenses used
- Add .reuse directory
- Add doc about SPDX/reuse

Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-03-05 19:39:15 +08:00
Alexis Ehret
c21a0a624d Fix pylint errors sys/meson_git_wrapper.py 2021-02-15 10:24:46 +01:00
Alexis Ehret
8eae11ae4e Fix coding style python files (black, isort) 2021-02-15 10:24:46 +01:00
Riccardo Schirone
bac12fddc4 Improve sys/check_meson_subproject script
Check that local files for wrap-file and wrap-git are up-to-date with
the versions in subproject/package-files
2021-02-12 11:08:51 +08:00
Alexis Ehret
34f06489d3 Add short flags sys/clang-format.py 2021-02-08 21:44:10 +01:00
Alexis Ehret
49e1874b09 Add flag diff sys/clang-format.py 2021-02-08 21:44:10 +01:00
wargio
a7490e65a7 added -f/--file to clang format for simpler run. 2021-02-08 01:53:32 +01:00
Alexis Ehret
1e7604f325 Add check option to sys/clang-format.py 2021-02-04 07:19:19 -01: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