| com.pnfsoftware.jeb.core.units.INativeCodeUnit<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Specialized code unit that manages a native code processor and uses a virtual memory.
Note: if a debugger is attached, a temporary physical image base can be set.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.corei.parsers.asm.analyzer.IMethodManager
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract long |
getCanonicalMemoryAddress(String address)
Convert a flexible native code unit address to a canonical memory address.
| ||||||||||
| abstract INativeClassItem |
getClass(String fqname)
Convenience method used to retrieve a class by name.
| ||||||||||
| abstract List<? extends INativeClassItem> |
getClasses()
Get the list of classes.
| ||||||||||
| abstract INativeCodeAnalyzer<InsnType> |
getCodeAnalyzer()
Get the code analyzer.
| ||||||||||
| abstract INativeCodeAnalyzerExtensionsManager<InsnType> |
getCodeAnalyzerExtensionsManager()
Retrieve the currently-set analyzer extensions manager.
| ||||||||||
| abstract GenericCodeFormatter<InsnType> |
getCodeFormatter()
Get the helper object used to format instructions into a sink.
| ||||||||||
| abstract INativeCodeModel<InsnType> |
getCodeModel()
Get the code model.
| ||||||||||
| abstract ICodeObjectUnit |
getCodeObjectContainer()
Provide the parent code object container, if there is one.
| ||||||||||
| abstract INativeType | getDataTypeAt(long address) | ||||||||||
| abstract INativeDisassemblyDocument |
getDisassemblyDocument()
Provide the disassembly document.
| ||||||||||
| abstract Endianness |
getEndianness()
Retrieve the endianness.
| ||||||||||
| abstract INativeFieldItem |
getField(String fqname)
Convenience method used to retrieve a field by name.
| ||||||||||
| abstract List<? extends INativeFieldItem> |
getFields()
Get the list of fields.
| ||||||||||
| abstract long |
getImageSize()
Retrieve the size of the image
| ||||||||||
| abstract INativeMethodItem |
getInternalMethod(long memoryAddress, boolean addressIsEntryPoint)
Retrieve an internal method by address (any address within the method).
| ||||||||||
| abstract List<? extends INativeMethodItem> |
getInternalMethods()
Retrieve all internal methods.
| ||||||||||
| abstract List<? extends INativeMethodItem> |
getInternalMethods(long memoryAddress)
Retrieve the internal methods spanning over the provided address
| ||||||||||
| abstract INativeItem |
getItemObject(long id)
Optionally provide an object associated with the given item.
| ||||||||||
| abstract IUnitLock |
getLock()
Retrieve the model lock, used to request a full-access model lock or a partial, read-only,
transactional lock.
| ||||||||||
| abstract IVirtualMemory |
getMemory()
Retrieve the virtual memory managed used by this unit.
| ||||||||||
| abstract INativeMethodItem |
getMethod(String fqname)
Convenience method used to retrieve a method by name.
| ||||||||||
| abstract List<? extends INativeMethodItem> |
getMethods()
Get the list of methods.
| ||||||||||
| abstract INativeContinuousItem | getNativeItemAt(long address) | ||||||||||
| abstract INativeContinuousItem | getNativeItemOver(long address) | ||||||||||
| abstract SortedMap<Long, INativeContinuousItem> | getNativeItemsOver(long address, int size) | ||||||||||
| abstract List<? extends IPackage> |
getPackages()
Get the list of code packages.
| ||||||||||
| abstract long |
getPhysicalImageDelta()
Retrieve the difference between Physical Image base as set by
#setPhysicalImageBase(Long) and Virtual Image Base as retrieved by
getVirtualImageBase(). | ||||||||||
| abstract IProcessor<InsnType> |
getProcessor()
Retrieve the machine code parser (pseudo-processor) managed by this unit.
| ||||||||||
| abstract List<? extends INativeStringItem> |
getStrings()
Get the list of code strings.
| ||||||||||
| abstract String |
getSymbolicStringAddress(long address)
Retrieve the simplest symbol address that corresponds to the given physical address.
| ||||||||||
| abstract String |
getSymbolicStringAddress(long address, int sspref)
Retrieve a symbol address that corresponds to the given physical address.
| ||||||||||
| abstract TypeLibraryService |
getTypeLibraryService()
Get the global type library service.
| ||||||||||
| abstract ITypeManager |
getTypeManager()
Get the global type manager used by this unit.
| ||||||||||
| abstract List<? extends INativeType> |
getTypes()
Get the list of types.
| ||||||||||
| abstract long |
getVirtualImageBase()
Retrieve the virtual image base, indicated in the code container (most of the time a PE, ELF,
or MachO container).
| ||||||||||
| abstract boolean | isAnalysisCompleted() | ||||||||||
| abstract boolean |
performAnalysis(boolean async, Boolean includeAdvancedAnalysis, Runnable onCompletion)
Start an analysis.
| ||||||||||
| abstract boolean | setCodeAt(long address, int procmode, boolean undefineOverlappingItems) | ||||||||||
| abstract void | setCodeFormatter(GenericCodeFormatter<InsnType> codeFormatter) | ||||||||||
| abstract boolean | setDataAt(long address, INativeType type, String name) | ||||||||||
| abstract boolean | setDataTypeAt(long address, INativeType type) | ||||||||||
| abstract void |
setMemory(IVirtualMemory mem)
Optionally set the current optional virtual memory (VM) used by this unit.
| ||||||||||
| abstract void |
setPhysicalImageBase(long physicalImageBase)
Set the real (physical) image base for this piece of code.
| ||||||||||
| abstract void |
setProcessor(IProcessor<InsnType> proc)
Set the code parser (processor) used by this unit.
| ||||||||||
| abstract boolean |
setRoutineAt(long address)
Parse and attempt to create a routine at the provided address.
| ||||||||||
| abstract boolean |
setRoutineAt(long address, int procmode, int permission)
Parse and attempt to create a routine at the provided address.
| ||||||||||
| abstract boolean |
setRoutineAt(long address, int procmode)
Parse and attempt to create a routine at the provided address.
| ||||||||||
| abstract boolean | setRoutinePrototype(INativeMethodItem routine, String prototypeString) | ||||||||||
| abstract boolean | setRoutineReferenceAt(long address, INativeMethodItem routine) | ||||||||||
| abstract boolean | setStringAt(long address, long addressMax, StringType st, int minChars, int maxChars) | ||||||||||
| abstract void |
setVirtualImageBase(long virtualImageBase)
Preferred image base for raw binary files.
| ||||||||||
| abstract boolean | undefineItem(long address) | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.IUnitCreator
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.IAddressableUnit
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.IInteractiveUnit
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.IUnit
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.ICodeUnit
| |||||||||||
From interface
com.pnfsoftware.jeb.corei.parsers.asm.analyzer.IMethodManager
| |||||||||||
From interface
com.pnfsoftware.jeb.util.events.IEventSource
| |||||||||||
Convert a flexible native code unit address to a canonical memory address.
Unit addresses can be code labels, pseudo labels, string representations of physical addresses, etc.
| address | an address |
|---|
Convenience method used to retrieve a class by name.
Get the code analyzer. Life-cycle information: this method will return null until the unit is
processed.
Retrieve the currently-set analyzer extensions manager. Life-cycle information: this method
will return null until the unit is processed.
Note: third-party code should not use this for now.
Get the helper object used to format instructions into a sink.
Do not confuse the code formatter with the unit's formatter.
Provide the parent code object container, if there is one. Typically, that would be an ELF,
PE-COFF, or Mach-O unit accessible through the generic interface ICodeObjectUnit or
any of the derived specialized interfaces.
Provide the disassembly document. This is a convenience method that returns an
INativeDisassemblyDocument instead of a generic ITextDocument (provided by
getFormatter()).
Retrieve the endianness. This method is for convenience only; byte ordering can always be
retrieved through the IProcessor.
Convenience method used to retrieve a field by name.
Retrieve the size of the image
Retrieve an internal method by address (any address within the method). An internal method
has an associated data item associated to it. If multiple
methods share the provided address, the one with the lowest entry-point address is returned.
| addressIsEntryPoint | true if the provided address is the method entry-point; false if the address is just part of the routine. In the latter case, if the address belongs to several routines, any one is returned |
|---|
Retrieve all internal methods. An internal method has an associated
data item associated to it.
Retrieve the internal methods spanning over the provided address
Optionally provide an object associated with the given item. This method may return null, an opaque object, or an object defined by the contract of the implementing object or sub-interface. The SPI of sub-interfaces should specify the item id formats, if any, as well as types and semantics associated with the objects returned by this method.
| id | the item id |
|---|
Retrieve the model lock, used to request a full-access model lock or a partial, read-only, transactional lock. All plugin code accessing the native units and units relying on native units should use those locks to perform operations safely in a concurrent environment.
Convenience method used to retrieve a method by name.
Retrieve the difference between Physical Image base as set by
#setPhysicalImageBase(Long) and Virtual Image Base as retrieved by
getVirtualImageBase(). This value should only be used for
rendering.
Retrieve the machine code parser (pseudo-processor) managed by this unit.
Retrieve the simplest symbol address that corresponds to the given physical address. Same as
getSymbolicStringAddress(address, 0).
Retrieve a symbol address that corresponds to the given physical address.
Example: if address if at offset 10h inside method foo() (at address 401000h), querying this method with sspref=2 will return a label "foo+10h"; however, querying with sspref=0 would simply return "401010h".
| sspref | 0=simplest, 1=existing_label, 2=routine-based (TODO: enum for API pub.) |
|---|
Retrieve the virtual image base, indicated in the code container (most of the time a PE, ELF, or MachO container). This virtual address is the reference for every memory access.
Start an analysis.
| async | if true, this method is executed asynchronously and returns immediately; use
isAnalyzing() to determine whether the analysis has
completed. |
|---|---|
| includeAdvancedAnalysis | if null, use the unit's settings; if non-null, bypass the unit's configuration and force-enable or force-disable the advanced analysis |
| onCompletion | optional runnable to be executed on completion (always) |
| name | optional |
|---|
Optionally set the current optional virtual memory (VM) used by this unit. This method should
be called at most once (typically done in the unit's identifier), before processing the unit. It is optional; the VM object set may be overridden during unit
processing if it is deemed inappropriate to handle the code object. Therefore, after
processing, client code should always retrieve the actual VM object via getMemory().
| mem | optional VM |
|---|
Set the real (physical) image base for this piece of code. That address is the real address of the first loaded byte on a target device. The existence of this method implies that at most one physical address can be used at any time. (Typically, debuggers use this method to let code units know of where they are currently mapped, which in turn is used to better render assembly output.) Generally, the physical image address changes across different launches.
| physicalImageBase | the physical image base of this code unit; the value 0 means that the physical address is unknown |
|---|
Set the code parser (processor) used by this unit. This method should be called at most once
(typically done in the unit's identifier), before processing the unit.
| proc | mandatory processor |
|---|
Parse and attempt to create a routine at the provided address. The processor mode used will be the default one, and the analysis will be done forcefully.
| address | address |
|---|
Parse and attempt to create a routine at the provided address.
| address | address |
|---|---|
| procmode | processor mode |
| permission | one of the PERMISSION_xxx constants of
INativeCodeAnalyzer (refer to
enqueuePointerForAnalysis for details) |
Parse and attempt to create a routine at the provided address. The analysis is done forcefully.
| address | address |
|---|---|
| procmode | processor mode |
Preferred image base for raw binary files. Will be disregarded and set to a proper value for managed binaries.