lab313ru / ghidra_psx_ldr

Sony Playstation PSX executables loader for GHIDRA
231 stars 30 forks source link

Support demangling SYM names #13

Open lab313ru opened 4 years ago

lab313ru commented 4 years ago

subj.

lab313ru commented 4 years ago

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

tomsons26 commented 4 years ago

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?

lab313ru commented 4 years ago

Hmm, good idea. I'll try.

tomsons26 commented 4 years ago

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

lab313ru commented 4 years ago

Demangler works by default, as I know.

tomsons26 commented 4 years ago

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..

astrelsky commented 4 years ago

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.

lab313ru commented 4 years ago

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 notifications@github.com 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.

astrelsky commented 4 years ago

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.