1RAX2(1) BSD General Commands Manual RAX2(1)
2
4 rax2 — radare base converter
5
7 rax2 [-ebBsSvxkKh] [[expr] ...]
8
10 This command is part of the radare project.
11
12 This command allows you to convert values between positive and negative
13 integer, float, octal, binary and hexadecimal values.
14
16 -b Convert from binary string to character (rax2 -b 01000101)
17
18 -k Keep the same base as the input data
19
20 -e Swap endian.
21
22 -F Read C strings from stdin and output in hexpairs. Useful to
23 load shellcodes
24
25 -i Dump stdin to C array in stdout (xxd replacement)
26
27 -I Convert LONG to/from IP ADDRESS
28
29 -l Append newline to the decoded output for human friendly-ness
30
31 -K Show randomart key asciiart for values or hexpairs
32
33 -r Show the same output as the r2's `? 0x804` command. When
34 combined with -S (-rS) it will print r2 commands to write the
35 actual binary into radare2
36
37 -s Convert from hex string to character (rax2 -s 43 4a 50)
38
39 -S Convert from character to hex string (rax2 -S C J P)
40
41 -n Show hexpairs from integer value
42
43 -N Show hexadecimal C string from integer value
44
45 -u Convert given value to human readable units format
46
47 -v Show program version
48
49 -x Convert a string into a hash
50
51 -h Show usage help message
52
53 -o Convert from octal string to char (rax2 -o 162 62)
54
56 Force output mode (numeric base)
57
58 =f floating point
59 =2 binary
60 =3 ternary
61 =8 octal
62 =10 decimal
63 =16 hexadecimal
64
65 Available variable types are:
66
67 int -> hex rax2 10
68 hex -> int rax2 0xa
69 -int -> hex rax2 -77
70 -hex -> int rax2 0xffffffb3
71 int -> bin rax2 b30
72 bin -> int rax2 1010d
73 float -> hex rax2 3.33f
74 hex -> float rax2 Fx40551ed8
75 oct -> hex rax2 35o
76 hex -> oct rax2 Ox12 (O is a letter)
77 bin -> hex rax2 1100011b
78 hex -> bin rax2 Bx63
79
80 With no arguments, rax2 reads values from stdin. You can pass one or more
81 values as arguments.
82
83 $ rax2 33 0x41 0101b
84 0x21
85 65
86 0x5
87
88 You can do 'unpack' hexpair encoded strings easily.
89
90 $ rax2 -s 41 42 43
91 ABC
92
93 And it supports some math operations.
94
95 $ rax2
96 0x5*101b+5
97 30
98
99 It is a very useful tool for scripting, so you can read floating point
100 values, or get the integer offset of a jump or a stack delta when analyz‐
101 ing programs.
102
104 radare2(1)
105
107 Written by pancake <pancake@nopcode.org>.
108
109 Dec 28, 2023