The Official Radare2 Book | страница 27



Binary data can be represented as integers, shorts, longs, floats, timestamps, hexpair strings, or more complex formats like C structures, disassembly listings, decompilation listing, be a result of an external processing...

Below is a list of available print modes listed by p?:

[0x00005310]> p?

|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 pdi)

| 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

| p3 [file] print stereogram (3D)

| 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 pdi)

| pd[?] [sz] [a] [b] disassemble N opcodes (pd) or N bytes (pD)

| pf[?][.nam] [fmt] print formatted data (pf.name, pf.name $)

| 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

| 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

| pq[?][is] [len] print QR code with the first Nbytes

| 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

| pwd display current working directory

| px[?][owq] [len] hexdump of N bytes (o=octal, w=32bit, q=64bit)

| pz[?] [len] print zoom view (see pz? for help)

[0x00005310]>

Tip: when using json output, you can append the ~{} to the command to get a pretty-printed version of the output: