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

`Module.load()` fails to return a handle to the loaded module. #1029

Open
leonjza opened this issue Sep 27, 2019 · 0 comments

Comments

@leonjza
Copy link
Contributor

commented Sep 27, 2019

I have a dylib in an iOS applications Documents directory. When loading with Module.load(dylibPath);, an exception is thrown as follows:

Error: unable to find module '/var/mobile/Containers/Data/Application/87C72D23-BA24-4636-9E52-54DC14072D47/Documents/m.dylib'
    at Object.value [as getModuleByName] (frida/runtime/core.js:353:15)
    at Function.value [as load] (frida/runtime/core.js:221:22)
    at /m.js:26:34
    at performScheduledWorkItem (frida/node_modules/frida-objc-bridge/index.js:158:1)

While confusing at first, when running Process.enumerateModules();, the dylib actually did load successfully and could be used as normal:

    {
        "base": "0x116bc4000",
        "name": "m.dylib",
        "path": "/private/var/mobile/Containers/Data/Application/4F0836B4-F36A-4E8F-AC80-E0B6293A4AD1/Documents/m.dylib",
        "size": 622592
    },

Some investigation revealed that once loaded, a call to Process.getModuleByName(moduleName) is made with moduleName being the full path to the dylib that got loaded originally and not just m.dylib. This fails and causes the error above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.