Commit graph

27061 commits

Author SHA1 Message Date
Anton Kochkov
9c18ea0dc6
Port ft commands to the rzshell (#2162) 2022-01-03 00:33:01 +08:00
Khairul Azhar Kasmiran
e0fe262360
Show error if no-arg macro is called with args (#2161) 2022-01-03 00:26:36 +08:00
Paul I
cdb4832cc8
Use analysis_get_function_in() wherever possible (#2157) 2022-01-01 11:54:17 +08:00
Pedro-Bernardo
4f9fe46b34
Fix optype-to-string conversion (#2158) 2022-01-01 01:35:29 +08:00
Giovanni
0ad92708d7
[RzIL] Fix shift, definitions and export (#2159) 2021-12-31 16:00:44 +01:00
Florian Märkl
e91f3a64d1 [RzIL] Various Renaming and Restructuring
rzil should be either rz_il when prefixed for Rizin API, or just il
whenever it's used in some local identifier/name.
In addition, the unclear notion of "vm_layer" has been removed. The VM
source files are split into management and evaluation instead.
2021-12-30 18:53:41 +01:00
Florian Märkl
7a8d5af180 [RzIL] Add rz_il_op_new_(unsigned|signed)() 2021-12-30 10:21:45 +01:00
Florian Märkl
97aba39cf3 [RzIL] Add rz_il_op_pure_dup()
This dups a pure opcode, in particular to be able to reuse a single
expression multiple times in lifting. For effects, we do not neet this
so far since those usually only appear a single time.
2021-12-30 10:21:45 +01:00
Paul I
f8d222e138
Convert ah commands to rzshell (#2130) 2021-12-30 12:44:51 +08:00
Riccardo Schirone
ae081043d9
Update rzshell.md (#2150) 2021-12-30 10:11:32 +08:00
Florian Märkl
86a7439519
Add IO/Map-based RzBuffer Implementation (#2147)
This adds an RzBuffer implementation that binds against RzIO's
rz_io_read_at/rz_io_write_at in order to access the mapped memory. This
is in contrast to the previous io RzBuffer, which has been renamed to
..._io_fd and which reads directly from a single file descriptor without
mapping.
To keep bf working, bin_bf now maps an area of zeroes because
otherwise the initial memory contents in RzIL would read as 0xff.
2021-12-29 10:28:55 +01:00
Florian Märkl
5d93ca3330
[RzIL] Flatten out all RzILOpArgs* structs (#2151)
This reduces heap usage and indirection.
2021-12-28 20:47:10 +00:00
Florian Märkl
aa80d2870f
[RzIL] Make cast work as in BAP (#2152) 2021-12-28 21:22:30 +01:00
Florian Märkl
f9a41796bf
Fix overlapped memcpy in sparse RzBuffer (#2148) 2021-12-28 17:51:38 +01:00
Florian Märkl
d556d57d3f [RzIL] Fix minor leaks 2021-12-28 13:37:54 +01:00
Florian Märkl
6a09385746 [RzIL] Remove vector-oplists in favor of seq
The root type of a lifted op is now simply a single RzILOpEffect, which
can be for example a chain of seq ops. This is in line with what BAP
uses.
For convenient creation of sequences, `rz_il_op_new_seqn(ut32 n, ...)`
is a drop-in replacement for `rz_il_make_oplist(ut32 n, ...)`.
2021-12-28 13:37:54 +01:00
Florian Märkl
20ed5b924f [RzIL] Remove unused ct_opcodes table 2021-12-28 13:37:54 +01:00
Paul I
5b11e88736
Fix several memleaks (#2143) 2021-12-27 18:19:34 +01:00
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