Entire files are now avoided to be built by checking in meson rather
than using #if DEBUGGER. This now also includes bsd_debug.c, which
is currently slightly broken on OpenBSD/sparc64 and caused compile
errors even with -Ddebugger=false.
* Removed eprintf from librz/bin/format/pyc/marshal.c
* Removed eprintf from librz/bin/format/pyc/pyc_magic.c
* Removed eprintf from librz/bin/format/te/te.c
* Removed eprintf from librz/bin/format/wasm/wasm.c
* Removed eprintf from librz/bin/format/xnu/rz_cf_dict.c
* Removed eprintf from librz/bin/p/bin_bf.c
* Removed eprintf from librz/bin/p/bin_cgc.c
* Removed eprintf from librz/bin/p/bin_elf.inc
* Removed eprintf from librz/bin/p/bin_luac.c
* Removed eprintf from librz/bin/p/bin_mach0.c
* Removed eprintf from librz/bin/p/bin_mdmp.c
* Removed eprintf from librz/bin/p/bin_menuet.c
* Removed eprintf from librz/bin/p/bin_nes.c
* Removed eprintf from librz/bin/p/bin_pe.c
* Removed eprintf from librz/bin/p/bin_pebble.c
* Removed eprintf from librz/bin/p/bin_psxexe.c
* Removed eprintf from librz/bin/p/bin_sfc.c
* pd + pda[jJqi=]
* Added pdb/pdC/pdf/pdk/pdl/pdp/pdr and removed pdi in favour of pdq
* removed pdx since is an alias for 2 other commands.
* Added pdR and pds[fb]
* Added example and fixed bug when cw
* Removed pdx test file since it is the same as cmd_pix
Although the reg profile was not really used yet it will be relevant for the RZIL uplifting.
Introduces:
* Double/quadruple registers now properly overlap with their counterparts.
* Registers have correct types assigned (vec, ctr, sys etc. Before, all regs were of type gbr)
* Consistent register names (asm name style: c3:2, r31 etc, alias style: lc1:sa1, lr etc.)
* Adds _tmp registers in the profile. Later used by uplifted instructions (think of .new registers).
* Add function to add config node to config by `RzConfigNode*`
* Move `SET<NODE>` macros to `rz_config.h`
* Add un/set functions for plugin specific configs.
* Add RzConfig and node setter to hexagon plugin.
* Use plugins RzConfig to determine sdk syntax setting.
* Use plugins RzConfig to determine if numbers should be signed.
* Use plugins RzConfig to determine if immediate hash should be printed.
* Remove unused parameter `rz_asm`.
* Remove unused variable.
* Remove unused callback.
* Remove unused flags from `RzAsm`
* Fix asm tests: Add NULL check; Set correct sign in asm test.
This has the same meaning as rz_analysis_get_address_bits(), i.e. the
size of an address, which is often, but not always the same as the
"asm.bits" bitness, especiall in thumb where it has to be 32, rather
than 16. This fixes pointer size calculation for such cases.
Fix#1835
* Remove `cb_printf()` from RzBin
* Removed `bin.rawstr` from `rz-bin`
* Dropping `izzz` since does the same as `izz`
* Fix PE one section executables
* Fix behaviour of BFLT, LE, and SMD bin plugins
* Added rz_lang_byte_array and removed rz_print_code + refactoring cmds
* Added test for big endian
* Removed vlang and sync oldshell with newshell cmd changes
* Fixed in a more portable way conversion on signed byte for Java/Kotlin
* Resolved comments and added examples to help users
Due to some commands/tests still using the legacy "..." commands, we
can't fully remove oldshell code yet, but with this patch we just hide
it from the end users. Rzshell is now the default and only shell and
rzshell autocompletion is the default and only autocompletion engine.
* `!!`: Fix extra `\r` on Windows
* Use more efficient algorithm
* "Fix" cmd_pipe test
* "Fix" shared_memory.py
* Move feat_redirect test to archos/not-windows-any
There may be multiple maps containing the current seek. This indicates
only the highest-priority one, which is also the one whose data is
visible at the seek address.
* Moved rz_print_2bpp_* under rz_core
* Moved rz_print_string to rz_str_stringify_raw_buffer
* Added test for print urlencode and added pu0
* Removed RzCoreString and implemented utf32be/utf16be
So far all the help sections were statically generated from the YAML
files, however sometimes you may want to list things in the help
messages that depend on what is loaded in Rizin (e.g. plugins, etc.).
This patch adds support for a details_cb that provides a dynamically
created RzCmdDescDetail array.
* Rename functions properly and ensure to remove the old flags.
* Rename flag instead of deleting it
* When renamed, the flags are not set in the right flag space.
This reverts commit bf39802452b7545551f52c4c32f8c01764ab2a75.
asm.cmt.esil was handled in a somewhat peculiar way, printing below the
disassembly if asm.cmt.right=0, even though every other comment is
printed above. Now it is more in line with all other commenting and the
new asm.cmt.il works in the same way.
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
RzAnalysisILVM wraps around the low-level RzILVM and enables emulation
of real code from disassembly, rather than raw IL.
Analysis plugins now don't actively initialize the vm anymore, but
return a fully declarative description RzAnalysisILConfig of how to set
up the vm and optionally its initial state.
This also enables multiple IL vms to exist at the same time as plugins
can not mess with the global vm anymore. See the added integration test
for an example.
* removal of `omo` command
* use of `oml`, `oml.` and `oml=` to list maps instead of `om`
* removal of RIZIN output from `oml`
* removal of `omn.` and just assume `omn` uses core->offset
Plugins do not create register-based variables themselves anymore, but
they are derived from the register profile. However not all registers
may be bound and not all variables may be actual registers. The concrete
relations between an RzILVM and registers is described by an
RzILRegBinding object. It is simply a list of register names and
variables are created of the same names. When stepping with aezs, the
registers are synchronized automatically. From now on, aezv is primarily
useful for debugging, but interacting with emulation from the user side
should be done with ar.
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.
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
ESIL Pins were an untested feature to run a command when emulation hit a
specific address. This can be solved in other ways, e.g. scripting.
Project version 7 has been introduced for this change.
* Show group-level details of commands
Details can be defined at either a group command or its subcommand of
the same name. If define on group-level it will also be shown in the
group help without needing ??.
* Fix > $ redirection for errored command and leak
* Rewrite ar and dr commands with newshell
Breaking changes:
ar* => arf, ar- => arf-, ar. => ar*
ar, => art, ar? => arq
ar0 => ara0, arb => arab, ars => araS
arC => arpC
arn => arR
art => arT
arf => arF
Removed: drm, aer
* Remove o-*h because it was the same as o--
* Remove o-! because not used
* Remove unread test case because it was not doing anything (o-fd did
not work)
* Refactor `rz_core_theme_nextpal()`
* Add tests for `ecp`, `ecn` and `ecoj`
* Add braces to avoid declaration after the label
* Use `RzCmdStateOutput` in `eco`
* Fix the output of the test for `ecoj`
* Introduce `RzConsPalSeekMode` and refactor `nextpal_item`
* Rename the APIs related to themes
* Rename `rz_core_get_theme` to `rz_core_theme_get`
* Rename `rz_core_load_theme` to `rz_core_theme_load`
* Rename `rz_core_list_themes` to `rz_core_theme_list`
* Add `curtheme` to `RzCore`
* Eliminate all global variables in cmd_eval.c
* Put the loop outside the `switch` in
`rz_cmd_eval_color_load_theme_handler`
* Remove `getNext` variable and use the `RzListIter`'s `p` variable
* Sort the list of loadable themes
* Use a normal `strcmp` as the comparator function while sorting themes
* Convert `ec` to the rzshell
* Port the `echo` command
* Make the `color` argument optional for `ecHw`
* Remove `rz_core_echo`
* Make `echo` a part of `e` commands
* Add tests for `eco` and `ecHw`
* Move the definition of `bool2status` to `cmd_eval.c`
* Fix `ecHj` and add a test for it
* Rename `rz_str_escape_latin1()` to `rz_str_escape_8bit()`
* test_serialize_analysis.c: Change string from "latin1" to "8bit"
* `bin.str.enc`: Rename `latin1` to the more generic `8bit`
* Do not escape strings during the search
* Port `C` (metainformation) commands to the rzshell
* Improve string autodetection
* Remove `Cr` and RZ_META_TYPE_RUN
* Escape `\x1b` as `\e` character in strings
* Move string encoding options to `RzStrEncOptions` struct
* Add `esc_double_quotes` option to `RzStrEncOptions`
* Do not filter out unprintable characters for uppercase check
* Use `esc_double_quotes` when printing the string between '"' in disasm
* Use signed chars on all platforms/architectures
Co-authored-by: Riccardo Schirone <sirmy15@gmail.com>
The new intermediate language is based on the BAP (Binary Analysis Platform) Core Theory.
It operates on SMT-like bitvectors and their arrays to represent values and memory.
Apart from that, it has also representation for the data and code side effects.
* Rewrite PDB parser to become endianess-independent
* Use type pretty-printing API
* Use `RzCmdStateOutput` instead of `RzOutputMode` to solve invalid JSON issue
* Move PDB-related print functions to `cpdb.c`
* Use flag API instead of calling commands from the code
* Separate printing from parsing and applying the type information
* Delete useless `main.c`
* Add `db` commands in `cmd_debug.yaml`
* Use bool instead of int as return value
* Port `db` commands to newshell
* Fix integration tests. Use `db- <addr>`, instead of `db-<addr>`
* Fix `dbW` handler and update `rz_w32_add_winmsg_breakpoint`
* Remove checks for `argc` in `cmd_debug.c` (from review)
* Fix failing Windows tests
* Change control flow in conditional expressions
* Use `RzCmdStateOutput` in handler for `dbt` to print backtrace in various formats
* Use forward slash (/) instead of pipe (|) for command descriptions
* Use output modes for printing breakpoints in `db` handler
* Remove extra newline while printing breakpoints in JSON format
* Change description for `dbc` command
* Update descriptions and handlers; Remove <addr> argument wherever necessary
* Use `RZ_CMD_ARG_TYPE_CHOICES` for perm in `dbw`
* Add details for `dbC` and `dbw`
* Add quiet printing mode for breakpoints
* Remove unnecessary <addr> argument for `db` commands
* Also add a quiet output mode for `dbl` and `dbt`
* Return if no breakpoint found in function `add_breakpoint`
* Update tests for new `db` commands
* Update `db` command descriptions
* Remove `dbi.` redundant command
* Add details for iterating through the list of breakpoints
* Extract `rz_debug_bp_add_noreturn_func` into `debug.c` as RZ_API
* Fix `dbil` handler and `dbg_bps` test
* Shift the noreturn function breakpoint to `cdebug.c`
* Format according to clang-format
* Fix failing integration tests
* TODO: Find why `db- @@c:dblq` is failing, and fix the bug
* Update `db` commands
* Use `db- @@c:dblq` instead of `db-*`
* This will also work as a test for command edits (see https://github.com/rizinorg/rizin/pull/1806)
* Use the numerical value string as parameter of `rz_core_debug_reg_set()`
* Add test for changing rflags using dr
* Add test for changing rflags using ar
* Replace `rz_type_db_base_type_as_string` with `rz_type_db_base_type_as_pretty_string`
* Use the new type pretty printing API to pretty print base types
* Add option to return newline terminated string by pretty printing API
* Add `RZ_TYPE_PRINT_END_NEWLINE` option to RzTypePrintOpts
* Improve printing in cases of empty structs/unions/enums
* Initially, the separator was printed between the curly breaces
irrespective of whether the struct/union/enum is empty. Now the
separator is not printed if the given type is empty
* Add pretty printing support for typedefs
* Also, add another type printing option to show typedefs. To be used in
`rz_cores_types_typedef_as_c`
* Refactor `.*_as_c` functions to use the new type pretty printing API
* Add tests for typedef and `unknown_t` for pretty printing API
* Add `rz_type_db_base_type_as_string` back. Update tests.
* Use ternary operator to make expression more concise
* Add doxygen documentation for `rz_type_db_base_type_as_string`
* Use `rz_vector_len` to determine if empty, instead of convoluted logic
* Remove redundant `RZ_NONNULL` for RzTypeDB
* Fix integration tests for type printing
* Update Doxygen documentation
* Fix failint enum printing itegration tests
* Fix according to clang-format
* Added demangling as plugins and libdemangle as external dependency
* Added iDl to return the list of demanglers
* moved demangling tests into rz-libdemangle and keep only bin tests
* Add function to check if a register is a system register
* Only checks for ARM64 system registers as of now
* Check for system registers in ARM64 when printing registers using "dr"
* Does not completely remove the unnecessary register, but removes a
huge number of useless registers printed by "dr"
* Rename `RZ_REG_TYPE_ALL` to `RZ_REG_TYPE_ANY`
* ADd register types for "sys" and "pauth": `RZ_REG_TYPE_SYS` and
`RZ_REG_TYPE_PAUTH` respectively
* Remove `rz_reg_is_system_reg`
* Add `sys` and `pauth` register profiles
* Update debug tests to account for new arenas and register profiles
* REplace "pauth" with "sec" reg profile
* Update integration tests to account for new register profiles: `sys`, `sec`