2021-03-21 22:37:31 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "==> Amending boot.img for Amazon signature verification exploit"
|
|
|
|
SOHO_HEADER_DATA='\x50\x03\x00\x00\x00\x25\xe4\x00'
|
|
|
|
SOHO_HEADER_SIZE=848
|
|
|
|
SOHO_HEADER_OFFSET=52
|
|
|
|
tempfile=$(mktemp)
|
2021-10-13 20:15:56 +00:00
|
|
|
bootimgfile=$(echo "${1}" | sed 's/initramfs/boot.img/g')
|
2021-03-21 22:37:31 +00:00
|
|
|
dd if=/dev/zero of="${tempfile}" bs=$SOHO_HEADER_SIZE count=1
|
|
|
|
printf "%b" $SOHO_HEADER_DATA | dd of="${tempfile}" bs=$SOHO_HEADER_OFFSET seek=1 conv=notrunc
|
|
|
|
cat "${bootimgfile}" >> "${tempfile}"
|
|
|
|
mv "${tempfile}" "${bootimgfile}"
|