Android 12 hook 后 cfi_check 崩溃显著增加
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, c
- Domain
- mobile-dev, operating-systems
Research direction
Review the bytehook_hook_partial calls for libc sendto and recvfrom, the allow_filter function, and the difference between delayed hooking and the Application.onCreate timing used by the example. Reproduce on Android 12 with armeabi-v7a if possible; done means identifying the conditions associated with the increased cfi_check crashes and documenting a confirmed cause or a minimal reproduction.
Written by the indexing model from the issue text.
Description
bytehook Version
1.0.10
Android OS Version
12
Android ABIs
armeabi-v7a
Device Manufacturers and Models
定制安卓设备
Describe the Bug
目前遇到的情况是,启用hook后,极易出现 cfi_check 崩溃,关闭后则几乎不会出现 cfi_check 崩溃。希望获得大佬的指定和帮助。
hook代码如下,对libc的socket接口进行了hook。其他一切配置都是按照例子里面的调用方法。
有一点疑惑的点:调用hook的时机不是在 Application.onCreate. 而是在App启动后的一段时间才hook的,和例子有些不同,不知道这样调用会有什么影响。
static bool allow_filter(const char *caller_path_name, void *arg) {
(void)arg;
if (NULL != strstr(caller_path_name, "libc.so")) return false;
if (NULL != strstr(caller_path_name, "libbase.so")) return false;
if (NULL != strstr(caller_path_name, "liblog.so")) return false;
if (NULL != strstr(caller_path_name, "libunwindstack.so")) return false;
if (NULL != strstr(caller_path_name, "libutils.so")) return false;
// ......
return true;
}
if (!sock_sendto_stub) {
sock_sendto_stub = bytehook_hook_partial(allow_filter, NULL, "libc.so", "sendto" , sock_sendto_proxy_auto, sock_sendto_hooked_callback, NULL);
}
if (!sock_recvfrom_stub) {
sock_recvfrom_stub = bytehook_hook_partial(allow_filter, NULL, "libc.so", "recvfrom" , sock_recvfrom_proxy_auto, sock_recvfrom_hooked_callback, NULL);
}
- Dominant language
- C
- Stars
- 2.6k
- Forks
- 407
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytedance/bhook
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
5700模组网络优先级问题Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
luainkernel/lunatik#2372 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
ly05010419/MacNativeGames#1796 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day