Commit graph

327 commits

Author SHA1 Message Date
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
Aditya
b82eadc2e4
Add simple POST-command and changed upload path (remote) (#4106) 2024-01-17 15:17:36 +08:00
Khairul Azhar Kasmiran
036a712f35
Remove work dir change of rz-bindgen plugin test (#4022) 2023-12-05 22:03:28 +08:00
Riccardo Schirone
3ef81c0e12 ci: use default meson even in create-tarball 2023-12-01 23:32:17 +08:00
Riccardo Schirone
1311095ce9 Revert "ci: downgrade Meson to 1.2.3 (#3991)"
This reverts commit 6aeea82800.
2023-12-01 23:32:17 +08:00
Anton Kochkov
6aeea82800
ci: downgrade Meson to 1.2.3 (#3991) 2023-11-21 09:55:29 +08:00
billow
444000416c
Add debuginfod support (#3954)
* Add DEBUGINFOD_URLS support
* Add rz_bin_dwarf_from_debuginfod
* Fix rz_bin_dwarf_attr_addr
* Add test for debuginfod
* Filter empty RzBinDWARF
2023-11-06 23:41:42 +08:00
Anton Kochkov
539f8cb197 Fix macOS CI jobs 2023-11-05 19:10:14 +08:00
billow
9cd67098da
Update db/archos/linux-x64/dbg_dmh dmh allocated (#3956)
* Update `db/archos/linux-x64/dbg_dmh dmh allocated`
* Fix `scr.color` in rz_heap_glibc.h
2023-11-05 17:03:26 +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
19dbb57739 ci: switch to softprops/action-gh-release 2023-10-11 10:01:40 +02:00
Anton Kochkov
71679b0800
Fix CI build 2023-09-26 08:03:54 +08:00
Dhruv Maroo
714c338e0f
Remove designated array initializers in rz_analysis.h (#3876)
* Do not use designater array initializer because MSVC complains
* Add new Appveyor CI test for including C headers from C++ files

    * Need to test whether Rizin headers can be included in C++ when
      using MSVC, needed for Cutter to build successfully
    * Changed the name of `build-cpp` CI job in GitHUb jobs to
      `build-cpp-linux` to make it obvious that it only performs the
      test for Linux
2023-09-26 07:36:40 +08:00
Anton Kochkov
833c59c6eb
Pin Meson to 0.61.5 for old CentOS and Debian (#3887) 2023-09-25 20:29:43 +08:00
Anton Kochkov
ab23bb0bf8
issue template: hide warning message (#3886)
As many reporters do not remove it, make it a comment instead
2023-09-25 17:00:19 +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
Anton Kochkov
b30cd7fc83
Update TinyCC CI job (#3683) 2023-07-21 17:10:25 +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
Giovanni
b943e1d05f
Ensure the concurrency job group is unique (#3538) 2023-05-30 17:55:08 +08:00
Giovanni
f03e1d5114
Automatically cancel any previous workflow on new push. (#3510) 2023-05-20 13:10:50 +08:00
Riccardo Schirone
8d4c12cf9a Add CI job for testing EXTRA_PREFIX 2023-05-19 16:42:35 +02:00
Anton Kochkov
8ef2d9a6ad Fix Debian Stretch builds 2023-04-26 20:01:47 +08:00
Anton Kochkov
d2de771c3d Use meson setup <dir> instead of meson <dir> 2023-04-26 20:01:47 +08:00
Riccardo Schirone
beedbfc5a1 ci: use default llvm/clang for rz-bindgen task 2023-04-22 21:48:46 +08:00
Anton Kochkov
4c7408a15a Fix Debian Jessie builds 2023-03-27 00:21:26 +08:00
Riccardo Schirone
fb71f36859
doc: add release issue template (#3386) 2023-03-10 08:39:55 +00:00
ajakk
2f9ceb6367
CI: install system capstone dependencies (#3388)
Signed-off-by: John Helmert III <ajak@gentoo.org>
2023-02-21 08:16:39 +08:00
ajakk
2315646570
CI: fix system capstone meson flag (#3383)
Signed-off-by: John Helmert III <ajak@gentoo.org>
2023-02-20 06:52:02 +08:00
John Helmert III
cebd2f3200 CI: add build for building with system capstone
Signed-off-by: John Helmert III <ajak@gentoo.org>
2023-02-20 00:01:15 +08:00
Riccardo Schirone
497c2b2e05
Remove old bash-based rz-pm (#3360) 2023-02-07 18:26:38 +08:00
Riccardo Schirone
c61dd6f7c6
CI: env vars on windows work differently (#3354) 2023-02-06 13:19:54 +08:00
Anton Kochkov
438b56e166
Remove use of deprecated set-output in GHA (#3346) 2023-02-05 18:06:53 +08:00
rizan21
cc18d675e6 Use clang-format 15 instead of 14 2023-01-25 22:02:26 +08:00
Riccardo Schirone
30f4d77088
ci: add CI for rz-bindgen (#3285) 2023-01-17 07:02:15 +08:00
Anton Kochkov
8ec9529a09
Enable trivial-auto-var-init and unsigned-char GCC flags (#3232) 2022-12-17 15:27:15 +08:00
Khairul Azhar Kasmiran
85d41f5f34
Run debug tests on Ubuntu 20.04 (#3235) 2022-12-10 14:32:41 +08:00
Khairul Azhar Kasmiran
111e912b99
Drop container from gcc-11 ASAN build (#3234) 2022-12-08 09:29:10 +08:00
Khairul Azhar Kasmiran
ea858e6078
Upgrade rz-test CI to ubuntu-22.04 (#3066) 2022-12-04 13:20:12 +08:00
Anton Kochkov
b1f24d5cf3
Fix rz-pipe.go building on CI (#3185)
Co-authored-by: Khairul Azhar Kasmiran <kazarmy@gmail.com>
2022-12-02 20:48:17 +08:00
Khairul Azhar Kasmiran
25c1624f28
For gcc, use ${CC} when setting ASAN_LD_PRELOAD (#3217) 2022-12-01 23:43:42 +08:00