objection icon indicating copy to clipboard operation
objection copied to clipboard

Architecture detection edge cases

Open dnet opened this issue 6 years ago • 1 comments

There's a problematic edge case when patching Android APKs:

  • If the device connected to the PC is 64-bit ARM but
  • the application has shared objects for 32-bit ARM only and
  • no architecture is specified explicitly (triggering autodetection),

then Objection injects the 64-bit ARM version of Frida gadget, but this will lead to a crash as soon as the app tries to load any of its 32-bit ARM shared objects. Of course, correcting this manually is pretty easy by specifying the correct architecture explicitly, however adding a simple check would spare the confusion and minutes lost to debugging.

Just check what architectures the APK supplies shared objects for and take that into account along with the architecture autodetection, a bit like how TLS stacks take the intersection of cipher suites offered by the client and supported by the server.

dnet avatar Feb 21 '19 14:02 dnet

Thanks for the report. Indeed, this is an edge case I also ran into end last year. I suppose this is a step we can add after the patcher unpacks a target APK.

leonjza avatar Feb 21 '19 16:02 leonjza