strtools
A tool written in C to convert number bases to human readable string and vice versa.
Usage
Compile
make
Help
strtools -h
Output:
Usage: strtools <type|conversion> <input> [ data | file ] -o outfile.txt
|CLI options|:-
type/conversion:
-O converts octal dump to string.
-B converts binary dump to string.
-D converts decimal dump to string.
-X converts hexadecimal dump to string.
[if -s flag is specified, it converts string to base<int>.]
input:
-i takes next argument as data string.
-f takes next argument as filename.
optional:
-o takes next argument as filename.
(if filename is null, it's set to strtools_out as filename.)
[if '-o' is not used, result is printed to STDOUT.]
Binary to String
./strtools -B -f exfiles/bin.txt
Output:
I use arch btw thank you.
String to Binary
./strtools.exe -s -B -f exfiles/ones_and_zeroes
Output:
110001 100111 1110011 100000 1100001 1101110 1100100 100000 110000 100111 1110011
Octal to String
./strtools -O -f exfiles/octal.txt
Output:
https://www.youtube.com/watch?v=GBIIQ0kP15E
String to Octal
./strtools -s -O -f exfiles/oct_out
Output:
143 157 156 164 162 151 142 165 164 145 40 72 51
Hexadecimal to String
./strtools -X -i "53 74 61 72 20 74 68 69 73 20 70 72 6f 6a 65 63 74 20 3a 29"
Output:
Star this project :)
String to Hexadecimal
./strtools -s -X -f exfiles/AITO
Output:
41 73 74 72 6F 6E 61 75 74 20 49 6E 20 54 68 65 20 4F 63 65 61 6E 2E
Decimal to String
./strtools -D -i "72 97 118 101 32 97 32 110 105 99 101 32 100 97 121 32 40 59"
Output:
Have a nice day (;
String to Decimal
./strtools -s -D -f exfiles/AITO
Output:
65 115 116 114 111 110 97 117 116 32 73 110 32 84 104 101 32 79 99 101 97 110 46
Redirecting output to a file:
Using the redirection operator↴
./strtools -X -i "63 6f 6f 6c 20 73 68 69 74" > hex_out.txt
Using the -o argument with a filename↴
./strtools -O -i "143 157 156 164 162 151 142 165 164 145 40 72 51" -o oct_out
Using the -o argument without a filename↴
./strtools -D -i "105 100 107 32 105 100 99 46" -o
ps: "-o" without a parameter uses the default filename 'strtools_out'
License
MIT
Copyright for portions of project strtools are held by [Github Account SynAcktraa Owner, 2022] as part of project strtools
All other copyright for project strtools are held by [Github Account SynAcktraa Owner, 2022].
Check the LICENSE for more details.