Email or username:

Password:

Forgot your password?
Top-level
Kuba Mracek

@timac How are you detecting Swift in the Secure Enclave binaries? Those are nowadays using Embedded Swift, and there might not be the traditional "obvious" signs of Swift in those Mach-O binaries.

5 comments
Alexandre Colucci

@kubamracek I was unable so far to find any artifacts to detect Embedded Swift. The Secure Enclave binaries are well-stripped, with no typical Mach-O sections. What surprised me, was the SEP app name with the '_swift' suffix.

I assumed that a SEP binary with the '_swift' suffix was built with Embedded Swift, but I could be wrong. It is also possible that the other binaries have been moved to Swift without using the "_swift" suffix.

In any case, I plan to experiment more with Embedded Swift.

Kuba Mracek

@timac Aha, so previously you were using the presence of the Swift sections in the Mach-O header to detect Swift? You're right that those are gone with Embedded Swift, which doesn't use type metadata and generally compiles down to something much much closer to what C compilers would produce. Without symbols, it is probably pretty hard to reliably trace back whether the binary is coming from a Swift compiler or C compiler...

Kuba Mracek

@timac Though, that said, I can think of one pretty reliable way: If you dump the instructions (otool -xV) of an arm64e binary (SEP uses arm64e), and if you spot PAC sequences using the #0x6ae1 and #0xbbbf constants, then that's a very strong signal about the code being Swift. The constants are coming from this code in the Swift runtime: github.com/swiftlang/swift/blo

Alexandre Colucci

@kubamracek Thank a lot for the tip! That's exactly what I was looking for.

Alexandre Colucci

@kubamracek I was indeed relying on the presence of the Swift sections to detect Swift in the SEP binaries.
In the SEP binaries on macOS 14, these sections were still included.

I just checked on macOS 15, and the sections are indeed missing in the hibernation binary.
It seems a lot of optimizations have been made in Embedded Swift with macOS 15 and iOS 18.

Go Up