静态库直接编译到目标文件,更新需要重新编译
动态库只链接符号,动态载入运行,更新只需重新编译动态库,重新启动加载即可
导出和隐藏符号
- static
- export_list
- -fvisibility=hidden
函数调用顺序
- ` attribute((constructor))`
- main
- ` attribute((destructor))`
注入可执行文件
- LC_LOAD_DYLIB
- insert_dylib:
insert_dylib --weak --all-yes @executable_path/test.dylib Payload/WeChat.app/WeChat
- otool -L :查看是否注入成功