Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demangler Plugins #467

Closed
plafosse opened this issue Sep 12, 2016 · 3 comments
Closed

Demangler Plugins #467

plafosse opened this issue Sep 12, 2016 · 3 comments
Assignees
Labels
Component: API Issue needs changes to the API Component: Core Issue needs changes to the core Component: Demangler Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround Type: Enhancement Issue is a small enhancement to existing functionality
Milestone

Comments

@plafosse
Copy link
Member

plafosse commented Sep 12, 2016

Provide a generic API for users to add their own name demanglers to be run during analysis. This can currently be done after the fact, but it would be nice if it could be integrated.

We should provide two api's, Demangle() and DemangleToType()
The DemangleToType() api will return a BNType object containing a type tree for the given type, Demangle() will simply return a string.

@lucasduffey
Copy link
Contributor

Example workaround:

import subprocess
for func in bv.functions:
    if func.name.startswith("__T") or func.name.startswith("_T"):
        func.name = subprocess.check_output(["/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-demangle", "-compact", func.name])

@plafosse plafosse added Component: Core Issue needs changes to the core Type: Enhancement Issue is a small enhancement to existing functionality labels Jul 14, 2017
@plafosse plafosse added Effort: Low Issue should take < 1 week Impact: Low Issue is a papercut or has a good, supported workaround labels Jan 13, 2021
@ElykDeer ElykDeer added the Component: API Issue needs changes to the API label Sep 29, 2021
@CouleeApps CouleeApps self-assigned this Nov 1, 2022
@CouleeApps CouleeApps removed their assignment Dec 15, 2022
@CouleeApps CouleeApps added Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround and removed Effort: Low Issue should take < 1 week Impact: Low Issue is a papercut or has a good, supported workaround labels Aug 25, 2023
@ccarpenter04
Copy link

I'd happily invest 40-80 hours initially (perhaps more even) to improve the demangling support for a variety of different mangling schemes to ensure they get updated and are properly maintained. As with all things of this nature, it would be a cat in mouse game but it would be putting it on plugin developers to maintain instead of the V35 core development team. I have a lot of cases where MSVC or GNU3 symbols aren't demangling correctly when newer compilation toolchains are used, newer compilation settings, etc. We've lost code on one occasion if I recall correctly and the only reason we were able to recover the logic in a reasonable amount of time was due to Sidekick and the fact that we had mangled symbol information (well, DWARF information) and we were able demangle the most important symbols. Had we not had access to demangled symbols we would have had to push back a products release date quite a bit...

@psifertex psifertex added this to the Frogstar milestone Sep 24, 2024
@CouleeApps
Copy link
Member

As of 4.2.6222 this is now available via the Demangler api. Note that this is a strict plugin layer feature for now, and issues such as #4551 #5920 etc are not resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: API Issue needs changes to the API Component: Core Issue needs changes to the core Component: Demangler Effort: Medium Issue should take < 1 month Impact: Medium Issue is impactful with a bad, or no, workaround Type: Enhancement Issue is a small enhancement to existing functionality
Projects
None yet
Development

No branches or pull requests

6 participants