# Class: com.pnfsoftware.jeb.core.units.code.asm.mangling.UnmanglerService

The service offers access to a set of [IManglingEngine](IManglingEngine) for a [INativeCodeUnit](INativeCodeUnit).

## Constructor: UnmanglerService
- parameter: `codeUnit`, type: `com.pnfsoftware.jeb.core.units.INativeCodeUnit<?>`

Description: Create an unmangler service.
parameter: codeUnit: native code unit

## Static Field: MANGLING_ENGINE_CXXA
Type: `int`

Constant value: `4`
Description: Itanium C\+\+ ABI mangling engine.

## Static Field: MANGLING_ENGINE_MSVC
Type: `int`

Constant value: `1`
Description: MSVC C mangling engine.

## Static Field: MANGLING_ENGINE_MSVCPP
Type: `int`

Constant value: `2`
Description: MSVC C\+\+ mangling engine.

## Static Field: MANGLING_ENGINE_MSVCPP_V2
Type: `int`

Constant value: `3`
Description: MSVC C\+\+ mangling engine, version 2.

## Method: getRegisteredEngine
- parameter: `manglingEngineId`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IManglingEngine`

Description: Get a registered mangling engine.
parameter: manglingEngineId: mangling engine identifier
return: engine, or null if none is registered for the identifier

## Method: importUnmangledRoutineName
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `mangledName`, type: `java.lang.String`
- parameter: `unmangledRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IUnmangledRoutine`
- parameter: `changeRoutineName`, type: `boolean`
- return type: `boolean`

Description: Applies unmangled routine declaration to a native routine item. This method only takes care of applying the name\-related changes, i.e. setting the new routine name and the related attributes. 

 See [#importUnmangledRoutinePrototype(INativeMethodItem, IUnmangledRoutine)](#importUnmangledRoutinePrototype(INativeMethodItem, IUnmangledRoutine)).
parameter: routine: routine item to update
parameter: mangledName: the mangled declaration for this routine
parameter: unmangledRoutine: the unmangled declaration for this routine \(computed from the mangled            name\)
parameter: changeRoutineName: if true the name of the routine will be changed, otherwise it will            be kept as\-is and only the attributes will be set
return: true if the import was successfully done, false otherwise

## Method: importUnmangledRoutinePrototype
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `unmangledRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IUnmangledRoutine`
- return type: `boolean`

Description: Applies unmangled routine declaration to a native routine item. This method only takes care of applying the prototype change. 

 **important**: 
 
- only strict C prototypes are applied 
- mangled prototypes usually do not contain attributes, such as noreturn. Therefore the typelib prototype should be preferred to this one, if existing. 

 

 See [#importUnmangledRoutineName(INativeMethodItem, String, IUnmangledRoutine, boolean)](#importUnmangledRoutineName(INativeMethodItem, String, IUnmangledRoutine, boolean)).
parameter: routine: routine item to update
parameter: unmangledRoutine: unmangled declaration for this routine
return: true if the import was successfully done, false otherwise \(e.g. because the prototype         application failed\)

## Method: registerEngine
- parameter: `manglingEngineId`, type: `int`
- return type: `boolean`

Description: Register a mangling engine.
parameter: manglingEngineId: mangling engine identifier
return: true if the engine was registered

## Method: unmangle
- parameter: `mangledName`, type: `java.lang.String`
- parameter: `returnFirstResult`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IUnmangledData`

Description: Unmangle a mangled string.
parameter: mangledName: mangled name
parameter: returnFirstResult: if true the first engine to provide a result will have the last            word, otherwise a result is returned only if all engines agree \(or provide no            result\)
return: unmangled string if the given string can be unmangled, null otherwise

## Method: unmangleData
- parameter: `mangledName`, type: `java.lang.String`
- parameter: `returnFirstResult`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IUnmangledData`

Description: Unmangle a mangled string representing a data.
parameter: mangledName: mangled data name
parameter: returnFirstResult: if true the first engine to provide a result will have the last            word, otherwise a result is returned only if all engines agree \(or provide no            result\)
return: unmangled string if the given string can be unmangled **as a data**, null         otherwise

## Method: unmangleRoutine
- parameter: `mangledName`, type: `java.lang.String`
- parameter: `returnFirstResult`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.mangling.IUnmangledRoutine`

Description: Unmangle a mangled string representing a routine.
parameter: mangledName: mangled routine name
parameter: returnFirstResult: if true the first engine to provide a result will have the last            word, otherwise a result is returned only if all engines agree \(or provide no            result\)
return: unmangled string if the given string can be unmangled **as a routine**, null         otherwise

## Method: unregisterAllEngines

Description: Unregister all mangling engines.

## Method: unregisterEngine
- parameter: `manglingEngineId`, type: `int`
- return type: `boolean`

Description: Unregister a mangling engine.
parameter: manglingEngineId: mangling engine identifier
return: true if an engine was removed

