Commit graph

214 commits

Author SHA1 Message Date
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
Giovanni
55e690990b
Fix endianness for win pagedump and winkd (#3204) 2022-12-09 11:41:28 +01:00
wargio
bc5eb09782 Removed rzbochs 2022-12-04 16:53:58 +01:00
Anton Kochkov
33b2c6362e
Fix debugless build on E2K (Elbrus) platforms (#3165) 2022-11-06 21:08:09 +08:00
Giovanni
e453f8ba76
Use only x64 for optimizations and portable for x86 (#3135) 2022-10-27 15:14:03 +02:00
Giovanni
5168303b6d
Update blake3 to use cpu extensions (#3108) 2022-10-26 23:27:08 +02:00
Khairul Azhar Kasmiran
f3a4200c4e
Fix gcc12-asan mpc -Wformat-overflow= warnings (#3081) 2022-10-09 18:54:08 +08:00
Giovanni
5b1e5e6762
Support blake3 hash algo (#3030) 2022-09-17 18:38:21 +02:00
Dean
59b38e6efa
Add /*<type>*/ comments everywhere (#2986)
Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce
their existence and consistency

Also includes the following fixes made when adding the annotations:
* removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c
* removed unused classes argument from place_nodes in agraph.c
* removed unused recurse and recurse_bb functions in canalysis.c
* removed unused vars field from RzPrint struct
* removed unused RzAnalysisType* structs from rz_analysis.h
* removed unused list field from RzEgg struct
* fixed bug in bp_plugin.c where duplication-checking logic iterates over the wrong list
* removed unused q_regs field from RzDebug struct
* removed unused backtrace field from RzDebugPlugin struct
* removed unused classes_list field from RzBinNXOObj struct
* removed unused methods_list and classes_list fields from RzBinZimgObj struct
2022-09-11 13:04:53 +08:00
Giovanni
ade374378e
Add free-pascal demangling support (#3011)
* Add free-pascal demangling support
* Fixed tests
2022-09-06 10:39:58 +08:00
Khairul Azhar Kasmiran
f09d8e0ee4
Fix gcc12 rzgdb -Wuse-after-free warning (#3004) 2022-09-04 13:45:48 +08:00
Giovanni
3752e24b98
Update rz-libdemangle (#2984) 2022-08-27 02:35:07 +02:00
Riccardo Schirone
9ba89d8116 core/cmd: rewrite rz_cmd_macro API 2022-08-26 07:53:43 +08:00
Anton Kochkov
fe1af40ad2 Update libdemangle.wrap 2022-08-24 22:08:34 +08: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
Riccardo Schirone
efdafde7da Remove sdb.wrap file 2022-07-19 11:46:35 +02:00
Riccardo Schirone
6c665c6098 Use Rizin specific macros instead of the ones from SDB 2022-07-17 12:11:13 +02:00
Riccardo Schirone
0c9b295dd9
lzma: fix compilation on s390x (#2801) 2022-07-11 19:54:59 +08:00
Riccardo Schirone
3363579337 Update libzip to v1.9.2 2022-07-04 19:05:50 +08:00
Riccardo Schirone
98acbb041a build: use gnu99 globally instead of per-project 2022-07-04 19:05:50 +08:00
Riccardo Schirone
2f1e39818e Add liblzma subproject 2022-07-02 10:12:26 +02:00
Riccardo Schirone
2987e035da hash: use RzHash in most hash APIs 2022-06-28 21:55:26 +08:00
Riccardo Schirone
9ea7c2fa5a RzHash: rename everything in librz/hash to RzHash prefix 2022-06-28 21:55:26 +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
GustavoLCR
416f1650cd
Update libdemangle.wrap (#2735) 2022-06-24 13:18:19 +08:00
Riccardo Schirone
fdd7c6200c
Fix compilation on Termux and Haiku (#2671)
* build: fix compilation on Termux by using meson checks
* build: fix compilation on termux, which is recognized as linux

meson identifies termux as "linux" system, however pthread_sigmask is
not available there. Since pthread-fixes.c just defines
uv__pthread_sigmask we include it also in regular linux builds, because
the function is then used automatically instead of pthread_sigmask only
when __ANDROID__ is defined.

* subprojects/rzwinkd: define cc in meson.build before use
2022-06-07 23:44:41 +02:00
Riccardo Schirone
4664f791ac build: properly use #cmakedefine 2022-06-07 12:18:51 +02:00
GustavoLCR
3bc60f6800 WinKD: Add nullability/ownership markers to functions 2022-06-05 00:27:35 +08:00
GustavoLCR
ab498718c3 WinKD: Use ut* macros instead of uint_* types 2022-06-05 00:27:35 +08:00
GustavoLCR
f10e5d865a Debug: Allow dce in all platforms
* Used for `WinKD` and `Windows` debug
2022-06-05 00:27:35 +08:00
GustavoLCR
953ffb47fb WinKD: Switch to current process and thread 2022-06-05 00:27:35 +08:00
GustavoLCR
cd1f5469ab WinKD: Use kernel module address from version packet 2022-06-05 00:27:35 +08:00
GustavoLCR
811a9a2819 WinKD: Fixes for packet sending/receiving
* Ignore resent packets
* Resend packet if we didn't get an ACK
* Break if Ctrl-C is pressed
* Always wait for a state change packet in debug event wait function
2022-06-05 00:27:35 +08:00
GustavoLCR
e63faa6005 WinKD: Fix incomplete register write
* Fix register read size
2022-06-05 00:27:35 +08:00
GustavoLCR
4f3c4935af WinKD: Fix incomplete reads 2022-06-05 00:27:35 +08:00
GustavoLCR
dbed351f19 DMP/WinKD: Basic memory mapping info 2022-06-05 00:27:35 +08:00
Riccardo Schirone
24524f26b5 Update SDB to e1a015aa1f07169bb70a2260a1262230ffaa3f6a 2022-05-25 17:46:49 +02:00
Anton Kochkov
5aef0d8a98
Update libdemangle for MSVC fixes (#2556)
Co-authored-by: GustavoLCR <gugulcr@gmail.com>
2022-05-15 20:57:27 +08:00
GustavoLCR
43b9f6487a WinKD: Fix OOB write 2022-05-11 18:39:51 +08:00
GustavoLCR
d70e0b01ba WinKD: Fix kd connection through a pipe 2022-05-11 18:39:51 +08:00
Mario Haustein
52f6de18f0 Make capstone include path consistent 2022-05-10 11:10:04 +02:00
GustavoLCR
be498444ec WinKD/DMP: Add Windows 10 20H2 and 21H2 profiles 2022-05-10 10:22:49 +08:00
GustavoLCR
0cb346e39a WinKD: Only modify seq_id after receiving an acknowledgment packet 2022-05-10 10:22:49 +08:00
GustavoLCR
de1b2e8d50 WinKD: Timeout if amount of tries to get packet exceeeds limit 2022-05-10 10:22:49 +08:00
GustavoLCR
a19ac23ee8 WinKD: Verbose log if address is not mapped 2022-05-10 10:22:49 +08:00
GustavoLCR
a9ea591ade WinKD: Keep a cache of current thread context 2022-05-10 10:22:49 +08:00
GustavoLCR
3cabf34561 WinKD: Remove winkd_lock_tryenter()
* Use `winkd_lock_enter()` and make it possible to break it through `RzCons`
2022-05-10 10:22:49 +08:00
GustavoLCR
210f87573e WinKD: Use DBGKD_VERS_FLAG_PTR64 to identify 64-bit machines 2022-05-10 10:22:49 +08:00
GustavoLCR
4c95c19251 WinKD: Factor out some common code into a function 2022-05-10 10:22:49 +08:00
GustavoLCR
0296e87b26 WinKD: Save kernel module info from state change packet 2022-05-10 10:22:49 +08:00
GustavoLCR
b6a84d284c WinKD: Handle reset packet type 2022-05-10 10:22:49 +08:00
GustavoLCR
c7a6312af5 WinKD: Add verbose logging to winkd_wait_packet() 2022-05-10 10:22:49 +08:00
GustavoLCR
e9cffc0afa WinKD: Create profile dynamically if not found
* Download kernel module and PDB
* Load kernel PDB info
2022-05-10 10:22:49 +08:00
GustavoLCR
61235f02a0 WinKD: Fix pids/tids cache
* Fix double-free of name in debug modules list
2022-05-10 10:22:49 +08:00
GustavoLCR
10cfd66598 WinKD: Avoid unnecessary re-syncing 2022-05-10 10:22:49 +08:00
GustavoLCR
c2d36fa024 WinKD: Fix reading kernel module list 2022-05-10 10:22:49 +08:00
GustavoLCR
c2ab12b01f WinKD: Fix data race in kdnet backend 2022-05-10 10:22:49 +08:00
GustavoLCR
bb388edcd4 WinKD: Send acknowledge response for all packets 2022-05-10 10:22:49 +08:00
Nicolas Jeker
cb9e96679e
Fix build with use_sys_tree_sitter (#2562) 2022-04-28 01:38:03 +08:00
Anton Kochkov
0a309afbe9
Update zlib subproject to 1.2.12 2022-04-06 08:33:56 +08:00
Florian Märkl
09ac331a27
Update SDB for C++ compatibility (#2461)
Since 170ab3eb3b, `ht_pp.h` was included
before the full `sdb.h`, making the symbols mangled in C++ and thus
breaking Cutter by default.
This has been fixed in sdb now.
2022-03-28 12:59:42 +00:00
Riccardo Schirone
88b0872dca Update tree-sitter to 0.20 for rzshell and C parsers 2022-03-18 17:29:39 +01:00
GustavoLCR
d4e8c74450
Update SDB subproject (#2419) 2022-03-17 09:05:38 +08:00
GustavoLCR
170ab3eb3b
Remove windows.h include from rz_types.h (#2410)
* Create `rz_windows.h`
* Move `RzThread` structure definitions to internal header
* Create and use `rz_th_get_user()` API to avoid exposing `RzThread` layout in external header
* Make `rz_th_self()` an IPI
* Use `_wmkdir()` in `rz_sys_mkdir()` on Windows
* Remove unused `winkd_break_read` function
* Remove `RzIORap` definition from `rz_io.h`
* Remove include of `Windows.h` from `rz_types.h`
* Use `rz_windows.h` when necessary
* Remove `RzCoreRtrHost` definition from `rz_core.h`
* Remove `rz_socket.h` include from `rz_core.h`
2022-03-16 13:54:41 +01:00
GustavoLCR
dd81b6629a
Implement getting a backtrace from a Windows Kernel Dump for x64 (#2387)
* PE: Add header to mappings
* PE: Add temp defs for unknown `UNWIND_CODE_OPS`
* Core Bind: Add `RzCoreBinApplyInfo` binding
* DMP/WinKD: Always add kernel modules to mod list
* Implement Windows x64 SEH backtracing
* Fix `ompb` not prioritizing maps
* Optimize `rz_io_map_priorize()`
* DMP: Implement backtrace for x64
2022-03-15 10:45:02 +01:00
Peiwei Hu
babb7bf342
Remove command 0 (alias for s 0x...) 2022-03-09 22:10:13 +08:00
GustavoLCR
0129c3fa31 DMP/WinKD: Fix UTF16 decoding module name on Linux 2022-03-03 21:52:41 +08:00
GustavoLCR
c510827056 DMP/WinKD: Always include current thread/process 2022-03-03 21:52:41 +08:00
GustavoLCR
b634893cad DMP/WinKD: Read running status of threads 2022-03-03 21:52:41 +08:00
GustavoLCR
68a9966bc8 DMP/WinKD: Fix incorrect extra thread being listed 2022-03-03 21:52:41 +08:00