LaurieWired / iOS_Reverse_Engineering

The iOS IPA file Reverse Engineering reference
287 stars 25 forks source link

Single Quotes Surrounding issue on Mac #3

Open CainSoulless opened 3 months ago

CainSoulless commented 3 months ago

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'