Commit graph

183 commits

Author SHA1 Message Date
Giovanni
8fba9b4189
Force usage of RzList methods instead of direct access of the fields (#4036) 2023-12-18 21:05:57 +08:00
Riccardo Schirone
08904d27cb build: fix compilation with meson 1.3.0 2023-12-01 23:32:17 +08:00
Anton Kochkov
bda5b2d0f3
Fix commmit hash for capstone-next (#3993) 2023-11-21 12:12:56 +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
Rot127
1018286648
[PPC/ARM] Update to Capstone v6/auto-sync (#3648)
ARM
- Updated ARM identifiers and API changes.
- Fixed shift amounts to be always decimal.
- Fixed incorrect usages of memory disponents.
- Fixed restoring of condition codes.
- Updated IDs for new ones.
- Fixed 8-byte stores.
- Added flag checking for MOV with shifts.
Capstone Integration
- Removed capstone-auto-sync subproject and replaced with next.
- Checked for NEON features.
- Used https://github.com/capstone-engine/capstone/pull/2122 for better system operand support.
- Distinguished between 32 and 64-bit cc checks.
- Checked for CS API version >5.
- Checked for CS_NEXT_VERSION instead of CS_API_MAJOR.
- Fixed VSTn and VLDn instructions to use corrected memory operands.
- Excluded multiple instruction aliases that are no longer valid IDs.
- Used CS_NEXT_VERSION as include guard.
- Added CS v6 include guards.
- Added CS v6 support to branch conditions for Rzil.
- Added more CSv6 guards.
PPC
- Fixed: Compare instructions do not use the branch predicate.
- Fixed conditional and CTR checks.
- Fixed MTSPR and MFSPR instructions.
- Excluded more branch aliases no longer present in v6 from switch cases.
- Fixed incorrectly assigned variables.
- Fixed condition checks for branches.
- Used ITE for condition checks, to prevent unnecessary reads of CTR or CR.
- Fixed rzil tests with new semantics using register 0.
- Updated include guards for Capstone versions to use CS_NEXT_VERSION.
- Initialized spr_name to prevent uninitialized use.
- Used mem.offset register for CSv6.
- Always used real operand details.
- Used mem operand for DCBZ.
- Fixed tests that are semantically identical.
- Handled LI LIS alias.
- Fixed rzil tests (with simplified semantics).
- Fixed branch alias with new cond test method.
- Handled clrl. alias.
- Handled SL/SR alias.
- Fixed conditional branches in ESIL.
- Fixed possible multiplication result overflow.
- Added RZ_NONNULL.
- Added 0 register.
- Handled LIS alias.
- Fixed: Print crX reg name in CS v6.
- Handled all general branch instructions into a single case statement.
- Fixed no semantic issues in tests.
- Added newly discovered calls.
- Moved direction check to inline function.
- Added link of root cause for broken test.
- Added QPX support.
- Set Capstone next branch to latest commit.
- Fixed uninitialized warning.
- Set CS next branch to newest commit.
2023-10-18 10:36:25 +08:00
Anton Kochkov
083bd4f2e7
Remove C++ compiler dependency for ZSTD (#3888) 2023-09-25 17:42:28 +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
Riccardo Schirone
9d68e9614f
Fix old math commands (#3828)
* core/cmd: Adjust math commands

* shell: make `?x` commands a parsing failure

We have moved the `?x` commands to `%x`, thus now no command should
start with `?`. This patch makes the parser fail to parse `?x`
strings.

* core/tui: use APIs in panels

* There's no `%q` anymore, use `%=`
2023-09-14 08:53:25 +08:00
Khairul Azhar Kasmiran
0c3b7339eb
Fix #3802: Enforce space after env (#3849) 2023-09-12 20:56:22 +08:00
Anton Kochkov
318a99bbad
Update rz-libdemangle (#3827) 2023-09-05 15:13:11 +08:00
Florian Märkl
c097bd7799 Fix zstd on OpenBSD/sparc64
Functions like MEM_read32 could still perform unaligned accesses on
OpenBSD/sparc64 with gcc, possibly related to gcc bug 51628. The
solution is to switch to a safe memcpy-based solution and let the
compiler do any optimizations.
2023-08-31 08:15:02 +08:00
billow
5999d3e824
DWARF support for load zlib and zstd compressed section (#3795) 2023-08-29 07:23:48 +08:00
ur4t
f0c932f2cf
subprojects/zlib: Improve meson.build, emulating configure script (#3759)
* subprojects/zlib: Improve meson.build, emulating configure script
* Update zlib to 1.3
2023-08-24 12:32:38 +08:00
Anton Kochkov
2cbe8fe0f0
Update capstone-v5 to 5.0.1 (#3777) 2023-08-23 16:00:11 +08:00
Florian Märkl
d8aeabb501
Fix blake3 build with incompatible assemblers (#3764)
Apple Clang 4.2 on Mac OS X 10.7 Lion does support avx2, but it has
issues with some of the asm syntax used, in particular jc and some mov
syntax.
So we add an additional check for a short assembly snippet.
2023-08-17 09:51:57 +08:00
Anton Kochkov
a4ec3563ca
Update rz-libdemangle (#3753) 2023-08-14 13:01:36 +08:00
Florian Märkl
22e56a3628
Fix blake3 build when a simd extension is missing (#3751)
Regression from avx512 fix: Any call to add_project_arguments() must
happen before declaring any build target.
2023-08-14 09:02:05 +08:00
Florian Märkl
14d607e7fd
Fix AVX512 detection and build in blake3 (#3739)
The test for avx512 could result in false-positives because the
_mm256_setr_epi64x intrinsic requires only AVX, not AVX512. Specifically what
is needed here is AVX512VL.
In addition, not passing the -mavx* args to the asm compilation failed the
build on macOS High Sierra and below (Apple LLVM version 10.0.0,
clang-1000.11.45.5)
2023-08-12 10:02:30 +02:00
Giovanni
4ffdf2766d
Bump libdemangle (#3743) 2023-08-10 21:51:52 +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
dd6c3a6437 Update Tree-Sitter C grammer 2023-07-23 19:04:05 +08:00
Anton Kochkov
07747e2ba8
Update rz-libdemangle (#3680) 2023-07-21 13:01:23 +08:00
Giovanni
8f2eb45b84
Add bin.demangle.flags to allow users to simplify or not mangled strings (#3659) 2023-07-17 23:31:09 +08:00
billow
e456c60e20 Fix tests for capstone v3/v4/v5
Co-authored-by: wargio <wargio@libero.it>
2023-07-16 13:22:47 +08:00
billow
6e57bf6261 Adding new cs-based tricore analysis and asm plugin 2023-07-16 13:22:47 +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
09ec12d607
Update libdemangle to 2c90eaa (#3614) 2023-06-29 13:53:22 +08:00
Giovanni
3ba4118615
Update blake3 commit (#3586) 2023-06-18 14:54:28 +08:00
Anton Kochkov
3f18c11609
Update capstone project URL (#3580)
Co-authored-by: yossizap <yossizap@gmail.com>
2023-06-16 15:33:44 +08:00
billow
6eb14128ad
Adding tricore support for rz_debug_plugin_gdb (#3557) 2023-06-06 12:53:51 +08:00
Giovanni
0efc031365
Bump libdemangle version (#3558) 2023-06-06 12:18:43 +08:00
wargio
c85b1afa4c Rewrite how bins are loaded into RzBinObject
This commit rewrites completely how RzBinPlugin are used to load info
into the RzBinObject structure.

Main changes are:
- Avoid looping multiple times to set the same data:
  now the data is cycled only once to rebase addresses, demangle strings
  and to make each loaded structure similar to each other.

- rz_bin_demangle is now demangling only strings:
  the old implementation was a hack over a hack to add classes & methods
  into the RzBinObject while demangling a string.
  This allowed methods and classes to be added to RzBinObject when for
  example invoking `is` or other printing commands.
  This was meant to be an "optimization" to avoid looping and doing
  things on-the-fly.

- Now the demangling is done after guessing the language used in the bin.
  This is done to avoid looping to various demanglers hoping that a
  string is going to be correctly demangled.
  After each string is demangled, the string is given to the language
  related function which adds classes, methods and fields into the
  RzBinObject fields.

- Swift handling is a special case, since the demangler can be disabled
  via -Duse_swift_demangler.
  The issue with the swift demangler is that is not correctly demangling
  strings and outputting swift code, but instead is creating something
  that sometimes works, sometimes doesn't.
  Also the old code only added fields and never methods for "reasons",
  and the new code just uses what the old code was doing as is.

- The new code also takes advantage of the language detection, which now
  happens before the demangling of symbols, imports and relocs.
2023-06-01 23:16:09 +08:00
wargio
cc08a23d03 Fix return types and args 2023-05-09 15:42:21 +08:00
Riccardo Schirone
29623e19a6 subprojects/libzip: patch zip_win32_file_operations 2023-05-09 09:31:56 +08:00
Riccardo Schirone
71c9a7f07b subprojects/xz: update to 5.4.3
Recently builds on Windows are failing due to intrin.h being required
for some functions. This has been fixed in the new 5.4.3 release.
2023-05-09 09:31:56 +08:00
Giovanni
9339ad128f
Bump rz-libdemangle version to fix windows build (#3490) 2023-04-26 22:19:36 +08:00
Giovanni
616c63e4cc
Bump libdemangle version (#3487) 2023-04-26 12:49:37 +08:00
Giovanni
29c1aa8187
Demangle rust and add classes/methods and bump lib version (#3481) 2023-04-24 23:55:50 +08:00
Giovanni
f115011642
Bump version of libdemangle to support Delphi C++ (#3472)
* Bump version of libdemangle to support Delphi C++
* Removed some WITH_GPL barriers.
2023-04-20 15:05:36 +08:00
Giovanni
7670834a9c
Update libmspack to v1.11 (#3468) 2023-04-18 17:23:18 +08:00
Siddharth Mishra
9ab709bc34
Improve cmd_help.yaml and fix random number generator (#3452)
* Improve cmd_help.yaml and fix a small bug
* Add support for 64bit random numbers
* Make a distinction between 32- and 64-bit PRNG
* Add documentation for new functions
* Change the RBTree test to use 32-bit random numbers
2023-04-07 20:22:01 +08:00
brightprogrammer
16e722cffc
Replace rz_core_cmd0 calls in tui/panels.c and port cmd_help commands to RzShell as cmd_math (#3421) 2023-03-30 18:36:48 +08:00
Giovanni
c7dfbbcdcd
Fix ar naming and io read/write api (#3419) 2023-03-10 06:21:39 +00:00
Giovanni
eb3f7f80c5
Fix archive file io plugin (#3417)
* Fix loading .lib/.a files
* Add windows lib test for ar:// uri
2023-03-10 08:13:26 +08:00
Giovanni
8d46a25203
Updated libmspack to latest commit (#3349)
Fixed url for lz4 dep
2023-02-05 13:23:02 +08:00
Anton Kochkov
8bd0d3356d Update xz (liblzma) to 5.4.1 2023-02-02 13:50:52 +08:00
Anton Kochkov
d765127a33 Update liblz4 to 1.9.4 2023-02-02 13:50:52 +08:00
Anton Kochkov
a68be33f38 Update zlib to 1.2.13 2023-02-02 13:50:52 +08:00
Anton Kochkov
0ffa5e3233 Update tree-sitter to 0.20.7 2023-01-31 19:06:55 +08:00
Riccardo Schirone
c4767cf1ac
Fix plugin removal and clean code (#3277)
* cmd: Fix summary of few "L" sub-commands
* util: start decluttering plugins handling

- Add Doxygen docs
- Remove unused API functions and make others internal only
- Use RzLibType enum for plugin type instead of int

* util: move dlopen/dlsym/dlclose to rz_sys
* util: make rz_lib_open/close return bool
* util: simplify rz_lib_add_handler and rz_lib_open*
* libs: implement rz_*_plugin_del to remove a plugin
* core: remove commands from RzCmd when removing plugins
* librz: call plugins 'fini' method when removing a plugin
* core/cmd: do not fail if the hashmap removal fails

When removing a group command, the inner command might have the same
name, thus it would result in trying to remove the same name twice.
Ignore it, as it is fine.

* librz: make RzCrypto plugins handling like the others
* librz/crypto: add rz_crypto_reset and use it
* librz: allocate the plugin structures before adding them
2023-01-16 13:32:46 +01:00