New Features
1. Added 4 APIs for registering/unregistering pre/post
callbacks of soinfo::call_constructors
and soinfo::call_destructors
shadowhook_register_dl_init_callback()
,shadowhook_unregister_dl_init_callback()
.shadowhook_register_dl_fini_callback()
,shadowhook_unregister_dl_fini_callback()
.
Bug Fixes
1. Fixed the IT instruction fix bug under Thumb instructions
The fix for the IT instruction under the ne
condition under Thumb has been corrected.
In the previous version, because the incorrect use of memset would make it->firstcond
always 0, only the eq
case could be fixed correctly in the conditional judgment.
2. Fix the memory leak bug caused by the thread re-entering the proxy function
Currently, if the function after pthread_key_clean_all
is hooked, the proxy function execution will be skipped and no memory leak will be caused.
In the previous version: if the proxy function is run after the thread's pthread_key_clean_all
call, if there are more than SH_HUB_THREAD_MAX
cached hub_stack
at this time, new memory will be mmaped out through sh_hub_stack_create
and will not be released.
Improvement
- Upgrade the versions of NDK, CMake, gradle and AGP.
新特性
1. 新增4个API,用于注册 / 反注册 soinfo::call_constructors
和soinfo::call_destructors
的 pre /post
回调
shadowhook_register_dl_init_callback()
,shadowhook_unregister_dl_init_callback()
。shadowhook_register_dl_fini_callback()
,shadowhook_unregister_dl_fini_callback()
。
Bugs 修复
1. 修复了Thumb指令下的IT指令修复bug
针对IT指令在Thumb下的ne
条件下的指令修复进行了修正。
在之前的版本中因为memset的错误使用会使得it->firstcond
一直为0,所以在条件判断中只能正确修复eq
的情况。
2. 修复线程再次进入代理函数引起的内存泄漏bug
目前如果hook了在pthread_key_clean_all
之后的函数将会跳过代理函数执行,不引起内存泄漏。
在之前的版本中:如果代理函数在线程的pthread_key_clean_all
调用之后运行,如果此时已经超过SH_HUB_THREAD_MAX
个缓存的hub_stack
,会通过sh_hub_stack_create
mmap出新的内存并且不会释放。
改进
- 升级 NDK,CMake,gradle 和 AGP 的版本。