GP-4898 - All Demanglers: added MangledContext; Microsoft MDMang: added

C-style mangling scheme and moved Demangler type hierarchies out of
MDMang
This commit is contained in:
ghizard 2024-09-18 08:50:28 -04:00
parent 3670d91d80
commit 737ea4d31f
53 changed files with 3016 additions and 1460 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -21,6 +21,7 @@
//@category Examples.Demangler
import ghidra.app.script.GhidraScript;
import ghidra.app.util.demangler.DemangledObject;
import ghidra.app.util.demangler.MangledContext;
import ghidra.app.util.demangler.gnu.*;
import ghidra.program.model.symbol.Symbol;
@ -56,7 +57,9 @@ public class DemangleElfWithOptionScript extends GhidraScript {
options = options.withDemanglerFormat(GnuDemanglerFormat.ARM, true);
*/
DemangledObject demangledObject = demangler.demangle(mangled, options);
MangledContext mangledContext =
demangler.createMangledContext(mangled, options, currentProgram, currentAddress);
DemangledObject demangledObject = demangler.demangle(mangledContext);
if (demangledObject == null) {
println("Could not demangle: " + mangled);
return;