ghidra_psx_ldr icon indicating copy to clipboard operation
ghidra_psx_ldr copied to clipboard

Support demangling SYM names

Open lab313ru opened this issue 4 years ago • 9 comments

subj.

lab313ru avatar Nov 29 '19 19:11 lab313ru

It will be a hard task, and I don't see any benefits in implementing it.

lab313ru avatar Nov 30 '19 11:11 lab313ru

Its apparently some version of GCC mangling cause IDA can demangle these if the "Assume GCC 3.x names" is unchecked, so maybe Ghidra might support it with some setting too given it has a GCC demangler?

tomsons26 avatar Nov 30 '19 14:11 tomsons26

Hmm, good idea. I'll try.

lab313ru avatar Nov 30 '19 15:11 lab313ru

ghidra\GPL\DemanglerGnu\os\win64\demangler_gnu.exe ChangeTPage__FPUsi outputs ChangeTPage(unsigned short *, int) so yea it's demangler can do it, seems its treated as old gnu format then. https://github.com/NationalSecurityAgency/ghidra/blob/master/GPL/DemanglerGnu/src/demangler_gnu/c/cplus-dem.c#L270

tomsons26 avatar Nov 30 '19 16:11 tomsons26

Demangler works by default, as I know.

lab313ru avatar Dec 11 '19 10:12 lab313ru

hm, Ghidra's code might be failing here, https://github.com/NationalSecurityAgency/ghidra/blob/master/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/label/DemanglerCmd.java#L55 seems it would have to just try them all until it demangles it but it doesn't

don't see a way to pass a demangler style to DemanglerCmd either..

tomsons26 avatar Dec 11 '19 13:12 tomsons26

I have an implementation in the works for https://github.com/beardypig/ghidra-emotionengine If you'd like I can separate it into it's own plugin if this helps. It will handle some custom metrowerks mangled symbols too.

The only problem is an additional native process is required to set the demangler mode.

astrelsky avatar Dec 25 '19 17:12 astrelsky

It would be great for me to use your demangling code in my plugin so it will be still a single plugin, not multiple. Is it possible?

On December 25, 2019 20:44:13 Andrew Strelsky [email protected] wrote:

I have an implementation in the works for https://github.com/beardypig/ghidra-emotionengine If you'd like I can separate it into it's own plugin if this helps. It will handle some custom metrowerks mangled symbols too.— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

lab313ru avatar Dec 25 '19 18:12 lab313ru

It would be great for me to use your demangling code in my plugin so it will be still a single plugin, not multiple. Is it possible? On December 25, 2019 20:44:13 Andrew Strelsky @.***> wrote: I have an implementation in the works for https://github.com/beardypig/ghidra-emotionengine If you'd like I can separate it into it's own plugin if this helps. It will handle some custom metrowerks mangled symbols too.— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

I wouldn't mind. I have to clean some stuff up first. In reality it would only be temporary anyway until the issue is dealt with in ghidra.

astrelsky avatar Dec 25 '19 18:12 astrelsky