Skip to content

Commit

Permalink
linux: Relax injector's libc matching for Android
Browse files Browse the repository at this point in the history
Due to how APEXes are bind-mounted.
  • Loading branch information
amor-riscure authored and oleavr committed Jan 23, 2025
1 parent da58033 commit e181785
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/linux/frida-helper-backend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,17 @@ 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 = false;
if (remote_libc != null) {
bool same_device = remote_libc.identity.split (":")[0] == local_libc.identity.split (":")[0];
bool same_inode = remote_libc.identity.split (" ")[1] == local_libc.identity.split (" ")[1];
bool same_path = remote_libc.path == local_libc.path;
same_libc = same_device && same_inode && same_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 e181785

Please sign in to comment.