运行Ghidra
ghidraRun.bat
创建工程
File -> New Project -> Non-Shared Project -> Next -> Finish
导入lib
File -> Import File -> xxx.lib
反汇编lib
双击工程下的xxx_1.o文件 -> Yes -> Analyze -> 等待反汇编完成 -> Yes -> OK
已进入CodeBrowser窗口
工具栏:Windows -> Listing: xxx_1.o (显示汇编语言预览)
工具栏:Windows -> Decompile: entry (显示伪代码)
修改dll
定位到修改行,右键 -> Patch Instruction -> 修改完毕回车 -> Ctrl+S 保存
导出
File -> Export Program -> Format: Row Bytes 导出.o文件
将修改后的xxx_1.o文件打包进xxx.lib
```
#ar r libmylib.a modified.o # 仅替换 modified.o
ar r xxx.lib xxx_1.o # 仅替换 xxx_1.o
```