Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rax2: Clean and update rax2 with base64 examples #351

Merged
merged 1 commit into from
Nov 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions src/tools/rax2/intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Rax2

The `rax2` utility comes with the radare framework and aims to be a minimalistic expression evaluator for the shell. It is useful for making base conversions between floating point values, hexadecimal representations, hexpair strings to ascii, octal to integer. It supports endianness and can be used as a shell if no arguments are given.
The `rax2` utility comes with the radare framework and aims to be a minimalistic expression evaluator for the shell. It is useful for making base conversions between floating point values, hexadecimal representations, hexpair strings to ascii, octal to integer. It supports endianness conversion.

This is the help message of rax2, this tool can be used in the command-line or interactively (reading the values from stdin), so it can be used as a multi-base calculator.

Expand Down Expand Up @@ -72,39 +72,48 @@ Usage: rax2 [options] [expr ...]
```

Some examples:
```

Calculator:
```sh
$ rax2 3+0x80
0x83
$ rax2 -d "1<<8"
256
```

Base conversion:
```sh
$ rax2 '=2' 73303325
100010111101000010100011101b
```
$ rax2 0x80+3
131
```
```
$ echo 0x80+3 | rax2
131
```
```
The single quote for `'=2'` is not mandatory for bash but is necessary for some shell like zsh.

Conversion in hex string
```sh
$ rax2 -s 4142
AB
```
```
$ rax2 -S AB
4142
```
```
$ rax2 -S < bin.foo
...
```
```

Endianess conversion:
```sh
$ rax2 -e 33
0x21000000
```
```
$ rax2 -e 0x21000000
33
```

Base64 deconding
```sh
$ rax2 -D ZQBlAA== | rax2 -S
65006500
```

Randomart:
```sh
$ rax2 -K 90203010
+--[0x10302090]---+
|Eo. . |
Expand Down