binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Handle swift 5 metadata

Open seekbytes opened this issue 1 year ago • 3 comments

Swift 5 is the first version of Swift programming language that includes a stable ABI. In the ABI, part of the information defined were 'metadata', additional information that are included in special sections, are used to define generic types. The types can give a lot of context, especially when a programming language as Swift is used.

This issue is created to track support of parsing values provided by metadata of swift 5.

Some links for people that are not aware of swift metadata:

  • https://github.com/apple/swift/blob/main/docs/ABI/TypeMetadata.rst
  • https://knight.sc/reverse%20engineering/2019/07/17/swift-metadata.html

Related issues: #3902 #3914

seekbytes avatar Jun 13 '24 19:06 seekbytes

The metadata that swift has once compiled is extremely useful and I believe there's a part of it that even relates to Objective-C & Swift interop...

ExecuteProtect avatar Jun 13 '24 22:06 ExecuteProtect

The metadata in Swift binaries is priceless but it also has some structural overlapping with Objective-C, so I'm not sure if it would get it's own workflow or it would be more intuitive for it to be an Activity (I believe that's what they're called) and combined with the current Objective-C workload, renamed to something such as Apple ABI support.

ccarpenter04 avatar Jun 14 '24 18:06 ccarpenter04

Hello, I’ve created a dedicated plugin for Swift reverse engineering. I hope it will help with implementing the Swift 5 metadata parsing feature in Binary Ninja. https://github.com/FFRI/binja-swift-analyzer

kohnakagawa avatar Sep 15 '25 07:09 kohnakagawa