Skip to content

Commit

Permalink
fix libc comparison in android
Browse files Browse the repository at this point in the history
  • Loading branch information
amor-riscure committed Jan 21, 2025
1 parent da58033 commit 2a6d2ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/linux/frida-helper-backend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,14 @@ namespace Frida {
uint64 remote_mmap = 0;
uint64 remote_munmap = 0;
ProcMapsEntry? remote_libc = ProcMapsEntry.find_by_path (pid, local_libc.path);
#if ANDROID
bool same_libc = remote_libc != null &&
remote_libc.identity.split (":")[0] == local_libc.identity.split (":")[0] && // match dev
remote_libc.identity.split (" ")[1] == local_libc.identity.split (" ")[1] && // match inode
remote_libc.path == local_libc.path; // match path
#else
bool same_libc = remote_libc != null && remote_libc.identity == local_libc.identity;
#endif
if (same_libc) {
remote_mmap = remote_libc.base_address + mmap_offset;
remote_munmap = remote_libc.base_address + munmap_offset;
Expand Down

0 comments on commit 2a6d2ba

Please sign in to comment.