avast / avast/retdec

MSVC symbol demangler fails to demangle most templated names

Open
#400 3 comments 0 reactions 0 assignees View on GitHub
C-demangler enhancement
Dominant language
C++
Stars
8.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

The way I read https://github.com/avast-tl/retdec/blob/7cad5076c06bbe99f410c98a9af8f08d73eb3175/src/demangler/extgrammars/gramatika-ms, the demangler will only expect template arguments in names starting with `??`. This doesn't match the description on https://en.wikiversity.org/wiki/Visual_C%2B%2B_name_mangling and won't demangle names like `?xyz@?$abc@V?$def@H@@PAX@@` which the undname command line tool demangles just fine.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/demangler/extgrammars/gramatika-ms and inspect how template arguments are recognized in MSVC names. Compare that behavior with the documented mangling rules and the undname result for ?xyz@?$abc@V?$def@H@@PAX@@. Done means the grammar also demangles templated names such as the example given.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.