shadowhook v1.0.6
Incompatible changes
1. Operation record is no longer enabled by default.
Added API and initialization parameters to enable and disable operation record.
Writing operation records every time hook and unhook will have some impact on performance. It is recommended to sample or enable operation records according to actual needs.
Improve
1. No more attempt to get timezone via localtime_r() in operation record.
localtime_r() will call getenv() to access the global environ, if there are concurrent setenv() calls at this time, a crash may occur, because in bionic, the access to environ is not protected by a lock.
What we can do currently is try to avoid calling getenv() and setenv().
2. In unique mode, an abort() will be triggered if a proxy function written for shared mode is used.
Doing so allows for clearer and earlier detection of such do-not-use issues.
New features
1. Add API to get ShadowHook version number.
At the same time, in the case of only ELF files, the version number of ShadowHook can also be determined in the following ways:
llvm-strings libshadowhook.so | grep "shadowhook version"
不兼容的变更
1. 默认不再开启操作记录。
增加了 API 和初始化参数用于开启和关闭操作记录。
每次 hook 和 unhook 时都写操作记录对性能会有一些影响,建议根据实际需要采样的或有针对性的开启操作记录。
改进
1. 操作记录中不再尝试通过 localtime_r() 获取时区。
localtime_r() 会调用 getenv() 来访问全局的 environ,如果此时存在并发的 setenv() 调用,则可能会发生崩溃,因为对 environ 的访问在 bionic 中没有锁保护。
我们目前能做的是尽量避免调用 getenv() 和 setenv()。
2. 在 unique 模式中,如果使用为 shared 模式编写的 proxy 函数,将触发主动 abort()。
这样做可以更明确和更早的发现这类勿用问题。
新特性
1. 增加 API 用于获取 ShadowHook 的版本号。
同时,在仅有 ELF 文件的情况下,也可以通过以下方式确定 ShadowHook 的版本号:
llvm-strings libshadowhook.so | grep "shadowhook version"