I have a small program where I wish to pass shellcode as argument. In the shellcode, there is a necessity to pass \\x00. I tried the following command:
./pro
You can try putting the shellcode in a file and then read it back and pass it to the executable.
something like:
$ cat shellcode.txt
\xb5\x06\x40\x00\x00\x00\x00\x00
$ perl -e ' $a = `cat shellcode.txt`; chomp($a); print $a x 10; '
\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00
\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00
\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00
\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00\xb5\x06\x40\x00\x00\x00\x00\x00
use the above perl cmdline as argument to the program
$ ./program $(perl -e ' $a = `cat shellcode.txt`; chomp($a); print $a x 10; ')