Package com.pnfsoftware.jeb.core.units
Interface IUnitIdentifier
- All Superinterfaces:
IPlugin
,IUnitPlugin
- All Known Subinterfaces:
IDebuggerUnitIdentifier
- All Known Implementing Classes:
AbstractUnitIdentifier
Unit identifiers are one of the two types of plugins supported by JEB engines. They are used to
determine if some input data can be processed by a corresponding unit. Unit plugins must have a
public no-argument constructor. Currently, unit plugins cannot be unloaded (and therefore, unlike
IEnginesPlugin
, do not offer a dispose() method).
Identifiers have a unique type identification string (eg, "dex") and a priority. For identifiers that successfully identify the same input data as processable, the tie can be broken by using the priority value.
Identifiers build (or rebuild) units and provide them to clients.
Identifiers are rarely used on their own. They are generally managed by a IUnitProcessor
.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicate that this identifier could return true for any input.default boolean
canIdentify
(IInput input, IUnitCreator parent) Legacy method that does not provide name and identmap.default boolean
canIdentify
(IInput input, IUnitCreator parent, String name, Map<Object, Object> identmap) Perform input identification.default IUnit
prepare
(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent) Legacy method that does not provide identmap.default IUnit
prepare
(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, Map<Object, Object> identmap) This method is used to produce a unit of the corresponding identifier type.Methods inherited from interface com.pnfsoftware.jeb.core.IPlugin
dispose, getData, getPluginInformation, setData
Methods inherited from interface com.pnfsoftware.jeb.core.units.IUnitPlugin
getFormatType, getPriority, getPropertyDefinitionManager, getTypeIdProvider, initialize
-
Field Details
-
KEY_FAILURE_REASON
- See Also:
-
-
Method Details
-
acceptAnyInputBytes
boolean acceptAnyInputBytes()Indicate that this identifier could return true for any input. The input data does not follow a specific format.- Returns:
- true if the input data may not be readily identified as of a specific format
-
canIdentify
default boolean canIdentify(IInput input, IUnitCreator parent, String name, Map<Object, Object> identmap) Perform input identification. Determine if a corresponding unit may be created out of the provided input.- Parameters:
input
- input data, may be null only if the parent is not nullparent
- the parentname
- optional input nameidentmap
- optional output map filled during identification; on success, that object should be provided toprepare
.
List of special keys that may be filled during identification regardless of success/failure:
-"FAILURE_REASON"
(type String): upon failure, an optional message (type String) provided by the identifier to the client explaining why identification failed, if the reason is potentially interesting to the client- Returns:
- true if the identification succeeded, false otherwise. Users will want to call prepare() upon successful identification, although identification may be bypassed
-
canIdentify
Legacy method that does not provide name and identmap. -
prepare
default IUnit prepare(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, Map<Object, Object> identmap) This method is used to produce a unit of the corresponding identifier type. Typically, it is called by unit processors when input data has been identified by the unit identifier as a potential candidate for the corresponding unit.Unit preparation may involve
processing
the unit. Starting with JEB 2.2, we recommend that unit processing be left at the discretion of client code. Lazy processing may avoid incurring unnecessary or untimely computational overheads.- Parameters:
name
- the unit nameinput
- the input binary data for that unitunitProcessor
- the processorparent
- the parentidentmap
- optional identification map filled out bycanIdentify(IInput, IUnitCreator, String, Map)
- Returns:
- a fresh unit that can process `data`
-
prepare
Legacy method that does not provide identmap.
-