Skip to content

Add support for swift apps #8

Description

@sprout42

I tried this on a swift iOS app and it didn't work

First issue is that the __objc_classname and __objc_methtype sections don't exist in the sections:

>>> bv.sections.keys()
dict_keys(['.extern', '__bss', '__common', '__const', '__const#19', '__cstring', '__data', '__eh_frame', '__got', '__la_symbol_ptr', '__objc_classlist', '__objc_classrefs', '__objc_const', '__objc_data', '__objc_imageinfo', '__objc_methname', '__objc_selrefs', '__stub_helper', '__stubs', '__swift5_assocty', '__swift5_builtin', '__swift5_capture', '__swift5_fieldmd', '__swift5_proto', '__swift5_protos', '__swift5_reflstr', '__swift5_typeref', '__swift5_types', '__text', '__unwind_info'])

it would appear that __objc_classlist is the section that contains references to the objective-C class information. There are also many sections that hold information about swift metadata, but I am still learning how to pull them apart.

It appears that swift name mangling follows different rules that are currently supported. Some examples:

$ echo '_$sypSgWOb' | xcrun swift-demangle
outlined init with take of Any?
$ echo '_$sSo10CFErrorRefaMa' | xcrun swift-demangle
type metadata accessor for __C.CFErrorRef

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions