Commit graph

366 commits

Author SHA1 Message Date
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
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
Khairul Azhar Kasmiran
9721f4f8c6
Set checks_level=0 on linux-meson-clang-tests build (#5144) 2025-05-11 18:16:11 +08:00
Khairul Azhar Kasmiran
d53c920bc5
Set checks_level=3 on codecov build (#5143) 2025-05-11 13:58:21 +08:00
Khairul Azhar Kasmiran
b8338ee670
Include fuzz tests in Codecov (#5140) 2025-05-08 22:47:59 +08:00
NOT XVilka
da77e0cb39
build: enable GNU C99 extension by default (#5099)
Co-authored-by: Anton Kochkov <anton.kochkov@gmail.com>
2025-04-25 02:26:58 +08:00
Giovanni
a069abb49c
Fix jsdec transition to proper plugin (#5098) 2025-04-23 11:33:25 +08:00
Rot127
5088a46c96
Add missing matrix.enabled check. (#5066) 2025-04-05 14:26:32 +08:00
Rot127
f1713ac354
Use Codecov action to upload coverage data every PR. (#5057)
* Enable CodeCov actions in the CI for every PR.

* Just disable all parsing errors, since we seem to hit plenty.
2025-04-03 14:41:56 +00:00
Anton Kochkov
28a706442a ci: allow running Coverity manually 2025-03-19 22:40:47 +04:00
Khairul Azhar Kasmiran
dcaf7b94d9
asan ci: Show ODR violations (#5010)
* asan ci: Show ODR violations
* Add `static const` to rzwinkd profiles
2025-03-18 22:51:57 +08:00
Khairul Azhar Kasmiran
782eee1a8f
ci: Use --print-errorlogs with meson test (#5006) 2025-03-17 22:43:43 +08:00
Khairul Azhar Kasmiran
d3f7ef2aa9
ci: Upgrade to Ubuntu 24.04 (Noble) (#4989)
* ci: Upgrade to Ubuntu 24.04 (Noble)
* Install clang-format-16 directly from the Noble repo
* Remove redundant gcc 11 ASAN build
* Count `dm` map items more granularly in `dbg_maps` test
* Grep only for exception symbols in `dbg_dmi` test
* Add workaround for `dbg_maps` test
* Mask out different digits in `dbg_dmh` test
* Add workarounds for sprintf false positives
* For now, use `-fno-sanitize=function` with clang asan build
2025-03-14 03:13:15 +08:00
Rot127
710a33b6ef String/Hex-Search 5/9: Move search commands to RzShell handler.
The commit moves the new and legacy search commands to RzShell,
adds more details to the search help,
deletes some undocumented or unnecessary commands and adds the stubs for
the new search handler implementions.

Legacy commands still do their string parsing on arguments and are not touched.
The new searches (string and bytes) ahve their actual implementation in the following commmits.

Renamed and replaced commands:

- Renamed '/'  -> '/z'
- Replaced '/e' -> '/z' or '/xr'
- Replaced '/w' - All Unicode is searched now properly with '/z'.

Removed commands:

- '/!' - Because the command modifiers are not properly handled in RzShell yet and the advantage of this one is dubious.
- '/f' - Modifiers are obsolete, because search is dispatched into threads.
- '/b' - Modifiers are obsolete, because search is dispatched into threads.
- '/+' - Because no idea what it does. Seems not particular useful.

Part 5/9. Likely won't build in between parts.

Co-authored-by: wargio <deroad@kumo.xn--q9jyb4c>
2025-02-22 04:12:49 +08:00
Rot127
29e25fd895 String/Hex-Search 2/9: Improve Unicode support.
This commit adds several improvements, updates and fixes to Unicode related logic.

- Update Unicode tables to version 16.
- Escaped strings now escape valid Unicode code points to /Uhhhhhh and invalid code points to /xhh.
- Generally applies RzStrEscOptions way more consistently. The legacy escape is still used at some places though.
- Fix inconsistencies in Unicode decoders/encoders and checkers. They now either return 0 on an invalid decode or the number of bytes the code point requires.
- Add many unit tests for Unicode related logic.
- Add helpers to check code points.

Part 2/9. Likely won't build in between parts.

Co-authored-by: wargio <deroad@kumo.xn--q9jyb4c>
2025-02-22 04:12:49 +08:00
Rot127
8d391b7b38
Bump Capstone v6 to Alpha3 (#4867) 2025-01-29 11:22:29 +08:00
Rot127
d5e86a03a2
Request higher code standards for API changes. (#4859) 2025-01-24 05:34:43 +00:00
Khairul Azhar Kasmiran
ae0aa42125
ci: Put ASAN CFLAGS in one place (#4833) 2025-01-11 21:09:59 +08:00
Anton Kochkov
100f20194a ci: use dev or stable rz-bindgen branches 2024-12-19 21:49:52 +08:00
Khairul Azhar Kasmiran
3556a7ea04
Remove -Wno-deprecated-non-prototype from macos build (#4728) 2024-11-22 21:28:16 +08:00
Khairul Azhar Kasmiran
381ff80b59
ci: Remove -Wno-cpp (#4721) 2024-11-17 13:59:38 +08:00
amibranch
70654e80f6
build: Fix meson-build global_arguments (#4698)
* Added a CI-task to check if rizin could be used as subproject
* Fixed some new global-arguments in meson-build

Co-authored-by: amibranch <amibranch@users.noreply.github.com>
2024-11-11 19:07:34 +08:00
Anton Kochkov
f1e555901f
ci: use muon-bootstrap name for bootstrap (#4700) 2024-11-04 13:17:03 +08:00
Rot127
86d8953912
librz/arch: use proper capstone enum names. (#4691)
* Use pre-v5 enum names which are now supported by compatibility macros.
* Bump CS version to newest next
* Remove Capstone v6 job until v6 patch release is out.
* Check for support of enum compare/conversion warnings.
2024-10-29 17:11:34 +08:00
Khairul Azhar Kasmiran
7d63546451
mac ci: Make PATH invariant to installed Python version (#4689) 2024-10-26 00:05:51 +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
2fafb3dbe5
ci: add Python 3.13 for macOS builders (#4688) 2024-10-25 00:05:04 +08:00
Khairul Azhar Kasmiran
2e831b278f
mac ci: Drop pkg-config install step (#4685) 2024-10-23 23:29:39 +08:00
Khairul Azhar Kasmiran
f641480afa
ci: Reinstate macos-meson-clang-tests build on macos-13 (#4682)
* Revert "Upgrade build-osx-pkg build to macos-14 (#4677)"
* Revert "ci: Remove macos-12 build (#4676)"
* Upgrade macos builds to macos-13
* Add fetch-depth: 2 to build-osx-pkg build
* Add -Wno-deprecated-non-prototype flag to `macos-meson-clang-tests` build
2024-10-23 17:32:51 +08:00
Khairul Azhar Kasmiran
1a8b3c632e
Upgrade build-osx-pkg build to macos-14 (#4677)
* Upgrade build-osx-pkg build to macos-14
* Update test-osx-pkg build to macos-14
2024-10-19 18:01:54 +08:00
Khairul Azhar Kasmiran
f2a6d2a56c
ci: Remove macos-12 build (#4676) 2024-10-17 21:32:36 +08:00
Khairul Azhar Kasmiran
07d70e9dc6
Install rzpipe in "Run debug tests on Ubuntu 20.04" build (#4668) 2024-10-14 10:52:08 +08:00
Khairul Azhar Kasmiran
5f3f68b483
macos ci: Use hw.activecpu instead of hw.ncpu (#4660) 2024-10-03 20:06:23 +08:00
Khairul Azhar Kasmiran
4ba246aafd
ci: limit macOS test threads to hw.ncpu (#4658) 2024-10-03 17:20:08 +08:00
wargio
a29c2c3e7c Run memhungry fuzzed binaries in one thread. 2024-09-13 12:20:39 +08:00
wargio
15f97e3e0c Compile jsdec in EXTRA_PREFIX with the correct branch
aaaa
2024-09-04 21:16:17 +08:00
Anton Kochkov
7ef842f813 ci: use new CentOS 7 mirror URL 2024-08-15 20:43:59 +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
1228d4dc58
Add all supported architectures to the labeler (#4381)
* Add labeling for all missing architectures
2024-03-25 19:07:42 +08:00
Rot127
fb6efca4b5
[Hexagon] RzIL uplifiting (#3837)
Uplift Hexagon architecture to RzIL

The general structure is, that every (sub-)instruction has a getter for it's RzIL code.
Calling the getter will return the RzIL operation.
If RzIL for an instruction is requested, the plugin makes a decision. Because Hexagon only executes whole instruction packets. If the instruction is not the last instruction in a packet, it will simply return `EMPTY()`. If the RzIL for the last instruction in a packet is requested, it will get the RzIL operations for all instructions in the packet, shuffles them into the correct execution order (according to some rules) and returns the complete operation for the packet.

The RzIL code was entirely generated with the [rzil-compiler](https://github.com/Rot127/rzil-compiler/), using the semantic definition of the [QEMU Hexagon module](https://github.com/qemu/qemu/tree/master/target/hexagon).

Currently successful compile instructions (and tested):
```
[*] 1581/1733 standard instructions compiled.
[*] 431/643 HVX instructions compiled.
[*] In total: 2012/2376 instructions compiled.
```

It was tested with:
- (Semantic tests) `rz-tracetest` against the execution trace of the QEMU Hexagon test binaries.
- (Bug free and semi-semtantic test) Adding tests which simply execute the test binaries to ensure leak and segfault free execution. Also it is executed until a certain instruction is reached (end of `main` or `loc.pass` symbol), partially testing it executes correctly.

For the uplifting several changes and modernization had to be made:

- Enhance consistency of decoding
  - Allow to disassemble an instruction without copying the result. This is used if the given buffer of instruction bytes is larger than one instruction width. In this case, as many instructions as the buffer can hold are disassembled and buffered for later.
  - Generally enhance buffering of instructions.
  - Allow to mark a packet as valid before it is completely decoded (in case we know it must be valid, e.g. if it is a jump target of a valid packet).
- Fix (hopefully) all memory leaks of the Hexagon plugin.
- Changes to register getters, because RzIL needs finer control to translate alias or explicit register names to their real register.
  - Getter for register name is now done by table, so for future distinction between DSP version we can just select another table.
  - Translation functions from register alias or explicit name to their real register.
  - Each operand contains now it's variable ID (e.g. `d` for register `Rd`) as in the ISA (for mapping in the RzIL code).
- Ease debugging by tracking in more precision, if an instruction is added to a stale, active or new packet.
- Add registers `C20` - `C29` (not yet present in LLVM)
- Some renaming to make the code more readable.
2024-03-22 07:24:56 +00:00
Rot127
c78eff25a3
Work around for https://github.com/google/sanitizers/issues/1716 (#4362)
The Thread Sanitizer of ASAN doesn't seem to support
randomized offsets from the VMA base address (`vm.mmap_rnd_bits`)
if they are larger than 28 bits.

This leads to ASAN compiled binaries to crash or endless loop
with a `AddressSanitizer:DEADLYSIGNAL` before main is reached.

Reference issues:
https://github.com/google/sanitizers/issues/1716
https://github.com/google/sanitizers/issues/1724
2024-03-16 13:45:51 +08:00
billow
30eef53291 dwarf: refactor
- Remove dwarf's dependency on RzBuffer

- Delete `cdwarf.c` and move dwarfdump (`id`) related functions to their respective modules

- Improved output of dwarfdump (`id`)

- add more DW_AT*

- fix escape

- fix debuglink

- remove cache in RzBinDwarfStr

- replace `rz_bin_dwarf_rnglists_parse_at` with `rz_bin_dwarf_rnglists_get`

- remove rz_bin_dwarf_loclists_parse_at

- fix logging

- cache all escaped strings
2024-03-09 09:41:13 +08:00
wargio
05ab831b9a Fix codeowners and labeler 2024-03-08 12:33:07 +08:00
wargio
0de960d891 Ignore python R1737
This ignores warning 'yield from' directly instead of yielding
each element one by one (use-yield-from)
2024-03-07 18:38:49 +08:00
Giovanni
411e6fd09f
Fix jsdec build (#4264) 2024-02-19 09:10:30 +08:00
Giovanni
3fd3db406e
Update github actions to remove warnings (#4211) 2024-02-12 16:32:19 +08:00
byteninjaa0
8cfd11b104
Update tools help and man pages (#4145)
* Update man pages
* Update help messages
2024-02-01 00:24:38 +08:00
Anton Kochkov
046918075e
Use git depth 1 for Meson subprojects (#4138)
* Use git depth 1 for Meson subprojects
* Disable git depth on Debian CI
2024-01-22 21:14:32 +08:00
Anton Kochkov
fc4dfbf9da Fix CentOS and Alpine CI jobs 2024-01-21 07:15:41 +08:00