神油极简化刷CFE的script# Hardware - 计算机硬件
a*o
1 楼
根本不需要什么telnet,直接enable SSH就行,scp这两个文件上去/tmp:
mtd-write
new_cfe.bin
然后跑哥这个script:
#!/bin/sh
nvram get bl_version
cat /dev/mtd0 > ./old_cfe.bin
echo
echo Old CFE content:
strings old_cfe.bin | grep -e mac -e secret
echo
# Sanity checks
[ "`strings old_cfe.bin -o | grep t0mac | awk '{print $1}'`" != "2306" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep 0:mac | awk '{print $1}'`" != "3132" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep 1:mac | awk '{print $1}'`" != "5166" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep secret | awk '{print $1}'`" != "11540" ] &
& (echo unsupported cfe rev;exit)
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=1233 seek=
1233 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=1636 seek=
1647 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=2688 seek=
2710 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=8 conv=notrunc skip=4972 seek=
5005 2>/dev/null
echo
echo New CFE content:
strings old_cfe.bin | grep -e mac -e secret
echo
echo Run this command to flash CFE:
echo ./mtd-write -i new_cfe.bin -d boot
echo mtd-erase2 nvram
echo reboot
echo
mtd-write
new_cfe.bin
然后跑哥这个script:
#!/bin/sh
nvram get bl_version
cat /dev/mtd0 > ./old_cfe.bin
echo
echo Old CFE content:
strings old_cfe.bin | grep -e mac -e secret
echo
# Sanity checks
[ "`strings old_cfe.bin -o | grep t0mac | awk '{print $1}'`" != "2306" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep 0:mac | awk '{print $1}'`" != "3132" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep 1:mac | awk '{print $1}'`" != "5166" ] &&
(echo unsupported cfe rev;exit)
[ "`strings old_cfe.bin -o | grep secret | awk '{print $1}'`" != "11540" ] &
& (echo unsupported cfe rev;exit)
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=1233 seek=
1233 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=1636 seek=
1647 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=17 conv=notrunc skip=2688 seek=
2710 2>/dev/null
dd if=old_cfe.bin of=new_cfe.bin bs=1 count=8 conv=notrunc skip=4972 seek=
5005 2>/dev/null
echo
echo New CFE content:
strings old_cfe.bin | grep -e mac -e secret
echo
echo Run this command to flash CFE:
echo ./mtd-write -i new_cfe.bin -d boot
echo mtd-erase2 nvram
echo reboot
echo