com.pnfsoftware.jeb.core.units.IUnitProcessor |
A unit processor is a parser that uses registered JEB plugins to identify and process input data
into IUnit
s.
No two identifiers registered in a processor can have the same
type
.
A processor has a PDM and a PM, which are provided to unit identifiers in order to maintain a chain of properties
A unit processor is a crucial component for building plugins that achieve high coherence and loose coupling. Please refer to the JEB Unit Plugin Development Guide: Delegation and Parsing Inner Data for more information.
Note: may be renamed to IParser
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract IDebuggerUnit |
createDebugger(String name, IUnit parent)
Convenience method that processes a code unit to produce an associated debugger unit.
| ||||||||||
abstract IDecompilerUnit |
createDecompiler(String name, IUnit parent)
Convenience method that processes a code unit to produce an associated decompiler unit.
| ||||||||||
abstract boolean |
getAlwaysProcessDuplicateInputs()
Determine whether this parser always process duplicate inputs, or can, under certain
conditions, skip processing duplicates.
| ||||||||||
abstract List<IDebuggerUnitIdentifier> |
getDebuggerUnitIdentifiers()
Get a list of unit identifier for debugger units only.
| ||||||||||
abstract int |
getProcessingDepth()
Get the processing depth.
| ||||||||||
abstract IPropertyDefinitionManager |
getPropertyDefinitionManager()
Get the PDM used by this processor.
| ||||||||||
abstract IPropertyManager |
getPropertyManager()
Get the PM used by this processor.
| ||||||||||
abstract IUnitIdentifier |
getUnitIdentifier(String type)
Get an identifier by type.
| ||||||||||
abstract List<IUnitIdentifier> |
getUnitIdentifiers()
Get a list of unit identifiers managed by this processor.
| ||||||||||
abstract IUnit |
process(String name, IInput input, IUnitCreator parent, String wantedType, boolean softDelegation)
Identify and process input data.
| ||||||||||
abstract IUnit |
process(String name, IUnitCreator parent)
Identify and process input data.
| ||||||||||
abstract IUnit |
process(String name, IInput input, IUnitCreator parent, String wantedType, boolean softDelegation, boolean doNotProcessUnit)
Identify and process input data.
| ||||||||||
abstract IUnit |
process(String name, IInput input, IUnitCreator parent, String wantedType)
Identify and process input data.
| ||||||||||
abstract IUnit |
process(String name, IInput input, IUnitCreator parent)
Identify and process input data.
| ||||||||||
abstract IUnitIdentifier |
registerPlugin(IUnitPlugin identifier)
Register a plugin: it can be a true unit identifier or a native code plugin (that will yield
an identifier).
| ||||||||||
abstract int |
setProcessingDepth(int depth)
Set the maximum processing depth.
| ||||||||||
abstract void |
setUnknownInputResolver(IUnknownInputResolver resolver)
Provide an optional "callback class" used as a last-resort mechanism when a unit could not be
identified.
| ||||||||||
abstract boolean |
unregisterUnitIdentifier(IUnitIdentifier identifier)
Unregister a unit identifier.
|
Convenience method that processes a code unit to produce an associated debugger unit.
name | the name of the resulting unit, generally "debugger" |
---|---|
parent | a prent unit, generally an ICodeUnit |
Convenience method that processes a code unit to produce an associated decompiler unit.
name | the name of the resulting unit, generally "decompiler" |
---|---|
parent | a parent unit, generally an ICodeUnit |
Determine whether this parser always process duplicate inputs, or can, under certain conditions, skip processing duplicates.
Get a list of unit identifier for debugger units only.
Get the processing depth.
Get the PDM used by this processor.
Get the PM used by this processor.
Get an identifier by type.
type | the unit identifier type string |
---|
Get a list of unit identifiers managed by this processor.
Identify and process input data.
Same as: process(name, data, parent, wantedType, softDelegation, false)
Identify and process input data. The input data in that case is the parent unit itself. This method is used when re-parsing existing units. It is used by decompilers, typically.
name | the unit name |
---|---|
parent | the parent |
Identify and process input data. The identification part can be short-circuited by providing a specific wanted type. In that case, the processor looks for a matching identifier, and start processing the input data right away without executing the identification routine.
name | the optional wanted unit name; if null, a name will be auto-generated |
---|---|
input | the optional input binary data |
parent | the creating entity, either a parent unit or an artifact |
wantedType | the optional wanted type. Leave null to let the identifiers perform identification |
softDelegation | perform soft delegation, aka, avoid calling the unknown resolver (if any) and avoid creating a generic unit if all unit identifiers failed to identify the input data; in the latter case, this method will return null |
doNotProcessUnit | if true, after preparation by the identifier, do not automatically
call process() on the newly-created unit |
Identify and process input data.
Same as: process(name, data, parent, wantedType, false, false)
name | the unit name |
---|---|
input | the input data |
parent | the parent |
wantedType | the optional wanted type |
Identify and process input data.
name | the unit name |
---|---|
input | the input data |
parent | the parent |
Register a plugin: it can be a true unit identifier or a native code plugin (that will yield an identifier).
This method is used by clients to register unit identifiers manually. The client is responsible for initializing the unit identifier prior to registering it. The client is also responsible for performing appropriate version checking.
identifier | the plugin to register |
---|
Set the maximum processing depth. A call to process() can succeed if and only if the depth level of the parent is strictly less than the processing depth. By default, the processing depth is set to 0 (meaning, process as deep as possible). Clients may change this setting, temporarily and permanently.
depth | a number ≥ 1; any number ≤ 0 means no depth (process as deep as possible) |
---|
Provide an optional "callback class" used as a last-resort mechanism when a unit could not be identified.
Note: currently, the resolver is not used by the official RCP client
resolver | an optional resolver |
---|
Unregister a unit identifier.
identifier | the identifier |
---|