frida-swift-bridge icon indicating copy to clipboard operation
frida-swift-bridge copied to clipboard

Type not found: __C.NSString

Open 0xElessar opened this issue 1 year ago • 0 comments

Hello @hot3eed ,

sorry to bother you again. But I created extremely simple class in Swift class TestString:

    "TestString": {
        "$conformances": [],
        "$methods": [
            {
                "address": "0x102b2c908",
                "name": "TestSwift2.TestString.generateSwiftString() -> Swift.String",
                "type": "Method"
            },
            {
                "address": "0x102b2c944",
                "name": "TestSwift2.TestString.generateObjectiveCString() -> __C.NSString",
                "type": "Method"
            },
            {
                "address": "0x102b2c9dc",
                "name": "TestSwift2.TestString.convertToObjectiveCString(Swift.String) -> __C.NSString",
                "type": "Method"
            },
            {
                "address": "0x102b2ca3c",
                "name": "TestSwift2.TestString.convertToSwiftString(__C.NSString) -> Swift.String",
                "type": "Method"
            },
            {
                "address": "0x102b2caf0",
                "name": "TestSwift2.TestString.__allocating_init() -> TestSwift2.TestString",
                "type": "Init"
            }
        ]
    },

However, when I try to create the object in Frida, I am getting:

[iPhone::TestSwift2 ]-> var class1 = Swift.classes.TestString
[iPhone::TestSwift2 ]-> var ins1 = class1.__allocating_init()
Error: Type not found: __C.NSString
    at untypedMetadataFor (dist/lib/macho.js:38)
    at ObjectInstance (dist/lib/types.js:414)
    at wrapper (dist/lib/callingconvention.js:120)
    at <eval> (<input>:1)

Am I missing something obvious here? Not sure why it complains about NSString, as the constructor has no defintion of it. I am using the latest version of the bridge from GIT.

thanks

0xElessar avatar Jan 20 '24 19:01 0xElessar