[0x00404cc0]> C?
| Usage: C[-LCvsdfm*?][*?] [...] # Metadata management
| C list meta info in human friendly form
| C* list meta info in r2 commands
| C*. list meta info of current offset in r2 commands
| C- [len] [[@]addr] delete metadata at given address range
| C. list meta info of current offset in human friendly form
| CC! [@addr] edit comment with $EDITOR
| CC[?] [-] [comment-text] [@addr] add/remove comment
| CC.[addr] show comment in current address
| CCa[-at]|[at] [text] [@addr] add/remove comment at given address
| CCu [comment-text] [@addr] add unique comment
| CF[sz] [fcn-sign..] [@addr] function signature
| CL[-][*] [file:line] [addr] show or add 'code line' information (bininfo)
| CS[-][space] manage meta-spaces to filter comments, etc..
| C[Cthsdmf] list comments/types/hidden/strings/data/magic/formatted in human friendly form
| C[Cthsdmf]* list comments/types/hidden/strings/data/magic/formatted in r2 commands
| Cd[-] [size] [repeat] [@addr] hexdump data array (Cd 4 10 == dword [10])
| Cd. [@addr] show size of data at current address
| Cf[?][-] [sz] [0|cnt][fmt] [a0 a1...] [@addr] format memory (see pf?)
| Ch[-] [size] [@addr] hide data
| Cm[-] [sz] [fmt..] [@addr] magic parse (see pm?)
| Cs[?] [-] [size] [@addr] add string
| Ct[?] [-] [comment-text] [@addr] add/remove type analysis comment
| Ct.[@addr] show comment at current or specified address
| Cv[bsr][?] add comments to args
| Cz[@addr] add string (see Cs?)
在指定的行/地址加入一个注释,只需使用Ca命令:
[0x00000000]> CCa 0x0000002 this guy seems legit
[0x00000000]> pd 2
0x00000000 0000 add [rax], al
; this guy seems legit
0x00000002 0000 add [rax], al
对数据类型的注解通常在可视化模式下更容易完成,使用"d"键即可进行注解,其是"data type change"的缩写。首先用光标选择一个字节范围(按下c键进入光标模式,在里面通过HJKL键进行选择),之后按下'd'键可以获取菜单,菜单中包含允许进行的操作或可能的类型。例如想要将一个范围内的字节标记为字符串时,选择该菜单中的s选项。当然也可以在r2 shell下使用Cs命令达到同样的效果。
[0x00000000]> f string_foo @ 0x800
[0x00000000]> Cs 10 @ string_foo