Skip to content

Commit

Permalink
linux: Improve injector's MUSL compatibility
Browse files Browse the repository at this point in the history
The loader string could look different on different platforms.
  • Loading branch information
Harry Gunnarsson authored and oleavr committed Oct 21, 2024
1 parent e8ee891 commit e2b4628
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 2 deletions.
Binary file modified src/linux/helpers/bootstrapper-arm.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-arm64.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips64.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mips64el.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-mipsel.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-x86.bin
Binary file not shown.
Binary file modified src/linux/helpers/bootstrapper-x86_64.bin
Binary file not shown.
8 changes: 6 additions & 2 deletions src/linux/helpers/bootstrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ frida_infer_rtld_flavor_from_filename (const char * name)
if (frida_str_has_prefix (name, "ld-uClibc"))
return FRIDA_RTLD_UCLIBC;

if (strcmp (name, "libc.so") == 0)
if (strcmp (name, "libc.so") == 0 ||
frida_str_has_prefix (name, "libc.musl") ||
frida_str_has_prefix (name, "ld-musl"))
return FRIDA_RTLD_MUSL;

if (strcmp (name, "ld-android.so") == 0)
Expand Down Expand Up @@ -607,7 +609,9 @@ frida_path_is_libc (const char * path, FridaRtldFlavor rtld_flavor)
else
name = path;

return frida_str_has_prefix (name, "libc.so");
return frida_str_has_prefix (name, "libc.so") ||
frida_str_has_prefix (name, "libc.musl") ||
frida_str_has_prefix (name, "ld-musl");
}

static ssize_t
Expand Down

0 comments on commit e2b4628

Please sign in to comment.