ByteHook v1.0.7 #65
caikelun
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bugs fixed
1. Fix the bug that part of ELF cannot be hooked in Android 4.x.
The first LOAD segment of ELF may be read-only (use the linker option
--rosegment
), and the/proc/self/maps
at this time may look like this:In previous ByteHook versions, this type of ELF could not be hooked in Android 4.x.
2. Fix the bug that the wrong initialization state may be returned when
ByteHook#init()
is called concurrently.It may actually be still being initialized, but it returns a state that has been initialized.
Improve
1. Avoid additional acquisition of the linker's global mutex lock during initialization.
ByteHook needs to obtain several symbol addresses in
libc.so
throughdlopen
anddlsym
during initialization. These operations need to hold the linker's global mutex lock. We moved the above operations to.init_array
oflibbytehook.so
.Bugs 修复
1. 修复 Android 4.x 中无法 hook 部分 ELF 的 bug。
ELF 的第一个 LOAD segment 可能是只读的(用链接器选项
--rosegment
),此时的/proc/self/maps
大概是这样的:在之前的 ByteHook 版本中,在 Android 4.x 中这种类型 ELF 无法被 hook。
2. 修复了并发调用
ByteHook#init()
时可能返回错误的初始化状态的 bug。可能实际还处在初始化中,但是却返回了已经初始化完成的状态。
改进
1. 避免在初始化期间额外获取 linker 的全局 mutex 锁。
ByteHook 需要在初始化时通过
dlopen
和dlsym
获取libc.so
中的几个符号地址,这些操作需要持有 linker 的全局 mutex 锁,我们将上述操作移动到了libbytehook.so
的.init_array
中。This discussion was created from the release ByteHook v1.0.7.
Beta Was this translation helpful? Give feedback.
All reactions