Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

darwin: Fix sysroot on simulator #809

Merged
merged 1 commit into from
Jul 15, 2024
Merged

darwin: Fix sysroot on simulator #809

merged 1 commit into from
Jul 15, 2024

Conversation

ChiChou
Copy link
Contributor

@ChiChou ChiChou commented Jul 14, 2024

The patch for frida/frida#2763

frida has stoppped working on iOS simulators for months, getting module not found at "/usr/lib/libSystem.B.dylib" error. The root cause is the logic for getting sysroot stops working.

Had some discussion with @mrmacete yesterday at 0x41con. We talked about reading env remotely, but surprisingly found the current implementation has a cheat to simply detect the location of dyld_sim. However the assumtion that dyld_sim is the first loaded image is no longer true. We need one more loop to initialize sysroot before putting them to the lookup table.

Also I believe this is the correct patch for frida/frida-swift-bridge#18

Kudos to Francesco for helping me to set up the latest env and understand the source! 🙌

@ChiChou
Copy link
Contributor Author

ChiChou commented Jul 14, 2024

This pull request has no test code yet. I wonder if it's possible for the CI to run the simulator..

the assumtion that dyld_sim is the first loaded image is no longer true
fix by one more pass before indexing loaded images
@ChiChou
Copy link
Contributor Author

ChiChou commented Jul 14, 2024

Note that the module lookup logic is still problematic under other cases. Here are 2 examples:

  1. On macOS, turn off SIP and attach to WhatsApp Latest WhatsApp app seems working
  2. Some jailbreak users reported that it happens to their iOS too Issue attaching to iPhone 15 Simulator processes  frida#2763 (comment)

They both throw the following exception, but the root cause should be different.

module not found at "/usr/lib/libSystem.B.dylib"

@oleavr oleavr merged commit 235c7a5 into frida:main Jul 15, 2024
31 of 32 checks passed
@oleavr
Copy link
Member

oleavr commented Jul 15, 2024

Ooh, great catch! Thanks! 🙌

@ChiChou ChiChou deleted the fixsim branch July 15, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants