Swift reverse engineering:swift function name rule?

前端 未结 2 1434
后悔当初
后悔当初 2021-02-02 02:49

I have a question about swift function name rule. As I tried in IDA Pro to analyze a iOS app (Maybe OS X is the same case) written in swift, such as swift-2048, I got function n

2条回答
  •  伪装坚强ぢ
    2021-02-02 03:23

    Using the swift-demangle command line tool you can see the difference between the two functions.

    _TToFC10swift_204811AppDelegate27applicationWillResignActivefS0_FCSo13UIApplicationT_ ---> @objc swift_2048.AppDelegate.applicationWillResignActive (swift_2048.AppDelegate)(ObjectiveC.UIApplication) -> ()
    
    _TFC10swift_204811AppDelegate27applicationWillResignActivefS0_FCSo13UIApplicationT_ ---> swift_2048.AppDelegate.applicationWillResignActive (swift_2048.AppDelegate)(ObjectiveC.UIApplication) -> ()
    

    _T prefixes all swift functions and it looks like To corresponds to the function having the @objc attribute.

    Unfortunately, I don't have enough knowledge of the internals of swift and the objective-c runtime to tell you what each of these functions does. I think it's safe to assume it's part of the objective-c to swift bridging process though.

提交回复
热议问题