Netgear router unpacking and packaging process
Environment setup
First, you need to configure the environment. The configured environment is as follows:
- binwalk is used to unpack
- qemu is used for debugging after packaging to prevent routers from becoming bricks
- firmware-mod-kit is used for packaging,
https://github.com/mirror/firmware-mod-kit
downloading and decompressing
# 进入源码目录
cd firmware-mod-kit/src
# 执行configure文件生成Makefile文件然后make编译生成可执行文件
./configure && make
Router unpack
Router unpacking is relatively simple, binwalk or firmware-mod-kit
binwalk unpacking does not know whether it can be repacked:
binwalk XR300-V1.0.3.34_10.3.27.chk
If binwalk can output file parsing information, then
binwalk -e XR300-V1.0.3.34_10.3.27.chk
The file after unpacking is as follows:
squashfs-root is the file system, 56 should be the offset
Unpack the firmware-mod-kit and repack it:
./extract-firmware.sh XR300-V1.0.3.34_10.3.27.chk
But it prompted an error. .
Router package
Because the firmware-mod-kit unpacking error occurred, try to pack with the result of binwalk.