Table Commands documentation added#159
Conversation
|
|
||
| Rizin generates tables for certain commands, such as `aflt`, `is`, `izz`, and `il`, when they are executed on a file. These commands return structured data in the form of tables. | ||
|
|
||
| The Table API is used to process and display this data. Using table specifiers, users can sort rows, filter (grep) data, select specific columns or rows, paginate results, and limit the output. Tables can also be printed in different output formats such as CSV and JSON, or displayed in various textual layouts, including with borders and headers, with headers only, or without headers. |
There was a problem hiding this comment.
| The Table API is used to process and display this data. Using table specifiers, users can sort rows, filter (grep) data, select specific columns or rows, paginate results, and limit the output. Tables can also be printed in different output formats such as CSV and JSON, or displayed in various textual layouts, including with borders and headers, with headers only, or without headers. | |
| The table output is used to process and display data. Using the table query syntax, users can sort rows, filter (grep) data, select specific columns or rows, paginate results, and limit the output. Tables can also be printed in different output formats such as CSV and JSON, or displayed in various textual layouts, including with borders and headers, with headers only, or without headers. |
|
|
||
| ## Table Command Syntax | ||
|
|
||
| In Rizin, the help command for table-based commands is `:?`. |
There was a problem hiding this comment.
| In Rizin, the help command for table-based commands is `:?`. | |
| In Rizin, the help command for the table query syntax is `:?`. |
| ### Example 1: Filter, sort, and format analyzed functions | ||
|
|
||
| ```text | ||
| aflt:addr/cols/name/nbbs:size/gt/32:nbbs/gt/1:nbbs/lt/10:nbbs/sort/dec:fancy |
There was a problem hiding this comment.
| aflt:addr/cols/name/nbbs:size/gt/32:nbbs/gt/1:nbbs/lt/10:nbbs/sort/dec:fancy | |
| aflt:addr/cols/name/nbbs:size/gt/32:nbbs/gt/1:nbbs/lt/10:nbbs/sort/rev:fancy |
|
|
||
| Table format specifiers `(<table_spec>)`: | ||
| ``` | ||
| | <col>/sort/<inc|dec> # Sort table by column <col> in increasing or decreasing order. |
There was a problem hiding this comment.
this is wrong. i probably forgot to change this as the sorting can be reversed by doing <col>/sort/rev
| Table format specifiers `(<table_spec>)`: | ||
| ``` | ||
| | <col>/sort/<inc|dec> # Sort table by column <col> in increasing or decreasing order. | ||
| | <col>/sortlen/<inc|dec> # Sort table length of column <col> in increasing or decreasing order. |
There was a problem hiding this comment.
| | <col>/sortlen/<inc|dec> # Sort table length of column <col> in increasing or decreasing order. | |
| | <col>/sortlen/rev # Sort table length of column <col> in increasing or decreasing order. |
There was a problem hiding this comment.
same here. i forgot to update the info.
wargio
left a comment
There was a problem hiding this comment.
definitely a good start! can you fix the description on rizin side first and then the examples here?
|
Yes sure! |
|
Please verify that I have made the required changes in the book. |
notxvilka
left a comment
There was a problem hiding this comment.
It's not an API, commands. Except this looks good, thank you!
|
|
||
| ### Example 2: Paginate strings, filter by length, and export as CSV | ||
| ``` | ||
| izz:string/minlen/8:length/sort/rev:*/page/0/15:csv |
There was a problem hiding this comment.
@notxvilka @wargio This command throws errors for me:
[0x000037f0]> izz:string/minlen/8:length/sort/rev:*/page/0/15:csv
rz_num_calc error: ( ')' expected) in ((i9<iv}2)
rz_num_calc error: ( ')' expected) in ((iG<iTZÞ6)
rz_num_calc error: ( ')' expected) in ((º<iTZD4)
rz_num_calc error: ( ')' expected) in ((iG<iTZî3)
rz_num_calc error: ( ')' expected) in ((iG<iTZ)
rz_num_calc error: ( ')' expected) in ((iF<inY³)
paddr,vaddr,len,size,section,type,string
0x00022f43,----------,14,15,.shstrtab,ascii,.gnu_debugdata
0x00022f34,----------,14,15,.shstrtab,ascii,.gnu_debuglink
...
There was a problem hiding this comment.
i had the same error. seems that the buffer is not initialized or going out of bound.
|
izz:string/minlen/8:length/sort/rev:*/page/0/15:csv is:name/uniq:addr/gt/0x1000:name/str/init:addr/sort:json i used this command with |
My |
worth opening an issue on rizin side |
Clarified note on address-based table filters and their operation on address types.
I added a note regarding this. |
| | quiet # Print the table in a simple form, without headers. | ||
| ``` | ||
|
|
||
| Note: Address-based table filters operate on the address type exposed by the table column. Columns such as `addr` and `vaddr` refer to virtual addresses, while `paddr` refers to physical addresses (file offsets). The table query engine does not perform address translation, therefore table filtering depends on the address type of the selected column. |
There was a problem hiding this comment.
The table query engine does not perform address translation, therefore table filtering depends on the address type of the selected column.
What do you mean with this sentence?
Also, when I was talking about the addresses, I was talking about the example below. Here it doesn't make sense.
Clarified note on address-based table filters and their operation on virtual addresses in examples.
|
My bad sir i removed that line. |
| is:name/uniq:addr/gt/0x1000:name/str/init:addr/sort:json | ||
| ``` | ||
| This command keeps only the first occurrence of each unique symbol name. It filters symbols whose address is greater than `0x1000` and whose name contains the substring `init`. The results are sorted in increasing order. | ||
| We are using `addr` for filtering, which means that the filtering is performed on virtual addresses. |
There was a problem hiding this comment.
So I found some time and looked into it and figured what is the problem.
is doesn't have the addr column but only vaddr and paddr. uniq:addr simply prints all of the rows (because addr doesn't exist I guess?).
But it prints an error:
> is:name/uniq:addr/
ERROR: table: Invalid operation ()
This is also why my brief test by running the commands didn't work. because gt/addr couldn't compare to anything. Which was also shown in an error I missed:
In any case, did you run the commands by yourself and tested it?
Or did you just generated the text here with AI?
There was a problem hiding this comment.
Yes i used AI. But i crosschecked it too. If addr is not a table then how come this command work?
is:name/uniq:addr/lt/0x1000:name/str/init:addr/sort:json just lt instead of gt.

I forgot that there is no addr column. So i just verified with lt and it was working so i wrote it here.
I can change it to vaddr to correct my mistake.
There was a problem hiding this comment.
But i crosschecked it too.
Then it is fine.
I forgot that there is no addr column. So i just verified with lt and it was working so i wrote it here.
That is weird and a bug I think. The filtering should work consistently. Either fail or follow some how it matches.
I can change it to vaddr to correct my mistake.
Yes please. You can also remove the comments about paddr and vaddr then. Since they are no longer relevant.
There was a problem hiding this comment.
Done please check.
|
@Rot127 Can we merge this?? |
|
After the change we can merge IMO. |
Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
Done, plz check |
TABLE API added in tools/rz-bin/tables.md also updated _quarto.yml