rizinorg / rizin

UNIX-like reverse engineering framework and command-line toolset.
https://rizin.re
GNU Lesser General Public License v3.0
2.66k stars 357 forks source link

ESIL to RZIL conversion #2080

Open XVilka opened 2 years ago

XVilka commented 2 years ago

First stage

High-priority

The rest

Second stage

Cutter

Other

RzAnalysis

$ rg -t c "esil" librz/core/ -l
librz/arch/serialize_analysis.c # isn't really used, relevant lines can be removed from the file
librz/arch/var.c
librz/arch/il/analysis_il_trace.c
librz/arch/op.c # isn't really used, relevant lines can be removed from the file
librz/arch/hint.c # isn't really used, relevant lines can be removed from the file
librz/arch/analysis.c # isn't really used, relevant lines can be removed from the file
librz/arch/fcn.c

RzDebug

librz/debug/p/debug_io.c
librz/debug/p/native/bt/generic-x64.c
librz/debug/p/native/bt/generic-x86.c
librz/debug/desil.c
librz/debug/trace.c

RzCore

$ rg -t c "esil" librz/core/ -l
librz/core/cprint.c # isn't really used, relevant lines can be removed from the file
librz/core/casm.c # isn't really used, relevant lines can be removed from the file
librz/core/cil.c
librz/core/analysis_objc.c 
librz/core/cdebug.c
librz/core/ctypes.c
librz/core/project_migrate.c # isn't really used, we should remove all ESIL-related information during the migration
librz/core/analysis_tp.c
librz/core/disasm.c 
librz/core/cmd_descs/cmd_descs.h # just remove no longer necessary command handlers
librz/core/tui/visual.c # isn't really used, relevant lines can be removed from the file
librz/core/cmd_descs/cmd_descs.c # just remove no longer necessary command handlers
librz/core/tui/esil.c # This one can be simply removed
librz/core/tui/biteditor.c # Should print RzIL instead
librz/core/tui/panels.c # Should be substituted with RzIL emulation
librz/core/cconfig.c # ESIL relevant options and callbacks could be removed, new options for RzIL should be created
librz/core/agraph.c # isn't really used, relevant lines can be removed from the file
librz/core/core_private.h # isn't really used, relevant lines can be removed from the file
librz/core/cesil.c # This one can be simply removed 
librz/core/cmd/cmd_debug.c
librz/core/cmd/cmd_search.c
librz/core/canalysis.c 
librz/core/cmd/cmd_search_rop.c
librz/core/cmd/cmd_print.c
librz/core/cmd/cmd_analysis.c
pelijah commented 1 year ago

As I see rsp plugin is untested and unmaintained. Maybe we should move it to the extras?

thestr4ng3r commented 1 year ago

Better first check if it can be made tested and working without too much effort.

Gauravjadhav22 commented 1 year ago

I want to work on this issue please assign me this issue!..

XVilka commented 1 year ago

@Gauravjadhav22 go ahead. Look at how AVR was converted and I recommend taking RSP (librz/analysis/p/analysis_rsp.c) architecture - it's simple enough for a start.

XVilka commented 1 year ago

I looked at some code that uses ESIL, e.g. librz/analysis/var.c (and a trivial piece of code at librz/analysis/fcn.c) or librz/core/analysis_tp.c - the use of ESIL could be conditional, if ESIL is chosen, and can use a different code path/function if the RzIL is chosen.

These could be the first steps on switching from ESIL to RzIL without breaking compatibility for now.