Commit graph

28596 commits

Author SHA1 Message Date
Quentin Minster
b82215965e
Refactor pointer write command * to use the API (#3793)
* Add tests for pointer write command `*`

Some test cases override `asm.arch` for bitness compatibility reasons.

* Refactor pointer write command `*` to use the API

* Allow use of more general exprs as value for pointer write command `*` ##shell

* Instead of detecting when to write a value, and write a hexpair
  otherwise, do the inverse: detect when to write a hexpair, and write a
  value otherwise. This allows more general value exprs such as
  variables, derefs, ...

* To enable this, add an option to `rz_hex_str_is_valid` so it can
  reject a 0x-prefixed string (because 0x-prefixed strings should be
  handled as values, not hexpairs, by the pointer write command)

* Add a test case to ensure a non-0x-prefixed value arg, that's not a
  valid hexpair, now gets eval'ed as an expr by the pointer write
  command (where previously it would throw an error)
2023-08-26 23:40:31 +08:00
billow
0c1690a7fb
Fix docker build (#3792)
Fix "non-trivial designated initializers"
Fix "invalid conversion"
2023-08-26 16:25:36 +08:00
Khairul Azhar Kasmiran
40b67c2f6d
Fix cmd_pointer test on Travis (#3791) 2023-08-26 14:13:21 +08:00
Quentin Minster
eb78e75cd4
Refactor the pointer command to use the API (#3788)
* Add test for pointer read command `*`

Test for `asm.bits=8` uses `asm.arch=6502` because `asm.bits=8` is
unsupported for the default arch.

* Fix pointer command `*` broken since move from `?` to `%` ##shell

* Refactor to use appropriate existing API in `num_callback`
2023-08-26 02:12:47 +00:00
sohail1734
cafebbf9c3
Actualize rizin and rz-diff man pages 2023-08-26 09:38:18 +08:00
billow
8e29b959b8 DWARF improve DWARF5 support and refactor
- `RZ_PROJECT_VERSION` 14
- Add `RzCallable`.has_unspecified_parameters
- Add `RzAnalysis`.debug_info
- Add `RzAnalysisVarStorageType` composite and `eval` `pending`
- Support for parse DWARF section "debug_loclists", "debug_ranges", "debug_rnglists"
- Partial support for eval DWARF expr_loc
- Support for anonymous Type, function variable, struct member
- Cache all DWARF information in `RzAnalysisDebugInfo` and remove `SDB` based caching.
- Add arm32, arm64, TriCore DWARF register name
- Fix same name basetype
2023-08-25 23:32:05 +08:00
billow
908c2adc54 RzUtil add new API
- rz_bits_leading_zeros
- rz_json_eq
- rz_json_string_eq
- RZ_STR_EQ
- RZ_STR_NE
- rz_vector_clone_into
- sdb_diff_eq
2023-08-25 23:32:05 +08:00
billow
ec2cff8451 RzType add new APIs
- rz_base_type_clone_into
- rz_base_type_clone
2023-08-25 23:32:05 +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
Marcin Sobczyk
7a3da1691c Remove duplicate entries from 'linux-arm-64.sdb.txt'
This is a cherry pick of [1]. The removed mappings overwrite previous
entries and cannot be found in [2].

[1] c67c47ed73
[2] https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/unistd.h

Signed-off-by: Marcin Sobczyk <msobczyk@redhat.com>
2023-08-25 12:04:32 +08:00
Peiwei Hu
a5780a3855
Refactor imports-related stuff from RzList to RzPVector (#3781)
+ Switch the member imports in RzBinPlugin from RzList to RzPVector
+ Also switch the member imports in RzBinObject from RzList to RzPVector to meet the refactor of RzBinPlugin
+ Modify the traverse and invocation related to the aforementioned changes
+ Remove the deprecated API rz_bin_get_imports
2023-08-24 16:14:32 +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
Pavel I
762feed1b6
Fix several memleaks (#3779)
* Fix memleak in rz_il_handler_empty()

* Fix memleak in compare_op()

* Fix memleak in assign_reg()

* Fix memleak in rz_asm_op_fini()

* Fix memleak in rz_core_analysis_bytes()

* Fix memleak in add_sub_op()

* Fix memleak in bitwise_op()

* Fix memleak in shift_and_rotate()
2023-08-24 07:53:33 +08:00
Anton Kochkov
2cbe8fe0f0
Update capstone-v5 to 5.0.1 (#3777) 2023-08-23 16:00:11 +08:00
Peiwei Hu
9ae479c22a
Update the clang-format version in DEVELOPERS.md (#3776) 2023-08-23 10:19:26 +08:00
Peiwei Hu
03dd2d222a
Fold same-typed variables if there are more than 3 (#3770) 2023-08-20 02:38:55 +08:00
Riccardo Schirone
a91169e951
Add '%$' command to deal with rizin variables (#3774) 2023-08-19 09:19:56 +08:00
Giovanni
ac389d95dd
Unify crypto plugin api to match all the other plugins. (#3773) 2023-08-18 23:25:41 +08:00
Peiwei Hu
8b792f5a81
Fix: overflow of core->block in the handler of plf command (#3762) 2023-08-18 10:01:41 +08:00
Giovanni
305a2cb3ae
Add SM3 hash (#3769) 2023-08-17 21:59:06 +08:00
Anton Kochkov
2c9b0d86a5
visual: mention o key in help (#3757) 2023-08-17 20:29:53 +08:00
Anton Kochkov
e26ae5f63c
visual: remove prc=a mode (#3758) 2023-08-17 16:04:38 +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
Pavel I
061c56f4c4 RzStrBuf: remove weakref related code 2023-08-15 09:00:22 +08:00
Pavel I
ee1f1a4332 Fix memleak in rz_assembly_of_hex_handler() 2023-08-14 13:08:22 +08:00
Pavel I
6c20796600 Fix memleak in parse_relocs_from_indirect_syms() 2023-08-14 13:08:22 +08:00
Pavel I
73fcbd801d Fix memleak in parse_reg_profile_str() 2023-08-14 13:08:22 +08:00
Pavel I
779c5b2566 Fix memleak in rz_reg_item_free() 2023-08-14 13:08:22 +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
Anton Kochkov
dc9b57166d util: remove rz_num_get_name() 2023-08-11 19:00:56 +08:00
Anton Kochkov
f6f397e704 util: remove rz_num_chs() 2023-08-11 19:00:56 +08:00
Anton Kochkov
67519c1664 util: remove unused RzNum API 2023-08-11 19:00:56 +08:00
Anton Kochkov
1a06b2d585 util: remove rz_num_{sin,cos}() 2023-08-11 19:00:56 +08:00
Anton Kochkov
3b3de3b66c util: remove dead RzNum code 2023-08-11 19:00:56 +08:00
blarn
e3617f7981
Expand pc commands to accept size argument (#3738) 2023-08-10 22:55:25 +08:00
Giovanni
4ffdf2766d
Bump libdemangle (#3743) 2023-08-10 21:51:52 +08:00
Riccardo Schirone
9654cae0fb
doc: 'meson setup' is the recommended way now (#3745) 2023-08-10 20:06:51 +08:00
Riccardo Schirone
3dce9c0563
util, cmd: fix rz_rand64 and %r (#3742) 2023-08-10 18:06:52 +08:00
billow
28ad8e943d
Fix Tricore disassembly performance (#3729)
* Try fix Tricore slow disassembly
* Fix tricore_op_set_type
2023-08-10 11:48:49 +08:00
Pavel I
0a623e1589
Fix memleak in ds_opstr_try_colorize() (#3741) 2023-08-10 10:16:17 +08:00
Mikael Berthe
b9281cbc9c
Fix arrow keys on some terminals (#3718)
* Add support for arrow keys on some terminals

Some terminals use the sequences \EO{A,B,C,D} for the arrow keys
(e.g. xterm, tmux, screen).

* Remove cursor move on Ctrl-l

^L clears the screen as expected, but the cursor is moved and it is
probably not intended.
2023-08-09 20:44:01 +08:00
ifyGecko
278607aabf
Update le.c (#3734)
free'ng the header is covered by fail_cleanup label
2023-08-09 10:41:56 +08:00
Peiwei Hu
d71f4a2128
Add new command plf to print the RzIL of the function (#3724)
+ expose API rz_core_analysis_bytes_il
+ add new command `plf`
+ add test test/db/cmd/cmd_plf
2023-08-05 22:27:54 +08:00
Anton Kochkov
7febd38e9d
Bump version to v0.7.0 (#3725) 2023-08-04 17:14:15 +08:00
billow
48b0880562
Fix tricore jumps/calls syntax #3664 (#3708)
* Fix tricore jump address set
* Fix tricore sub jumps
* Add TRICORE asm pattern
2023-08-04 10:44:07 +08:00
Rot127
cebe0b5081 Add test for custom bf coloring. 2023-08-04 08:18:51 +08:00
Rot127
dd696b4c4a Add missing in/out mnemonics to token pattern 2023-08-04 08:18:51 +08:00
Rot127
10973de1d3 Compile all pattern at once if it wasn't done before. 2023-08-04 08:18:51 +08:00