Skip to content

Table Commands documentation added#159

Merged
wargio merged 8 commits into
rizinorg:masterfrom
Farhan-25:update-table-api-docs
Mar 4, 2026
Merged

Table Commands documentation added#159
wargio merged 8 commits into
rizinorg:masterfrom
Farhan-25:update-table-api-docs

Conversation

@Farhan-25
Copy link
Copy Markdown
Contributor

TABLE API added in tools/rz-bin/tables.md also updated _quarto.yml

Comment thread src/tools/rz-bin/tables.md Outdated
Comment thread src/tools/rz-bin/tables.md Outdated

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Comment thread src/tools/rz-bin/tables.md Outdated

## Table Command Syntax

In Rizin, the help command for table-based commands is `:?`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
In Rizin, the help command for table-based commands is `:?`.
In Rizin, the help command for the table query syntax is `:?`.

Comment thread src/tools/rz-bin/tables.md Outdated
### 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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

Comment thread src/tools/rz-bin/tables.md Outdated

Table format specifiers `(<table_spec>)`:
```
| <col>/sort/<inc|dec> # Sort table by column <col> in increasing or decreasing order.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is wrong. i probably forgot to change this as the sorting can be reversed by doing <col>/sort/rev

Comment thread src/tools/rz-bin/tables.md Outdated
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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
| <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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here. i forgot to update the info.

Copy link
Copy Markdown
Member

@wargio wargio left a comment

Choose a reason for hiding this comment

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

definitely a good start! can you fix the description on rizin side first and then the examples here?

@Farhan-25
Copy link
Copy Markdown
Contributor Author

Farhan-25 commented Jan 17, 2026

Yes sure!

@Farhan-25
Copy link
Copy Markdown
Contributor Author

Please verify that I have made the required changes in the book.
rizinorg/rizin#5811
Also link for the pull request of the main rizin software with updated table commands.

Copy link
Copy Markdown
Contributor

@notxvilka notxvilka left a comment

Choose a reason for hiding this comment

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

It's not an API, commands. Except this looks good, thank you!

Copy link
Copy Markdown
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Generally looks good.

Comment thread src/tools/rz-bin/tables.md Outdated

### Example 2: Paginate strings, filter by length, and export as CSV
```
izz:string/minlen/8:length/sort/rev:*/page/0/15:csv
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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
...

Copy link
Copy Markdown
Member

@wargio wargio Jan 25, 2026

Choose a reason for hiding this comment

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

i had the same error. seems that the buffer is not initialized or going out of bound.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread src/tools/rz-bin/tables.md Outdated
@Farhan-25
Copy link
Copy Markdown
Contributor Author

izz:string/minlen/8:length/sort/rev:*/page/0/15:csv
paddr,vaddr,len,size,section,type,string
0x00003791,----------,11,12,.shstrtab,ascii,.fini_array
0x00003785,----------,11,12,.shstrtab,ascii,.init_array
0x0000377b,----------,9,10,.shstrtab,ascii,.eh_frame
0x0000376d,----------,13,14,.shstrtab,ascii,.eh_frame_hdr
0x00003740,----------,9,10,.shstrtab,ascii,.rela.dyn
0x00003731,----------,14,15,.shstrtab,ascii,.gnu.version_r
0x00003724,----------,12,13,.shstrtab,ascii,.gnu.version
0x0000370a,----------,9,10,.shstrtab,ascii,.gnu.hash
0x000036f7,----------,18,19,.shstrtab,ascii,.note.gnu.build-id
0x000036e4,----------,18,19,.shstrtab,ascii,.note.gnu.property
0x000036da,----------,9,10,.shstrtab,ascii,.shstrtab
0x000036ad,----------,27,28,.strtab,ascii,__cxa_finalize@@GLIBC_2.2.5
0x00003693,----------,25,26,.strtab,ascii,_ITM_registerTMCloneTable
0x0000367f,----------,19,20,.strtab,ascii,malloc@@GLIBC_2.2.5
0x00003670,----------,14,15,.strtab,ascii,gmon_start

is:name/uniq:addr/gt/0x1000:name/str/init:addr/sort:json i used this command with le lt in place of gt and it works. ge will also return a empty table ig the file which i am using doesnt have any addr greater than 0x1000. Or it can be a bug.

@Rot127
Copy link
Copy Markdown
Member

Rot127 commented Jan 21, 2026

Or it can be a bug.

My bin/ls had functions above this address. So it is a bug probably.

Copy link
Copy Markdown
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Before I forget. Can you please check and document if the addresses used in the filtering are the virtual or physical (effectively the file offset) addresses.

@wargio
Copy link
Copy Markdown
Member

wargio commented Jan 22, 2026

My bin/ls had functions above this address. So it is a bug probably.

worth opening an issue on rizin side

Clarified note on address-based table filters and their operation on address types.
@Farhan-25
Copy link
Copy Markdown
Contributor Author

Before I forget. Can you please check and document if the addresses used in the filtering are the virtual or physical (effectively the file offset) addresses.

I added a note regarding this.

@Farhan-25
Copy link
Copy Markdown
Contributor Author

Can we push this @Rot127 @wargio ?

Comment thread src/tools/rz-bin/tables.md Outdated
| 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

 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.
@Farhan-25
Copy link
Copy Markdown
Contributor Author

My bad sir i removed that line.

Comment thread src/tools/rz-bin/tables.md Outdated
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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.
image
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.

Copy link
Copy Markdown
Member

@Rot127 Rot127 Jan 25, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok thank you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done please check.

@Farhan-25
Copy link
Copy Markdown
Contributor Author

@Rot127 Can we merge this??

Comment thread src/tools/rz-bin/tables.md Outdated
@Rot127
Copy link
Copy Markdown
Member

Rot127 commented Mar 4, 2026

After the change we can merge IMO.

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
@Farhan-25 Farhan-25 changed the title Table API documentation added Table Commands documentation added Mar 4, 2026
@Farhan-25
Copy link
Copy Markdown
Contributor Author

After the change we can merge IMO.

Done, plz check

@wargio wargio merged commit 0e8f8cd into rizinorg:master Mar 4, 2026
1 check passed
@Farhan-25 Farhan-25 deleted the update-table-api-docs branch April 6, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants