DEV IN PROGRESS

Module pychrysalide.mangling

Documentation

This module provides facilities to decode function or type names mangled by a compiler.

The benefit of using these facilities instead of external tools such as c++filt resides in the quantity of recovered information: not only the mangled name is restored in a human readable form, but all the involved inner types get available for further processing.

Classes

Class CompDemangler

CompDemangler is an abstract class for demangling names.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.mangling.CompDemangler

Known subclasses:

Methods

decode_routine(self, desc)

Demangle a routine definition from its string mangled description.

The result is an instance of type BinRoutine on success, None otherwise.

decode_type(self, desc)

Demangle a type definition from its string mangled description.

The result is an instance of type DataType on success, None otherwise.

Attributes

key

Provide the small name used to identify the demangler, as a code string.

Class DexDemangler

DexDemangler is an implementation of a demangler suitable for processing Dex files.

Instances can be created using the following constructor:

    DexDemangler()

The Android BNF-style definitions for mangled names is available at: https://source.android.com/devices/tech/dalvik/dex-format#string-syntax.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.mangling.CompDemangler
           ╰── pychrysalide.mangling.DexDemangler

Class ItaniumDemangler

ItaniumDemangler is an implementation of a demangler suitable for processing one kind of C++ mangled names.

Instances can be created using the following constructor:

    ItaniumDemangler()

The C++-style name-mangling scheme is available at: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.mangling.CompDemangler
           ╰── pychrysalide.mangling.ItaniumDemangler

Class JavaDemangler

JavaDemangler is an implementation of a demangler suitable for processing JVM files.

Instances can be created using the following constructor:

    JavaDemangler()

The descriptors used in the Java VM are described in the Java specifications ; for instance, for the Java SE 13 Edition, such descriptors definitions are available at: https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-4.html#jvms-4.3.

Hierarchy

builtins.object
 ╰── gi._gi.GObject
      ╰── pychrysalide.mangling.CompDemangler
           ╰── pychrysalide.mangling.JavaDemangler