sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.4k stars 848 forks source link

Frida 12.1.0 for iOS breaks "String(some_nsobject)" #127

Closed pachoo closed 6 years ago

pachoo commented 6 years ago

I noticed that with Frida 12.1.0 that objection explore blows up with a message [hook failure] cannot string coerce Symbol.

this is happening in objection/hooks/ios/device-information.js where the lines constructing a String from an NSObjecty thing no longer work.

            data: {
                applicationName: String(NSBundle.mainBundle().objectForInfoDictionaryKey_('CFBundleIdentifier')),
                deviceName: String(UIDevice.currentDevice().name()),
                systemName: String(UIDevice.currentDevice().systemName()),
                model: String(UIDevice.currentDevice().model()),
                systemVersion: String(UIDevice.currentDevice().systemVersion()),
                identifierForVendor: String(UIDevice.currentDevice().identifierForVendor())
            }

Switching to using .toString() instead seems to fix the issue.

I don't know if this behavioral change in Frida 12.1.0 was intentional or not, but there should be no issue changing these.

leonjza commented 6 years ago

Oh snap thanks for the report! Will make some time today to quickly test this one out and push a fix.

leonjza commented 6 years ago

Should be fixed in v1.4.2. pip3 install --upgrade objection to get it!

pachoo commented 6 years ago

@leonjza thanks! Next time I'll fork and actually submit a PR :)

sushi2k commented 6 years ago

Awesome. Thanks @leonjza! Was just running in this issue and you already fixed it 👍