Skip to content

Print hex encoded string in text

printf $(cat file.txt | tr -d '\n')

Cross compile with - mingw32

i586-mingw32msvc-gcc a.c
wine a.exe

Passing binary data as arguments

command $(python -c 'print ...')

Passing binary data as standard input

python -c 'print ...' | command

Use file as input and then read from standard input

cat file - | command
python -c 'print ...' | cat file - | command    

Printing shell code

(Bash) echo -e '\x31\xc0\x50\x68\x2f...'
(Python) python -c 'print "\x31\xc0\x50\x68\x2f..."'
(Perl) perl -e 'print "\x31\xc0\x50\x68\x2f..."'