Class UnmanglerService

java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.mangling.UnmanglerService

public class UnmanglerService extends Object
The service offers access to a set of IManglingEngine for a INativeCodeUnit.
  • Field Details

  • Constructor Details

  • Method Details

    • registerEngine

      public void registerEngine(int manglingEngineId)
    • importUnmangledRoutineName

      public boolean importUnmangledRoutineName(INativeMethodItem routine, String mangledName, IUnmangledRoutine unmangledRoutine, boolean changeRoutineName)
      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 UnmanglerService#importUnmangledRoutinePrototype(INativeCodeUnit, INativeMethodItem, IUnmangledRoutine).

      Parameters:
      routine -
      mangledName - the mangled declaration for this routine
      unmangledRoutine - the unmangled declaration for this routine (computed from the mangled name)
      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
      Returns:
      true if the import was successfully done, false otherwise
    • importUnmangledRoutinePrototype

      public boolean importUnmangledRoutinePrototype(INativeMethodItem routine, IUnmangledRoutine unmangledRoutine)
      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 UnmanglerService#importUnmangledRoutineName(INativeMethodItem, IUnmangledRoutine).

      Parameters:
      routine -
      unmangledRoutine -
      Returns:
      true if the import was successfully done, false otherwise (e.g. because the prototype application failed)
    • unmangleRoutine

      public IUnmangledRoutine unmangleRoutine(String mangledName, boolean returnFirstResult)
      Unmangle a mangled string representing a routine.
      Parameters:
      mangledName -
      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)
      Returns:
      unmangled string if the given string can be unmangled as a routine, null otherwise
    • unmangleData

      public IUnmangledData unmangleData(String mangledName, boolean returnFirstResult)
      Unmangle a mangled string representing a data.
      Parameters:
      mangledName -
      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)
      Returns:
      unmangled string if the given string can be unmangled as a data, null otherwise
    • unmangle

      public IUnmangledData unmangle(String mangledName, boolean returnFirstResult)
      Unmangle a mangled string.
      Parameters:
      mangledName -
      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)
      Returns:
      unmangled string if the given string can be unmangled, null otherwise