License concerns when embedding script in busybox binary
Ron Yorston
rmy at pobox.com
Sun Nov 11 08:34:59 UTC 2018
Michael Conrad wrote:
>Anyone with gdb would be able to extract the table and then
>decompress it back to the original directory of scripts.
Or a script like this:
#
# Extract bzip2 encoded data embedded in the busybox binary.
#
# Such data is compressed with 'bzip -1' so the first few bytes
# should be 'BZh11AY&SY' but the leading 'BZ' is omitted.
#
# Don't bother detecting the end of the embedded data: let the
# decoding program do that.
#
# Requires GNU grep.
#
# https://stackoverflow.com/questions/4180081/binary-grep-on-linux
#
for i in $(grep -obUaP "h11AY&SY" busybox | cut -d: -f1)
do
(printf "BZ"; dd bs=1 skip=$i if=busybox) >bb_$i.bz2
done
Doing it with tools available in BusyBox is left as an exercise for
the reader...
Ron
More information about the busybox
mailing list