the issues about directly acess of mtdblock device in the emulation of d-link dap1360 firmware
ziliang8658 opened this issue · comments
hi, thanks for your great work in FirmAE,
dap1360.zip
reecently I was trying to emulate the d-link dap1360. however, the /bin/webs program cannot be started with error "read hw setting header failed". I decompile this program and found this program is trying to directly the mtdblock0 device, which I found is related to the nand flash. As your paper have described before, some linksys routers also have the same problem. So I was wondering is there way to emulate and read/write infomation in this device or assign some default values to to emulate the nand flash read/write process.
I attached the firmware and the decompile screen shot of the webs program below, please check it and give me some idaes about this , thks a lot!
Memory Technology Device (MTD) block is used to get data from a physical partition. However, sometimes the emulated environment cannot support correctly such things.
At this point, on the default emulating state, there is no data in the mtdblock
.
To read data from empty mtdblock
, before perform read, just write the data with such command echo -ne "\xff\xff\xff\xff" > /dev/mtdblock0
. Similar example in fixImage.sh on GPIO.
Please note that the data need to be written on running state (qemu run). And the preInit.sh will be a good file to add command.