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 -s Convert from hex string to character (rax2 -s 43 4a 50)
34
35 -S Convert from character to hex string (rax2 -S C J P)
36
37 -n Show hexpairs from integer value
38
39 -N Show hexadecimal C string from integer value
40
41 -u Convert given value to human readable units format
42
43 -v Show program version
44
45 -x Convert a string into a hash
46
47 -h Show usage help message
48
49 -o Convert from octal string to char (rax2 -o 162 62)
50
52 Force output mode (numeric base)
53
54 =f floating point
55 =2 binary
56 =3 ternary
57 =8 octal
58 =10 decimal
59 =16 hexadecimal
60
61 Available variable types are:
62
63 int -> hex rax2 10
64 hex -> int rax2 0xa
65 -int -> hex rax2 -77
66 -hex -> int rax2 0xffffffb3
67 int -> bin rax2 b30
68 bin -> int rax2 1010d
69 float -> hex rax2 3.33f
70 hex -> float rax2 Fx40551ed8
71 oct -> hex rax2 35o
72 hex -> oct rax2 Ox12 (O is a letter)
73 bin -> hex rax2 1100011b
74 hex -> bin rax2 Bx63
75
76 With no arguments, rax2 reads values from stdin. You can pass one or more
77 values as arguments.
78
79 $ rax2 33 0x41 0101b
80 0x21
81 65
82 0x5
83
84 You can do 'unpack' hexpair encoded strings easily.
85
86 $ rax2 -s 41 42 43
87 ABC
88
89 And it supports some math operations.
90
91 $ rax2
92 0x5*101b+5
93 30
94
95 It is a very useful tool for scripting, so you can read floating point
96 values, or get the integer offset of a jump or a stack delta when analyz‐
97 ing programs.
98
100 radare2(1), rahash2(1), rafind2(1), rabin2(1), radiff2(1), ragg2(1),
101 rarun2(1), rasm2(1)
102
104 Written by pancake <pancake@nopcode.org>.
105
106 Dec 28, 2020