radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.6k stars 3k forks source link

"c" command documentation is wrong. #178

Closed jvoisin closed 11 years ago

jvoisin commented 11 years ago

Sometimes. "c"'s help tells about a "cc" command, sometimes, not.

Testcase

$ r2 ./a.out
[0x08048320]> ?
 a                 ; perform analysis of code
 b [bsz]           ; get or change block size
 c[dqxXfg] [arg]   ; compare block with given data
 C[Cf..]           ; Code metadata management
 d[hrscb]          ; debugger commands
 e [a[=b]]         ; list/get/set config evaluable vars
 f [name][sz][at]  ; set flag at current address
 g[wcilper] [arg]  ; go compile shellcodes with r_egg
 i [file]          ; get info about opened file
 m[lyogfdps]       ; mountpoints commands
 o [file] (addr)   ; open file at optional address
 p?[len]           ; print current block with format and length
 P[osi?]           ; project management utilities
 r[+- ][len]       ; resize file
 s [addr]          ; seek to address
 S?[size] [vaddr]  ; IO section manipulation information
 V[vcmds]          ; enter visual mode (vcmds=visualvisual  keystrokes)
 w[mode] [arg]     ; multiple write operations
 x [len]           ; alias for 'px' (print hexadecimal)
 y [len] [off]     ; yank/paste bytes from/to memory
 ? [expr]          ; help or evaluate math expression
 /[xmp/]           ; search for bytes, regexps, patterns, ..
 ![cmd]            ; run given command as in system(3)
 = [cmd]           ; run this command via rap://
 (macro arg0 arg1) ; define scripting macros
 #[algo] [len]     ; calculate hash checksum of current block
 .[ file|!cmd|cmd|(macro)]  ; interpret as radare cmds
 :                 ; list all command plugins
 q [ret]           ; quit program with a return value
Use '???' evaluation, special vars and scripting facilities
Append '?' to any char command to get detailed help
Prefix with number to repeat command N times (f.ex: 3x)
Suffix '@ addr[:bsize]' for a temporary seek and/or bsize
Suffix '@@ glob1 glob2i ..' space separated glob greps for flags to seek
Suffix '~string:linenumber[column]' to filter output
[0x08048320]> c?
Usage: c[?cdfx] [argument]
 c  [string]   Compares a plain with escaped chars string
 cd [value]    Compare a doubleword from a math expression
 cq [value]    Compare a quadword from a math expression
 cx [hexpair]  Compare hexpair string
 cX [addr]     Like 'cc' but using hexdiff output
 cf [file]     Compare contents of file at current seek
 cg[o] [file]  Graphdiff current file and [file]
[0x08048320]> cc?
Usage: c[?Ddxf] [argument]
[0x08048320]>
radare commented 11 years ago

cc is not a valid command. Provide a patch with ur solution. You can use ~ char to grep the line of interest

?~c

For example

On Aug 22, 2013, at 22:10, jvoisin notifications@github.com wrote:

Sometimes. "c"'s help tells about a "cc" command, sometimes, not.

Testcase

$ r2 ./a.out [0x08048320]> ? a ; perform analysis of code b [bsz] ; get or change block size c[dqxXfg] [arg] ; compare block with given data C[Cf..] ; Code metadata management d[hrscb] ; debugger commands e [a[=b]] ; list/get/set config evaluable vars f [name][sz][at] ; set flag at current address g[wcilper] [arg] ; go compile shellcodes with r_egg i [file] ; get info about opened file m[lyogfdps] ; mountpoints commands o file ; open file at optional address p?[len] ; print current block with format and length P[osi?] ; project management utilities r[+- ][len] ; resize file s [addr] ; seek to address S?[size] [vaddr] ; IO section manipulation information V[vcmds] ; enter visual mode (vcmds=visualvisual keystrokes) w[mode] [arg] ; multiple write operations x [len] ; alias for 'px' (print hexadecimal) y [len] [off] ; yank/paste bytes from/to memory ? [expr] ; help or evaluate math expression /[xmp/] ; search for bytes, regexps, patterns, .. ![cmd] ; run given command as in system(3) = [cmd] ; run this command via rap:// (macro arg0 arg1) ; define scripting macros

[algo] [len] ; calculate hash checksum of current block

.[ file|!cmd|cmd|(macro)] ; interpret as radare cmds : ; list all command plugins q [ret] ; quit program with a return value Use '???' evaluation, special vars and scripting facilities Append '?' to any char command to get detailed help Prefix with number to repeat command N times (f.ex: 3x) Suffix '@ addr[:bsize]' for a temporary seek and/or bsize Suffix '@@ glob1 glob2i ..' space separated glob greps for flags to seek Suffix '~string:linenumber[column]' to filter output [0x08048320]> c? Usage: c[?cdfx] [argument] c [string] Compares a plain with escaped chars string cd [value] Compare a doubleword from a math expression cq [value] Compare a quadword from a math expression cx [hexpair] Compare hexpair string cX [addr] Like 'cc' but using hexdiff output cf [file] Compare contents of file at current seek cg[o] [file] Graphdiff current file and [file] [0x08048320]> cc? Usage: c[?Ddxf] [argument] [0x08048320]> — Reply to this email directly or view it on GitHub.

radare commented 11 years ago

Fixed in tip