Skip to content

Instantly share code, notes, and snippets.

@OothecaPickle
Last active February 1, 2025 07:37
Show Gist options
  • Save OothecaPickle/66a87b7f43bd0067ee06e86b3f2a09df to your computer and use it in GitHub Desktop.
Save OothecaPickle/66a87b7f43bd0067ee06e86b3f2a09df to your computer and use it in GitHub Desktop.
unbrick meraki mr32/mr72
hexdump -ve '1/1 "%.2x "' libgcc_s.so.1 | sed -e "s/.\{999\}/&\n/g" | pbcopy
hexdump -ve '1/1 "%.2x "' libc.so | sed -e "s/.\{999\}/&\n/g" | pbcopy
hexdump -ve '1/1 "%.2x "' ubiupdatevol | sed -e "s/.\{999\}/&\n/g" | pbcopy
mkdir tmp
mount -t tmpfs tmpfs /tmp
cp /proc/self/fd/0 /tmp/libgcc1
cp /proc/self/fd/0 /tmp/libc1
cp /proc/self/fd/0 /tmp/ubiupdatevol1
tr -d "\n" < /tmp/libgcc1 > /tmp/libgcc2
tr -d "\n" < /tmp/libc1 > /tmp/libc2
tr -d "\n" < /tmp/ubiupdatevol1 > /tmp/ubiupdatevol2
for i in $(cat /tmp/libgcc2); do echo -en "\x$i"; done > /lib/libgcc_s.so.1
for i in $(cat /tmp/libc2); do echo -en "\x$i"; done > /lib/libc.so
for i in $(cat /tmp/ubiupdatevol2); do echo -en "\x$i"; done > /tmp/ubiupdatevol
ln -s ./libc.so /lib/ld-musl-arm.so.1
chmod +x /lib/*
chmod +x /tmp/ubiupdatevol
dd if=/dev/ubi0_1 of=/tmp/part.old bs=4096
/tmp/ubiupdatevol /dev/ubi0_0 /tmp/part.old
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment