Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Android 4.x因未删除换行符导致无法解析/proc/self/maps的BUG #92

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bytehook/src/main/cpp/bh_dl_iterate.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static int bh_dl_iterate_by_maps(int (*callback)(struct dl_phdr_info *, size_t,
bool try_next_line = false;

while (fgets(line, sizeof(buf1), maps)) {
bh_util_trim_ending(line);
// Parsing maps directly has too much uncertainty, so it needs to be strict.
if (!bh_util_ends_with(line, BH_CONST_BASENAME_APP_PROCESS) && !bh_util_ends_with(line, ".so")) continue;

Expand Down