From e18178586711b71cd1e4026ccfe55546b97d8ce7 Mon Sep 17 00:00:00 2001 From: Mohamed Amine Amor <149579187+amor-riscure@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:58:42 +0100 Subject: [PATCH] linux: Relax injector's libc matching for Android Due to how APEXes are bind-mounted. --- src/linux/frida-helper-backend.vala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/linux/frida-helper-backend.vala b/src/linux/frida-helper-backend.vala index 38b72bb41..8e5b88a45 100644 --- a/src/linux/frida-helper-backend.vala +++ b/src/linux/frida-helper-backend.vala @@ -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;