ghidra/Ghidra/Features/SwiftDemangler
Ryan Kurtz e1e54a4d89 GP-5182: The builtin int type in Swift binaries has been changed from 8
bytes to 4 bytes. The Swift Demangler now demangles the Swift.Int type
to __int64 (or __int32) to avoid conflicts with non-Swift structures and
functions that may be found in the program.
2024-12-09 16:58:19 -05:00
..
ghidra_scripts GP-4898 - All Demanglers: added MangledContext; Microsoft MDMang: added 2024-09-19 12:26:30 +00:00
src GP-5182: The builtin int type in Swift binaries has been changed from 8 2024-12-09 16:58:19 -05:00
build.gradle GP-3535: Improved Swift support 2024-02-26 11:31:24 -05:00
certification.manifest GP-5078: Improvements to Ghidra Module directory layout 2024-10-31 10:34:26 -04:00
Module.manifest GP-3535: Improved Swift support 2024-02-26 11:31:24 -05:00
README.md GP-5078: Adding a little to modules' README 2024-11-04 11:27:05 -05:00

SwiftDemangler

This module provides support for demanling mangled Swift symbols. Supported mangled symbols begin with $S, $s, _$S", _$s, or _T.

The demangler currently relies on making direct calls to the native Swift demangler tool, which comes bundled with Swift. For example:

% swift demangle --compact --expand _\$s7SwiftUI4ViewMp
Demangling for _$s7SwiftUI4ViewMp
kind=Global
  kind=ProtocolDescriptor
    kind=Type
      kind=Protocol
        kind=Module, text="SwiftUI"
        kind=Identifier, text="View"
protocol descriptor for SwiftUI.View

The resulting tree is parsed by the Ghidra Swift Demangler to form and apply a demangled symbol name.

By default, the Demangler Swift Analyzer will search for the native Swift Demangler on the PATH. If it resides elsewhere, its path can be specified in the analyzer's options.