mirror of
https://github.com/frida/frida-core.git
synced 2026-11-08 01:49:11 -10:00
linux: Improve injector to handle faux .so mappings
So frida_find_library_base() still does the right thing if the target process has a shared mapping for e.g. “libc.so”. Co-authored-by: Ole André Vadla Ravnås <[email protected]>
This commit is contained in:
1 parent
b5001c88fb
commit
5e8314ffc0
1 file changed
+5
-4
@@ -3067,14 +3067,15 @@ frida_find_library_base (pid_t pid, const gchar * library_name, gchar ** library
|
||||
while (result == 0 && fgets (line, line_size, fp) != NULL)
|
||||
{
|
||||
GumAddress start;
|
||||
gchar perms[5];
|
||||
gint n;
|
||||
|
||||
n = sscanf (line, "%" G_GINT64_MODIFIER "x-%*x %*s %*x %*s %*s %s", &start, path);
|
||||
if (n == 1)
|
||||
n = sscanf (line, "%" G_GINT64_MODIFIER "x-%*x %s %*x %*s %*s %s", &start, perms, path);
|
||||
if (n == 2)
|
||||
continue;
|
||||
g_assert (n == 2);
|
||||
g_assert (n == 3);
|
||||
|
||||
if (path[0] == '[')
|
||||
if (perms[3] == 's' || path[0] == '[')
|
||||
continue;
|
||||
|
||||
if (strcmp (path, library_name) == 0)
|
||||
|
||||
Reference in new issue
Block a user