public interface

IEnginesContext

implements IEventSource
com.pnfsoftware.jeb.core.IEnginesContext

Class Overview

A context for JEB engines. Engines produce events and relay events from other components under their supervision. The primary task of JEB engines is to manage projects. All engines contexts are managed by the single instance core context. In practice, one single engines context will exist per JEB instance. The engines context provides access to:
- JEB projects
- top-level engines plugins, including parsers
- other top-level managers, such as the type library manager or the code signature manager

See Also

Summary

Public Methods
abstract void clearUnloadedProject()
Clear all unloaded projects from the project list.
abstract void close()
Close the context.
abstract CodelessSignatureManager getCodelessSignatureManager()
Retrieve the codeless signature manager managed by this context.
abstract ICoreContext getCoreContext()
Retrieve the JEB Core that instantiated this context.
abstract IDataProvider getDataProvider()
Get a reference to the DAO.
abstract List<IDebuggerUnitIdentifier> getDebuggerUnitIdentifiers()
Retrieve the list of identifiers specifically for debugger units.
abstract List<IEnginesPlugin> getEnginesPlugins()
Retrieve a list of engines plugins (internal modules, third party plugins).
abstract ExecutorService getExecutorService()
Get the executor service used by this context.
abstract IRuntimeProject getMainProject()
Retrieve the main project, that is, the first project.
abstract List<INativeDecompilerPlugin<?>> getNativeDecompilerPlugins()
Retrieve the list of disassembler plugins.
abstract List<INativeDisassemblerPlugin<?>> getNativeDisassemblerPlugins()
Retrieve the list of disassembler plugins.
abstract NativeSignatureDBManager getNativeSignatureDBManager()
Retrieve the native signature DB manager managed by this context.
abstract INet getNetworkUtility()
Retrieve a network utility object used by this engines context.
abstract IPluginManager getPluginManager()
Get the plugin manager.
abstract IRuntimeProject getProject(int index)
Get a project by index.
abstract IRuntimeProject getProject(String key)
Get a project by key.
abstract File getProjectFile(String key)
Retrieve the file backing a loaded or unloaded project.
abstract List<IRuntimeProject> getProjects()
Retrieve a copy of the list of projects currently loaded within this context.
abstract IPropertyManager getPropertyManager()
Get the property manager for this engines context.
abstract TypeLibraryService getTypeLibraryService()
Retrieve the type library service managed by this context.
abstract IUnitIdentifier getUnitIdentifier(String type)
Retrieve an identifier by type.
abstract List<IUnitIdentifier> getUnitIdentifiers()
Retrieve the list of all identifiers that projects managed by this context may have access to.
abstract boolean hasProjects()
Determine whether some projects are loaded within this engines context.
abstract boolean isIdentifierEnabled(IUnitIdentifier identifier)
Determine if an identifier is enabled.
abstract IRuntimeProject loadProject(String key, boolean projectMustExist, IProgressCallback callback)
Load an existing project or create a new project.
abstract IRuntimeProject loadProject(String key)
Load an existing project or create a new project.
abstract IRuntimeProject loadProject(String key, IProgressCallback callback)
This method is deprecated. use loadProject(String, boolean, IProgressCallback) instead
abstract boolean saveProject(String projectKey, String persistenceKey, Map<String, Object> optionalParameters, IProgressCallback callback)
Save the state of a project (including artifacts and all units) to the project database.
abstract boolean saveProject(String key)
Save the state of a project (including artifacts and all units) to the project database.
abstract boolean setIdentifierEnabled(IUnitIdentifier identifier, boolean enabled)
Enable or disable an identifier.
abstract String unitProperty(String unitType, String propertyName)
Convenience method to generate unit properties.
abstract boolean unloadProject(String key, boolean clear)
Unload a project and optionally clear its entry from the project list.
abstract boolean unloadProject(String key)
Unload a project.
abstract void unloadProjects()
Unload all projects.
abstract void unloadProjects(boolean clear)
Unload all projects and optionally clear entries from the project list.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Methods

public abstract void clearUnloadedProject ()

Clear all unloaded projects from the project list.

Note: The project list allows for rapid reloading of previously loaded projects.

public abstract void close ()

Close the context. All projects will be unloaded; changes will not be persisted.

public abstract CodelessSignatureManager getCodelessSignatureManager ()

Retrieve the codeless signature manager managed by this context.

public abstract ICoreContext getCoreContext ()

Retrieve the JEB Core that instantiated this context.

public abstract IDataProvider getDataProvider ()

Get a reference to the DAO.

Returns
  • the data provider

public abstract List<IDebuggerUnitIdentifier> getDebuggerUnitIdentifiers ()

Retrieve the list of identifiers specifically for debugger units.

Returns
  • a list of debugger identifiers

public abstract List<IEnginesPlugin> getEnginesPlugins ()

Retrieve a list of engines plugins (internal modules, third party plugins).

Returns
  • the list of plugins, never null

public abstract ExecutorService getExecutorService ()

Get the executor service used by this context. Clients may use it to schedule third-party tasks.

Returns
  • the executor service

public abstract IRuntimeProject getMainProject ()

Retrieve the main project, that is, the first project. This method throws if there is no project opened in this engines context.

Returns
  • the main project, never null
Throws
IllegalStateException if there is no main project

public abstract List<INativeDecompilerPlugin<?>> getNativeDecompilerPlugins ()

Retrieve the list of disassembler plugins.

public abstract List<INativeDisassemblerPlugin<?>> getNativeDisassemblerPlugins ()

Retrieve the list of disassembler plugins.

public abstract NativeSignatureDBManager getNativeSignatureDBManager ()

Retrieve the native signature DB manager managed by this context.

public abstract INet getNetworkUtility ()

Retrieve a network utility object used by this engines context. The network object is configured to use the proxy specified by the owner Core context's properties.

public abstract IPluginManager getPluginManager ()

Get the plugin manager. This method will return null if this context does not offer a plugin manager.

Note: JEB demo builds do not support plugins.

public abstract IRuntimeProject getProject (int index)

Get a project by index.

Parameters
index 0-based index
Returns
  • the project or null

public abstract IRuntimeProject getProject (String key)

Get a project by key.

Parameters
key mandatory project key
Returns
  • the project or null

public abstract File getProjectFile (String key)

Retrieve the file backing a loaded or unloaded project. The file may not exist or the project may not be backed by a filesystem file, in which case this method will return null.

Parameters
key project key
Returns
  • the file or null
Throws
IOException on I/O exception

public abstract List<IRuntimeProject> getProjects ()

Retrieve a copy of the list of projects currently loaded within this context.

Returns
  • the list of projects managed by this context

public abstract IPropertyManager getPropertyManager ()

Get the property manager for this engines context.

Returns
  • the property manager

public abstract TypeLibraryService getTypeLibraryService ()

Retrieve the type library service managed by this context.

public abstract IUnitIdentifier getUnitIdentifier (String type)

Retrieve an identifier by type.

Parameters
type identifier type (recall that decompilers are prefixed with pfxTypeDecompiler and debuggers with pfxTypeDebugger)
Returns
  • an identifier or null if there is none

public abstract List<IUnitIdentifier> getUnitIdentifiers ()

Retrieve the list of all identifiers that projects managed by this context may have access to.

Returns
  • a list of unit identifiers (aka, parsers)

public abstract boolean hasProjects ()

Determine whether some projects are loaded within this engines context.

public abstract boolean isIdentifierEnabled (IUnitIdentifier identifier)

Determine if an identifier is enabled.

Parameters
identifier the identifier
Returns
  • true if enabled, false otherwise

public abstract IRuntimeProject loadProject (String key, boolean projectMustExist, IProgressCallback callback)

Load an existing project or create a new project.

Parameters
key an existing or new project key (the final project key may be different); may be a path to a JDB2 file
projectMustExist if true, the project must exist (that is, the key must reference an existing JDB2 database, else the method will raise)
callback an optional callback object fed that will be continuously fed with information regarding the loading status
Returns
  • a project reference
Throws
IOException on IO error
SerializationException on serialization error

public abstract IRuntimeProject loadProject (String key)

Load an existing project or create a new project.

Parameters
key an existing or new project key (the final project key may be different); may be a path to a JDB2 file
Returns
  • a project reference
Throws
IOException on IO error
SerializationException on serialization error

public abstract IRuntimeProject loadProject (String key, IProgressCallback callback)

This method is deprecated.
use loadProject(String, boolean, IProgressCallback) instead

Throws
IOException

public abstract boolean saveProject (String projectKey, String persistenceKey, Map<String, Object> optionalParameters, IProgressCallback callback)

Save the state of a project (including artifacts and all units) to the project database. If the project DB is backed up by a filesystem, the project will be persisted to a JDB2 file.

Parameters
projectKey the project key
persistenceKey optional persistence key; set it to override the current key and persist to a different location
optionalParameters opaque dictionary of optional parameters (reserved for internal use)
callback an optional callback object that will be continuously fed with information regarding the saving status
Returns
  • success indicator
Throws
IOException on IO error
SerializationException on deserialization error

public abstract boolean saveProject (String key)

Save the state of a project (including artifacts and all units) to the project database. If the project DB is backed up by a filesystem, the project will be persisted to a JDB2 file.

Parameters
key the project key
Returns
  • success indicator
Throws
IOException on IO error
SerializationException on deserialization error

public abstract boolean setIdentifierEnabled (IUnitIdentifier identifier, boolean enabled)

Enable or disable an identifier.

Parameters
identifier the identifier
enabled true to enable the identifier, false otherwise; in the latter case, IUnitIdentifier#canIdentify() will never get called
Returns
  • success indicator

public abstract String unitProperty (String unitType, String propertyName)

Convenience method to generate unit properties. Refer to UnitUtil for additional methods.

Parameters
unitType unit type
propertyName property name
Returns
  • the fully-qualified property name, to be used to query the Engines property manager or a Project property manager

public abstract boolean unloadProject (String key, boolean clear)

Unload a project and optionally clear its entry from the project list.

Parameters
key the project key
clear if true, the project entry will be removed from the project list
Returns
  • success indicator

public abstract boolean unloadProject (String key)

Unload a project.

Parameters
key the project key
Returns
  • success indicator

public abstract void unloadProjects ()

Unload all projects.

public abstract void unloadProjects (boolean clear)

Unload all projects and optionally clear entries from the project list.

Parameters
clear if true, project entries will be removed from the project list