Skip to content

Single Quotes Surrounding issue on Mac #3

@CainSoulless

Description

@CainSoulless

Using single quotes in the mangled_name variable of the demangle_swift_name() function affected the correct naming of Swift functions when processed in Ghidra. This issue caused functions to appear with single quotes within the platform itself, which caused confusion when viewed in the Symbol Tree.

To resolve this issue, I removed the single quotes contained in the mangled_name variable.

After making this modification, the function has been working correctly.

def demangle_swift_name(mangled_name):
    os_name = System.getProperty("os.name").lower()

    # Determine the correct command based on the OS
    if "mac" in os_name:
        cmd = 'xcrun swift-demangle --simplified --compact'
        **mangled_name = "{}".format(mangled_name)  # Surround with single quotes**

    else:
        cmd = 'swift-demangle --simplified --compact'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions