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

Need to exclude the "shared" libc.so mapping #1124

Merged
merged 1 commit into from
Nov 13, 2024
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
21 changes: 16 additions & 5 deletions src/linux/frida-helper-backend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3333,8 +3333,13 @@ namespace Frida {
var iter = MapsIter.for_pid (pid);
while (iter.next ()) {
string candidate_path = iter.path;
if (candidate_path == path)
if (candidate_path == path) {
#if ANDROID
if (candidate_path == Gum.Process.query_libc_name () && iter.flags[3] == 's')
continue;
#endif
return new ProcMapsEntry (iter.start_address, candidate_path, iter.identity);
}
}

return null;
Expand All @@ -3357,18 +3362,24 @@ namespace Frida {
}
}

public string identity {
public string flags {
owned get {
return info.fetch (3);
}
}

public string path {
public string identity {
owned get {
return info.fetch (4);
}
}

public string path {
owned get {
return info.fetch (5);
}
}

public static MapsIter for_pid (uint pid) {
return new MapsIter (pid);
}
Expand All @@ -3380,8 +3391,8 @@ namespace Frida {
return;
}

if (!/^([0-9a-f]+)-([0-9a-f]+) \S{4} [0-9a-f]+ ([0-9a-f]{2,}:[0-9a-f]{2,} \d+) +([^\n]+)$/m.match (contents,
0, out info)) {
if (!/^([0-9a-f]+)-([0-9a-f]+) (\S{4}) [0-9a-f]+ ([0-9a-f]{2,}:[0-9a-f]{2,} \d+) +([^\n]+)$/m.match (
contents, 0, out info)) {
assert_not_reached ();
}
}
Expand Down
Loading