环境搭建

patch httpd

Tenda固件:AC18.15.03.05.05、A15.03.05.19、A15.03.05.20都需要patch其中的httpd才可以正常模拟。

首先搜索字符串"welcome"找到对应位置:

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123141258633.png

搜索函数check_network:

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123233016978.png

交叉引用:

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123233039308.png

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123233109363.png

按空格查看graph,找到对应的函数sub_2E6B8sub_2E420,版本不同函数名字不同),patch其中的关键代码check_network:

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123141426307.png

<img src="https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123141508364.png" alt="image-20240123141508364" style="zoom:50%;" />

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123141548828.png

patch后继续报错,发现还要修改一处:

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123142111341.png

将原本的指令MOV R3, R0改为MOV R3, #1

https://raw.githubusercontent.com/abcdefg-png/images/main/image-20240123142142179.png

patch的逻辑如下: