* Remove RIZIN command output for the old projects
* Fix cmeta.c
* Fix ik command
* Revert back pc*
* fix formatting cmd_descs_generate.py
* Fix rz_cons_pal_list_as_css
* Fill all info about colors for ec commands.
* Fix all tests
Rebase done by obr freed all vfiles in the RzBinObject, but did not free
the entire RzBinFile, so core was not notified about it, and it may
still have had references to vfiles in vfile:// mappings, thus causing
UAFs.
Unfortunately the entire obr command was not working properly, so we
remove it with obR (also not entirely working) and rb being possible
replacements depending on the use-case.
The possibly dangerous RzBin apis have been made private in the module
to prevent future misuse.
* Move `R!` to RzShell.
* Port `Rg` commands to RzShell
* Port `Rh` commands to RzShell.
Drops support for background webservers, because they were never handled.
The 'RH' commands were merged into 'Rh'.
Browser
* Remove seemlessly useless command call.
* Remove dead code
* Apply suggestion
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
* core/cmd: Adjust math commands
* shell: make `?x` commands a parsing failure
We have moved the `?x` commands to `%x`, thus now no command should
start with `?`. This patch makes the parser fail to parse `?x`
strings.
* core/tui: use APIs in panels
* There's no `%q` anymore, use `%=`
This warning turned out to be more misleading and spammy than actually
useful. For example, it speaks of a "file" when loading just a malloc,
and many architectures simply do not have any standardized calling
conventions, like 6502 or gb, in which case the analysis is fine without
any loaded cc info.
+ 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
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.
Variables on the stack are not identified by bp/sp+<offset> anymore, but
by their address from the bottom of the stack frame (RzStackAddr),
independent of how they are accessed.
So now there are only two kinds of variables: stack and register.
This required some major refactoring and other changes:
* RzAnalysisVar.isarg was removed. Whether a variable is an argument is
now specified implicitly by its storage location.
* Varsub of struct fields had to be rewritten so fields can be queried
by arbitrary stack addresses using the recently introduced sp
tracking, as the old approach to fill a list with all fields would not
work anymore.
* analysis.vars.stackname was removed, new behavior is more similar to
this being true before.
* Variables will not be created at stack+0 now, because the return
address is there. Before, vars were only created sometimes in such
cases.
* Variables created from bp offsets in x86 are not deleted anymore if
the function's bp_frame is false (see removed
rz_analysis_function_delete_vars_by_kind(fcn,
RZ_ANALYSIS_VAR_KIND_BPV); calls). This may lead to some
false-positive detected variables. Whether this really is a practical
issue is yet to be seen. At least there are no meaningful tests that
are broken by this.
* Applying variables from dwarf needed some fixes for determining the
correct stack locations of variables in order to write meaningful
tests. The handling is still not entirely correct for all
possibilities of dwarf info, but at least the changed/added test cases
are right and serve as a reference for future changes.
* Projects version 11 is introduced.
* afvb commands have been removed, afvs now handles all stack vars.
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
This fixes the following minor issues:
* Errors like "Cannot create flag (...) because there is already (...)
flag" during debug startup
* Unnecessary seeks during .dm* causing io reads and e.g. delays of up
to 5s on x86 macOS during debug startup
* Flags are now created in the "maps" flagspace, rather than globally,
making them easier to clean up later
* Flags now have the same size as the maps and not +1
* 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
This allows tracing an io map back to the RzCoreFile and thus also its
bin file and other info. This is used in rz-ghidra to determine which
memory ranges can be considered readonly to enable constant propagation.
* 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.
* Remove `RIZIN_EXTRAS` because useless
Extras plugin should be treated as any other regular plugin, they should
not have their own directory. I believe we did not have anyway any
plugin using that directory.
* Do not use `<version>` in `/usr/share`
Users can only install one version of Rizin at a time anyway, thus
splitting the `/usr/share/rizin` directories does not really bring
multi-version install possible. At the same time, we stick to what's
common for other tools, which do not use version in `/usr/share`
* Move plugin directory to `/usr/lib64/rizin/plugins`
* Remove `RZ_HOME_BIN` env var because not useful anymore
* Introduce `rz_util/rz_path` to provide rizin paths
* Use `rz_path_system_sdb_types` whenever it makes sense
* Use some others `rz_path_*` functions instead of custom ones
* Use `rz_path` APIs for themes, fortunes and signatures
* Remove `rz_sys_prefix`
* Reduce the number of defines needed to handle home and system paths
* Reduce the number of `rz_path` functions
* Make the lib debug depending on log level and `RZ_LOG_DEBUG`
* Refactor a bit how directory of plugins are loaded
* Keep supporting old plugins directory for at least 0.4.0
* Added rz_analysis_get_address_bits() instead of arch-specific hacks in core
* flags are only set for address-sized registers
* dr/ar show registers of any size by default, but hiding registers that are entirely
covered by others