com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager |
A type manager, for primitive types as well as complex types.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
addListener(INativeItemListener listener)
Register a listener relaying events generated by this type manager's type items.
| ||||||||||
abstract IStructureTypeField |
addStructureField(IStructureType type, String fieldName, String fieldTypeName)
Convenience method.
| ||||||||||
abstract IStructureTypeField |
addStructureField(IStructureType type, String fieldName, INativeType fieldType, int offset, int bitsize, int alignment, int flags)
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 void | completeClassTypeInitialization(IClassType type) | ||||||||||
abstract IAliasType |
createAlias(String signature, String aliasedTypeSignature)
Convenience method to create a new alias type.
| ||||||||||
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 IArrayType |
createArray(INativeType baseType, int arraySize, boolean metadata)
Create a new array type.
| ||||||||||
abstract IArrayType | createArray(String baseTypeName, int arraySize) | ||||||||||
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(INativeType returnType, List<INativeType> parameterTypes)
Create a new prototype item with the default calling convention for this manager and no
special prototype attribute.
| ||||||||||
abstract IPrototypeItem |
createPrototype(ICallingConvention callingConvention, INativeType returnType, List<INativeType> parameterTypes, Collection<PrototypeAttribute> attributes)
Create a new prototype item.
| ||||||||||
abstract IPrototypeItem |
createPrototypeEx(ICallingConvention callingConvention, List<INativeType> returnTypes, List<INativeType> parameterTypes, Collection<PrototypeAttribute> attributes)
Create a new prototype item.
| ||||||||||
abstract IPrototypeItem |
createPrototypeEx(String callingConvention, List<String> returnTypes, List<String> 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, String... nameAndTypes)
Convenience method.
| ||||||||||
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 Couple<IVirtualTableDefinition, IMethodTable> | createVirtualTableDefinition(String vtableStructSig, Long address, Collection<INativeMethodItem> methods) | ||||||||||
abstract boolean |
deleteType(INativeType type)
Delete a type.
| ||||||||||
abstract ICallingConventionManager |
getCallingConventionManager()
Retrieve the calling convention manager.
| ||||||||||
abstract CompilerType | getCompilerType() | ||||||||||
abstract INativeType |
getExactFloat(int size)
Find a floating-point or equivalent type of the exact provided size.
| ||||||||||
abstract INativeType |
getExactInteger(int size, boolean signed)
Find an integer or equivalent type of the exact provided size.
| ||||||||||
abstract INativeType |
getInteger(int minsize, boolean signed)
Find an integer or equivalent type of at least the provided size.
| ||||||||||
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<IPrototypeItem> |
getPrototypes()
Retrieve the prototypes managed by this manager.
| ||||||||||
abstract int |
getSlotSize()
Get the size of a stack slot in bytes.
| ||||||||||
abstract SubsystemType | getSubsystemType() | ||||||||||
abstract INativeType |
getType(String signature, boolean allowImportingFromTypelibs)
Retrieve a type by effective signature.
| ||||||||||
abstract INativeType |
getType(String signature, boolean allowImportingFromTypelibs, boolean mayBeRenamed)
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<INativeType> |
getTypes(ISimpleFilter<INativeType> filter)
Retrieve the types currently managed by this manager.
| ||||||||||
abstract Collection<INativeType> |
getTypes()
Retrieve the types currently managed by this manager.
| ||||||||||
abstract INativeType |
getVoid()
Get the void pseudo-type.
| ||||||||||
abstract IReferenceType | getVoidReference() | ||||||||||
abstract void |
removeListener(INativeItemListener listener)
Unregister a listener.
| ||||||||||
abstract boolean |
removeStructureField(IStructureType type, IStructureTypeField field)
Remove a field from a structure type item.
| ||||||||||
abstract boolean | renameStructureField(IStructureType type, String fieldName, String newFieldName) | ||||||||||
abstract boolean | renameStructureField(IStructureType type, IStructureTypeField field, String newFieldName) | ||||||||||
abstract void |
setClassSuperTypes(IClassType c, Collection<IClassType> supertypes, Collection<IVirtualTableDefinition> vtables)
Set up the list of super types and associated virtual tables of a class.
| ||||||||||
abstract void |
setClassVirtualTable(IClassType c, IVirtualTableDefinition vtable)
Set up the (single) virtual table of a class that has no super class.
| ||||||||||
abstract void |
verify(INativeType type)
Verify that the provided type belongs to this type manager; raise if it's not the case.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.asm.items.INativeItemListenable
|
Register a listener relaying events generated by this type manager's type items.
Convenience method. Append a field to a structure type item.
type | structure type |
---|---|
fieldName | field name |
fieldTypeName | field type |
Add or append a field or bit field to a structure type item.
type | structure type |
---|---|
fieldName | field name |
fieldType | field type |
offset | -1 to append, else, a structure offset |
bitsize | optional, used to indicate a bitfield |
alignment | optional, in bytes |
flags | optional, a combination of FLAG_xxx constants |
Append a field to a structure type item.
type | structure type |
---|---|
fieldName | field name |
fieldType | field type |
Convenience method to create a new alias type.
Create a new alias (typedef) type.
Create a new array type.
Create a new array type.
baseType | type of array elements |
---|---|
arraySize | number of elements in this array (must be >= 0) |
metadata | Indicate that data contains meaningless elements. Internally, the
IArrayType will have the flag FLAG_TRANSIENT and won't
be cached (so it can be modified safely). |
Create a new class type.
Creation a new enumeration type. Enumerated contants can be added after the type is created.
Create a new prototype item with the default calling convention for this manager and no special prototype attribute.
returnType | optional; null means void return |
---|---|
parameterTypes | optional; null means no parameter |
Create a new prototype item.
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 |
Create a new prototype item. Multiple return value types may be specified.
Create a new prototype item.
Create a new simple pointer type.
Create a new reference (pointer) type.
Convenience method. Create a structure with a padding of 1 byte and no alignment. Add a series of fields as specified by the `nameAndTypes` parameter.
nameAndTypes | sequence of (fieldName, fieldTypeName, ...) for fields |
---|
Convenience method. Create a structure with a padding of 1 byte and no alignment.
Create a new structure or union type. Fields can be added after the type is created.
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 |
Convenience method. Create a union with no alignment.
vtableStructSig | signature of the to-be-created structure that will hold the virtual methods |
---|---|
address | optional memory address of the virtual table, if concrete |
methods | list of methods in the virtual table |
Retrieve the calling convention manager.
Find a floating-point or equivalent type of the exact provided size. The returned type may be a primitive or an alias to a primitive.
size | exact size in bytes |
---|
Find an integer or equivalent type of the exact provided size. The returned type may be a primitive or an alias to a primitive.
size | exact size in bytes |
---|---|
signed | signedness |
Find an integer or equivalent type of at least the provided size. The returned type may be a primitive or an alias to a primitive.
minsize | minimal size in bytes |
---|---|
signed | signedness |
Retrieve a type string parser that can parse type and prototype strings to type and prototype items and register them with this type manager.
Get a pointer size in bytes.
Retrieve the primitive types manager.
Retrieve the prototypes managed by this manager.
Get the size of a stack slot in bytes. Typically, this would be the size of a general-purpose register.
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.
signature | fully-qualified name (original or effective) |
---|---|
allowImportingFromTypelibs | true to allow importing types |
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.
signature | fully-qualified name (original or effective) |
---|---|
allowImportingFromTypelibs | true to allow importing types |
mayBeRenamed | if false, only original names will be checked |
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.
signature | fully-qualified name (original or effective) |
---|
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)
.
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()
filter | optional |
---|
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()
Remove a field from a structure type item.
Set up the list of super types and associated virtual tables of a class. If used,
setClassVirtualTable(IClassType, IVirtualTableDefinition)
cannot be used.
supertypes | a list of super types |
---|---|
vtables | optional list of virtual tables (may be null) |
Set up the (single) virtual table of a class that has no super class. If used,
setClassSuperTypes(IClassType, Collection, Collection)
cannot be used.
vtable | mandatory virtual table |
---|
Verify that the provided type belongs to this type manager; raise if it's not the case.
type | non-null type |
---|
JebRuntimeException | if the verification failed |
---|