public interface

ITypeManager

com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager

Class Overview

A type manager, for primitive types as well as complex types. Also provide a calling convention manager.

Summary

Public Methods
abstract IStructureTypeField addStructureField(IStructureType type, String fieldName, INativeType fieldType, int offset, int bitsize, int alignment)
Add or append a field or bit field to a structure type item.
abstract IStructureTypeField addStructureField(IStructureType type, String fieldName, INativeType fieldType, int offset)
Add or append a field to a structure type item.
abstract IStructureTypeField addStructureField(IStructureType type, String fieldName, INativeType fieldType, int offset, int bitsize)
Add or append a field or bit field to a structure type item.
abstract IStructureTypeField addStructureField(IStructureType type, String fieldName, INativeType fieldType)
Append a field to a structure type item.
abstract IAliasType createAlias(String signature, INativeType aliasedType)
Create a new alias (typedef) type.
abstract IArrayType createArray(INativeType baseType, int arraySize)
Create a new array type.
abstract IClassType createClassType(String signature, int padding, int alignment)
Create a new class type.
abstract IClassType createClassType(String signature)
Create a new class type.
abstract IEnumerationType createEnumeration(String signature)
Creation a new enumeration type.
abstract IPrototypeItem createPrototype(ICallingConvention callingConvention, INativeType returnType, List<? extends INativeType> parameterTypes, Collection<PrototypeAttribute> attributes)
Create a new prototype item.
abstract IReferenceType createReference(INativeType baseType)
Create a new simple pointer type.
abstract IReferenceType createReference(INativeType baseType, int refCount)
Create a new reference (pointer) type.
abstract IStructureType createStructure(String signature)
Convenience method.
abstract IStructureType createStructureOrUnion(String signature, int padding, int alignment)
Create a new structure or union type.
abstract IStructureType createUnion(String signature)
Convenience method.
abstract boolean deleteType(INativeType type)
Delete a type.
abstract ICallingConventionManager getCallingConventionManager()
Retrieve the calling convention manager.
abstract CompilerType getCompilerType()
abstract TypeStringParser getParser()
Retrieve a type string parser that can parse type and prototype strings to type and prototype items and register them with this type manager.
abstract int getPointerSize()
Get a pointer size in bytes.
abstract IPrimitiveTypeManager getPrimitives()
Retrieve the primitive types manager.
abstract ProcessorType getProcessorType()
abstract Collection<? extends IPrototypeItem> getPrototypes()
Retrieve the prototypes managed by this manager.
abstract SubsystemType getSubsystemType()
abstract INativeType getType(String signature, boolean allowImportingFromTypelibs)
Retrieve a type by effective signature.
abstract INativeType getType(String signature)
Retrieve a type by effective signature.
abstract TypeLibraryService getTypeLibraryService()
Retrieve the optional type library service (TLS) connected to this manager.
abstract Collection<? extends INativeType> getTypes(ISimpleFilter<INativeType> filter)
Retrieve the types currently managed by this manager.
abstract Collection<? extends INativeType> getTypes()
Retrieve the types currently managed by this manager.
abstract IReferenceType getVoidReference()
abstract boolean removeStructureField(IStructureType type, IStructureTypeField field)
Remove a field from a structure type item.
abstract boolean renameStructureField(IStructureType type, IStructureTypeField field, String newName)
abstract void verify(INativeType type)
Verify that the provided type belongs to this type manager; raise if it's not the case.

Public Methods

public abstract IStructureTypeField addStructureField (IStructureType type, String fieldName, INativeType fieldType, int offset, int bitsize, int alignment)

Add or append a field or bit field to a structure type item.

public abstract IStructureTypeField addStructureField (IStructureType type, String fieldName, INativeType fieldType, int offset)

Add or append a field to a structure type item.

public abstract IStructureTypeField addStructureField (IStructureType type, String fieldName, INativeType fieldType, int offset, int bitsize)

Add or append a field or bit field to a structure type item.

public abstract IStructureTypeField addStructureField (IStructureType type, String fieldName, INativeType fieldType)

Append a field to a structure type item.

public abstract IAliasType createAlias (String signature, INativeType aliasedType)

Create a new alias (typedef) type.

public abstract IArrayType createArray (INativeType baseType, int arraySize)

Create a new array type.

public abstract IClassType createClassType (String signature, int padding, int alignment)

Create a new class type.

public abstract IClassType createClassType (String signature)

Create a new class type.

public abstract IEnumerationType createEnumeration (String signature)

Creation a new enumeration type. Enumerated contants can be added after the type is created.

public abstract IPrototypeItem createPrototype (ICallingConvention callingConvention, INativeType returnType, List<? extends INativeType> parameterTypes, Collection<PrototypeAttribute> attributes)

Create a new prototype item.

Parameters
callingConvention optional; null means standard calling convention (per this type manager)
returnType optional; null means void return
parameterTypes optional; null means no parameter
attributes optional
Returns
  • a new native prototype object

public abstract IReferenceType createReference (INativeType baseType)

Create a new simple pointer type.

public abstract IReferenceType createReference (INativeType baseType, int refCount)

Create a new reference (pointer) type.

public abstract IStructureType createStructure (String signature)

Convenience method. Create a structure with a padding of 1 byte and no alignment.

public abstract IStructureType createStructureOrUnion (String signature, int padding, int alignment)

Create a new structure or union type. Fields can be added after the type is created.

Parameters
padding padding in bytes between fields; 0 means that type is a union
alignment alignment in bytes; the structure/union will have at least that size

public abstract IStructureType createUnion (String signature)

Convenience method. Create a union with no alignment.

public abstract boolean deleteType (INativeType type)

Delete a type.

Returns
  • success indicator

public abstract ICallingConventionManager getCallingConventionManager ()

Retrieve the calling convention manager.

Returns
  • teh calling convention manager

public abstract CompilerType getCompilerType ()

Returns
  • may be null

public abstract TypeStringParser getParser ()

Retrieve a type string parser that can parse type and prototype strings to type and prototype items and register them with this type manager.

public abstract int getPointerSize ()

Get a pointer size in bytes.

public abstract IPrimitiveTypeManager getPrimitives ()

Retrieve the primitive types manager.

Returns
  • the primitive types manager

public abstract ProcessorType getProcessorType ()

public abstract Collection<? extends IPrototypeItem> getPrototypes ()

Retrieve the prototypes managed by this manager.

public abstract SubsystemType getSubsystemType ()

Returns
  • may be null

public abstract INativeType getType (String signature, boolean allowImportingFromTypelibs)

Retrieve a type by effective signature. The type returned can be one managed by this type manager, a primitive returned by the primitive type manager, or a type imported from the optional TLS, if one is present.

Parameters
signature fully-qualified name (original or effective)
allowImportingFromTypelibs true to allow importing types
Returns
  • the type or null if not found

public abstract INativeType getType (String signature)

Retrieve a type by effective signature. The type returned can be one managed by this type manager, a primitive returned by the primitive type manager, or a type imported from the optional TLS, if one is present.

Parameters
signature fully-qualified name (original or effective)
Returns
  • the type or null if not found

public abstract TypeLibraryService getTypeLibraryService ()

Retrieve the optional type library service (TLS) connected to this manager. The TLS is a source of external types of prototypes. If a TLS is present, its types can be transparently imported and retrieved via getType(String).

Returns
  • the optional TLS

public abstract Collection<? extends INativeType> getTypes (ISimpleFilter<INativeType> filter)

Retrieve the types currently managed by this manager. The following types are not returned:
- reference types (pointers)
- array types
- primitives (they are managed by the primitive type manager)
- prototypes (see getPrototypes()

Parameters
filter optional

public abstract Collection<? extends INativeType> getTypes ()

Retrieve the types currently managed by this manager. The following types are not returned:
- reference types (pointers)
- array types
- primitives (they are managed by the primitive type manager)
- prototypes (see getPrototypes()

public abstract IReferenceType getVoidReference ()

public abstract boolean removeStructureField (IStructureType type, IStructureTypeField field)

Remove a field from a structure type item.

public abstract boolean renameStructureField (IStructureType type, IStructureTypeField field, String newName)

public abstract void verify (INativeType type)

Verify that the provided type belongs to this type manager; raise if it's not the case.

Parameters
type non-null type
Throws
if the verification failed