Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert pF commands to the rzshell #3071

Merged
merged 3 commits into from
Oct 9, 2022
Merged

Convert pF commands to the rzshell #3071

merged 3 commits into from
Oct 9, 2022

Conversation

XVilka
Copy link
Member

@XVilka XVilka commented Oct 7, 2022

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

Convert pF commands to rzshell

Test plan

CI is green.

Closing issues

Partially addresses #1590

librz/core/cmd_descs/cmd_print.yaml Outdated Show resolved Hide resolved
librz/core/cmd_descs/cmd_print.yaml Outdated Show resolved Hide resolved
librz/core/cmd_descs/cmd_print.yaml Outdated Show resolved Hide resolved
librz/core/cmd/cmd_print.c Outdated Show resolved Hide resolved
@XVilka XVilka added this to the 0.5.0 milestone Oct 8, 2022
Copy link
Member Author

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[XX] db/cmd/cmd_pFb pFb.test simple protobuf (verbose) Resolved

click me to expand
[XX] db/cmd/cmd_pFb pFb.test simple protobuf (verbose)
RZ_NOPLUGINS=1 /usr/bin/rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Qc 'wx 0a 2e 0a 07 56 69 6e 63 65 6e 74 10 09 1a 10 56 69 6e 63 65 6e 74 40 74 65 73 74 2e 63 6f 6d 22 0f 0a 0b 31 35 30 31 31 31 31 31 31 31 31 10 02
pFbv
' =
-- stdout
--- expected
+++ actual
@@ -1,9 +1,33 @@
-1 [LEN_DELIM]   {
-    1 [LEN_DELIM]  : "Vincent"
-    2 [VARINT]     : 9 | 9
-    3 [LEN_DELIM]  : "[email protected]"
-    4 [LEN_DELIM]   {
-        1 [LEN_DELIM]  : "15011111111"
-        2 [VARINT]     : 2 | 2
-    }
-}
+Usage: p[=68abcdDfiImrstuxz] [arg|len] [@addr]  
+| p[b|B|xb] [len] ([S])   bindump N bits skipping S bytes
+| p[iI][df] [len]         print N ops/bytes (f=func) (see pi? and pdq)
+| p[kK] [len]             print key in randomart (K is for mosaic)
+| p-[?][jh] [mode]        bar|json|histogram blocks (mode: e?search.in)
+| p2 [len]                8x8 2bpp-tiles
+| p6[de] [len]            base64 decode/encode
+| p8[?][j] [len]          8bit hexpair list of bytes
+| p=[?][bep] [N] [L] [b]  show entropy/printable chars/chars bars
+| pa[edD] [arg]           pa:assemble  pa[dD]:disasm or pae: esil from hex
+| pA[n_ops]               show n_ops address and type
+| pb[?] [n]               bitstream of N bits
+| pB[?] [n]               bitstream of N bytes
+| pc[?][p] [len]          output C (or python) format
+| pC[aAcdDxw] [rows]      print disassembly in columns (see hex.cols and pdq)
+| pd[?] [sz] [a] [b]      disassemble N opcodes (pd) or N bytes (pD)
+| pf[?][.nam] [fmt]       print formatted data (pf.name, pf.name $<expr>)
+| pF[?][apx]              print asn1, pkcs7 or x509
+| pg[?][x y w h] [cmd]    create new visual gadget or print it (see pg? for details)
+| ph[?][=|hash] ([len])   calculate hash for a block
+| pi[?][bdefrj] [num]     print instructions
+| pI[?][iI][df] [len]     print N instructions/bytes (f=func)
+| pj[?] [len]             print as indented JSON
+| pm[?] [magic]           print libmagic data (see pm? and /m?)
+| po[?] hex               print operation applied to block (see po?)
+| pp[?][sz] [len]         print patterns, see pp? for more help
+| pr[?][glx] [len]        print N raw bytes (in lines or hexblocks, 'g'unzip)
+| ps[?][pwz] [len]        print pascal/wide/zero-terminated strings
+| pt[?][dn] [len]         print different timestamps
+| pu[?][w] [len]          print N url encoded bytes (w=wide)
+| pv[?][jh] [mode]        show variable/pointer/value in memory
+| px[?][owq] [len]        hexdump of N bytes (o=octal, w=32bit, q=64bit)
+| pz[?] [len]             print zoom view (see pz? for help)



[XX] db/cmd/cmd_pFb pFb.test simple protobuf
RZ_NOPLUGINS=1 /usr/bin/rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Qc 'wx 0a 2e 0a 07 56 69 6e 63 65 6e 74 10 09 1a 10 56 69 6e 63 65 6e 74 40 74 65 73 74 2e 63 6f 6d 22 0f 0a 0b 31 35 30 31 31 31 31 31 31 31 31 10 02
pFb
' =
-- stdout
--- expected
+++ actual
@@ -1,9 +1,9 @@
-1 {
-    1: "Vincent"
-    2: 9 | 9
-    3: "[email protected]"
-    4 {
-        1: "15011111111"
-        2: 2 | 2
+1 [LEN_DELIM]   {
+    1 [LEN_DELIM]  : "Vincent"
+    2 [VARINT]     : 9 | 9
+    3 [LEN_DELIM]  : "[email protected]"
+    4 [LEN_DELIM]   {
+        1 [LEN_DELIM]  : "15011111111"
+        2 [VARINT]     : 2 | 2
     }
 }

Copy link
Member Author

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wargio wargio merged commit 24503df into dev Oct 9, 2022
@wargio wargio deleted the asan-print-rzshell2 branch October 9, 2022 17:18
@XVilka XVilka mentioned this pull request Oct 9, 2022
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants