Commit graph

27043 commits

Author SHA1 Message Date
Paul I
6fca51c6cb
Convert afn commands to rzshell (#2139)
* Convert afn commands to rzshell
* Remove oldshell help for afn
2021-12-27 18:19:01 +01:00
Florian Märkl
78025648ea
[RzIL] Make RzILOp statically typed (#2140) 2021-12-27 00:13:24 +08:00
Florian Märkl
1a2afca338
Fix Double Free in Cs without a Bin File 2021-12-26 15:23:31 +08:00
Florian Märkl
06a6e6e148 Fix null-deref on failed g 2021-12-26 10:34:25 +08:00
Khairul Azhar Kasmiran
a906ce20d8
Use sys/rzshell_which.py instead in rzshell doc (#2138) 2021-12-25 20:52:44 +08:00
Anton Angelov
00fe25867b
Fix x86 disassembly issues related to MASM syntax (#2123) 2021-12-24 16:58:12 +01:00
Giovanni
5963da2bba
[RzIL] Add loadw/storew and bind memories against RzBuffer (#2105)
* [RzIL] Load/Store via RzIO and RzBuffer
* [RzIL] LoadW/StorWe via RzIO and RzBuffer
Co-authored-by: Florian Märkl <info@florianmaerkl.de>
2021-12-24 16:53:20 +01:00
Anton Kochkov
89d61756c1
Fix self-referential typedef format (#2134) 2021-12-24 00:53:36 +08:00
wargio
e80968f031 [FLIRT] verify the name is always unique. 2021-12-23 17:06:55 +01:00
wargio
d92a708541 [FLIRT] add info extraction 2021-12-23 17:06:55 +01:00
billow
c4f9df4b02
Expose the RzCore meta API (#2131) 2021-12-23 14:03:32 +08:00
Riccardo Schirone
6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00
wargio
5dafbf7e67 [core] aezv - modify variables in RzIL VM 2021-12-21 19:50:17 +01:00
wargio
869a36d55b [core] Add aezsu - RzIL step until addr 2021-12-21 19:50:17 +01:00
Florian Märkl
0e87fbd810 Split RzDebug.reg and RzAnalysis.reg
The two instances of RzReg were assigned to the same pointer in core.
This had several disadvantages, in particular:
* Both debug and analysis supply reg profiles, which might not be
  compatible. Which one was used in practice depended on which eval
  vars were set in which order.
* Emulation, in particular esil-based analysis, could leak into the
  debuggee.
Now they are fully independent.
2021-12-21 13:14:08 +01:00
Florian Märkl
9b60670013 Prepare various RzReg accesses for splitting
Common accesses for both debug and analysis must not use
debug->reg or analysis->reg, but go through rz_core_reg_default().
2021-12-21 13:14:08 +01:00
Florian Märkl
b6f09fb6ad Make as command ready for RzReg splitting
* rz_debug_arg_get/set moved to core as rz_core_arg_get
* Syscall (as) code refactored to always use rz_core_reg_default()
  instead of hardcoded debug
2021-12-21 13:14:08 +01:00
Florian Märkl
4541c6df2a Make Core ESIL register accesses point to Analysis 2021-12-21 13:14:08 +01:00
Florian Märkl
db25123a59 Remove RzDebug.creg and clean its usages
This was holding the name of a "current" register that was awkwardly set
during register printing, to then be used for setting in visual mode.
The features make sense, but it's too confusingly implemented to be
useful or stable.
2021-12-21 13:14:08 +01:00
Florian Märkl
b179a5f3c6 Refactor rz_debug_reg_get()/set()
* Logic for getting a register by role or name, whichever matches, moved
  to RzReg (rz_reg_get_by_role_or_name)
* Removed rz_debug_reg_err() because it's unnecessary
* Added rz_core_reg_getv_by_role_or_name() and
  rz_core_reg_aetv_by_role_or_name() to replace rz_debug_reg_get() for
  for usage whenever it is not debug-specific.
2021-12-21 13:14:08 +01:00
Florian Märkl
76eb7bf182 Refactor debug checks and flags from registers
* Added rz_core_is_debug() to check for debug mode instead of hard-coding "cfg.debug"
* rz_core_reg_default() uses the above to get the currently relevant RzReg
* rz_core_debug_regs2flags() -> rz_core_reg_update_flags() uses the above
  to update the flags.
2021-12-21 13:14:08 +01:00
Florian Märkl
affe8c89e1 Make fs+ trim whitespace of the arg
Previously, `fs+ myname` would use the flagspace " myname" with a
leading space. This made .arf inconsistent with setting regs-flags from
C and the syntax `fs+myname` would not be allowed in the future with
newshell anyway.
2021-12-21 13:14:08 +01:00
Florian Märkl
a7c076c56c Add basic tests for de (ESIL watchpoints) 2021-12-21 13:14:08 +01:00
Giovanni
84b226e895
[Core] Integration of Rizin SigDB in aaa and add aaF (#2120) 2021-12-20 23:47:32 +01:00
Florian Märkl
544905631c
[RzIL] Fix concept of Effects and Effect ops (#2109)
This brings our concept of effects in line with BAP and fixes issues
like values being evaluated prematurely in seq. The main point is that
ops themselves are the effects, rather than returning them to be
evaluated later.
2021-12-20 14:21:40 +00:00
Riccardo Schirone
c65509c1cd
Remove the wrong PACKAGE_INIT defined by meson and completely replace it (#2122)
Just remove the PACKAGE_INIT because broken and use our own definitions
of PACKAGE_PREFIX_DIR and set_and_check.
2021-12-20 21:55:24 +08:00
Florian Märkl
d7de2bd019
Fix +/- in visual cursor mode (#2118)
Syntax has changed: @! with space temporarily sets the blocksize.
Otherwise the entire block would always be changed.
2021-12-19 18:27:49 +01:00
Florian Märkl
c4ae1d45ce
Disable Codecov PR Commenting (#2117) 2021-12-19 13:42:41 +01:00
Giovanni
d6625126d5
[FLIRT] pac to pat (#2116) 2021-12-19 13:42:00 +01:00
Florian Märkl
17ef95aed8
Make rz_strbuf_slice() truncate on excessive len (#2115)
It is often useful to get a slice of some maximum len, also accepting
smaller results if the source is not large enough.
This also makes the function always operate on byte indices. Before,
it was inconsistently skipping ansi codes sometimes.
This also fixes potential oob writes in panels.c
2021-12-18 23:16:24 +01:00
Giovanni
bd7854d297
Fix multidex and open_many loading using proper base address (#2104) 2021-12-18 09:54:42 +01:00
Khairul Azhar Kasmiran
b1c3595c6b
newshell help: Remove brackets from list tail (#2114) 2021-12-18 09:54:10 +01:00
Riccardo Schirone
d8cd049652
Windows on non-x86 arch was still using non-existing RZ_BP defines (#2112) 2021-12-17 19:09:59 +01:00
Khairul Azhar Kasmiran
95106d3d9c
Make meson.build work again with meson 0.55.3 (#2113) 2021-12-17 22:01:21 +08:00
Riccardo Schirone
3bd639964e There must be a space after '@' 2021-12-17 13:39:18 +01:00
Giovanni
355d85961c
Allow to fail silently FLIRT and Analysis (#2110) 2021-12-17 11:56:40 +01:00
Riccardo Schirone
47e1cb8335
Provide CMake config files for CMake projects (#2057)
* Remove wrong librz.pc.in file
* Add plugindir variable to .pc files to allow easy plugin configuration
* Add CMake config files to find Rizin in CMake projects
* Add CI jobs to check cmake files
* Provide workaround for mesonbuild/meson#9702
* Use .lib suffix and no prefix on MSVC to make CMake files work
* Disable cmake files on static libraries build
2021-12-17 09:16:25 +00:00
Riccardo Schirone
9465cca0f5 Replace AES code with Nettle one which is LGPLv3
Code taken from https://git.lysator.liu.se/nettle/nettle and placed in
its own subproject.
2021-12-17 09:18:47 +01:00
Riccardo Schirone
27e135b5d5 Replace RSA-MD licenses-code for MD5 with LGPL one
Get the MD5 code from
https://github.com/FreeRADIUS/freeradius-server/blob/v1.1.x/src/lib/md5.c
which is LGPL and it has fewer integration problems with the other
licenses.
2021-12-17 09:18:47 +01:00
Riccardo Schirone
24af48b6e4
Add dist script to remove .git folders from subprojects (#1998) 2021-12-16 11:37:13 +00:00
David Carlier
fe3e1f47e8 debug: THP update possible system config paths. 2021-12-16 10:00:45 +01:00
Paul I
d2302facd6
Remove oldshell handlers from cmd_analysis.c (#2106)
* Remove oldshell handlers for `afb` commands
* Remove oldshell handlers for `afB` command
* Remove oldshell handlers for `afs` commands
* Remove oldshell handlers for `afu` command
* Remove oldshell handlers for `afx` commands
* Remove oldshell handlers for `afS` command
* Remove oldshell handlers for `afv` commands
* Add missing `afvb-*`/`afvr-*` and update tests
* Move <delete all> feature out from `analysis_function_vars_del()`
2021-12-16 11:18:40 +08:00
Giovanni
57f83bd657
[FLIRT] Create signatures from RzAnalysis data (#2036)
Add pac and sig creation with options & compression via commands and via new rz-sign
Add missing arch (arc, pic, riscv, spc700 xtensa, and more)

Side note:
on other tools public functions and references are generated in a sequential 
way besides the first one which is the first to be assigned.
since we do not search for sequential references, then we can avoid to
add extra public or referenced functions

Extra:
* Refactoring rz_analysis_mask definition
* Add rz_str_startswith_const and rz_list_iter_get_next_data
2021-12-15 19:08:16 +01:00
Khairul Azhar Kasmiran
298f92cf56
newshell help: Start arg numbering from 1 (#2107) 2021-12-15 23:53:04 +08:00
Dhruv Maroo
4cb187cf42
Add test to check whether DWARF attribute type is checked or not (#2103) 2021-12-14 20:19:30 +01:00
wargio
91d7309116 [RzIL] Add ule/sle handlers 2021-12-14 12:34:55 +01:00
wargio
06bf1ced69 [core] Add aez[isv] in newshell 2021-12-14 12:34:55 +01:00
wargio
8c2cb05af8 [RzIL] Add let, rewrite using RzPVector and various bugfixes 2021-12-14 12:34:55 +01:00
wargio
d288a24726 [RzIL] Refactor definitions and VM 2021-12-14 12:34:55 +01:00
Paul I
5914b79982
Convert afl/afi commands to rzhell (#2040)
* Convert afl/afi commands to rzhell
* Reuse code
* Update tests
2021-12-14 17:49:16 +08:00