rizinorg / rizin

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

core/cmd: port `/R` commands to the rzshell #4504

Closed giridharprasath closed 3 weeks ago

giridharprasath commented 1 month ago

SQUASH ME

Your checklist for this pull request

Detailed description

ScreenShot_2024-05-24_at_06:36:51-PM

Test plan

...

Closing issues

...

giridharprasath commented 1 month ago

Still WIP:

giridharprasath commented 1 month ago

Some notes:

XVilka commented 1 month ago

Some notes:

* `/Rk` is unusable, Will be refactoring it and adding testcases for it in a separate PR.

* Current table view with only columns:
[0x08048330]> /Rt
addr bytes disasm 
------------------

Please lmk if any other fields needed to be added which would be helpful in table mode. @XVilka

Should be enough for now. Further improvements could be done when necessary.

XVilka commented 4 weeks ago

@giridharprasath two more missing failed tests:

[XX] db/cmd/cmd_search Rop search w/ regexp
RZ_NOPLUGINS=1 /usr/bin/rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -eflirt.sigdb.load.system=false -eflirt.sigdb.load.home=false -N -qc 'e asm.arch=x86
e analysis.arch=x86
e asm.bits=32
wa "add esp,8;pop ebx; pop ebp; ret"
e scr.color=false
/R/ or.*bl
q
' malloc://1024
-- stdout
--- expected
+++ actual
@@ -0,4 +0,5 @@
   0x00000002             085b5d  or byte [ebx + 0x5d], bl
   0x00000005                 c3  ret
+Gadget size: 4

[XX] db/cmd/cmd_search Rop search
RZ_NOPLUGINS=1 /usr/bin/rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -eflirt.sigdb.load.system=false -eflirt.sigdb.load.home=false -N -qc 'e asm.arch=x86
e analysis.arch=x86
e asm.bits=32
wa "add esp,8;pop ebx; pop ebp; ret"
e scr.color=false
/R
q
' malloc://1024
-- stdout
--- expected
+++ actual
@@ -2,12 +2,15 @@
   0x00000003                 5b  pop ebx
   0x00000004                 5d  pop ebp
   0x00000005                 c3  ret
+Gadget size: 6

https://github.com/rizinorg/rizin/actions/runs/9329582517/job/25682181832?pr=4504#step:12:238