public abstract class

AbstractCodeObjectUnit

extends AbstractBinaryUnit
implements ICodeObjectUnit
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.events.JebEventSource
     ↳ com.pnfsoftware.jeb.core.units.AbstractUnit
       ↳ com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
         ↳ com.pnfsoftware.jeb.core.units.codeobject.AbstractCodeObjectUnit

Class Overview

Convenient base class for code objects.

Summary

Public Constructors
AbstractCodeObjectUnit(IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
Protected Constructors
AbstractCodeObjectUnit()
Public Methods
void addAllSections(Collection<? extends ISegmentInformation> sections)
void addAllSegments(Collection<? extends ISegmentInformation> segments)
void addAllSymbols(Collection<? extends ISymbolInformation> symbols)
void addSection(ISegmentInformation section)
void addSegment(ISegmentInformation segment)
void addSymbol(ISymbolInformation symbol)
long convertFileOffsetToRelativeAddress(long offset)
Convert a file offset to a memory address, relative to the base.
long convertRelativeAddressToFileOffset(long rel)
Convert a memory address (relative to the base) to a file offset.
ByteOrder getByteOrder()
Convenience method.
List<? extends ISymbolInformation> getExportedSymbols()
Retrieve the list of exported symbols.
List<? extends ISymbolInformation> getImportedSymbols()
Retrieve the list of imported symbols.
ILoaderInformation getLoaderInformation()
Retrieve basic information about the object file.
IVirtualMemory getMemoryMappedImage()
int getSectionCount()
List<? extends ISegmentInformation> getSections()
Retrieve the list of sections defined in the object file.
int getSegmentCount()
List<? extends ISegmentInformation> getSegments()
Retrieve the list of segments defined in the object file.
int getSymbolCount()
List<? extends ISymbolInformation> getSymbols()
void insertSection(int index, ISegmentInformation section)
void insertSegment(int index, ISegmentInformation segment)
void insertSymbol(int index, ISymbolInformation symbol)
void removeSection(int index)
void removeSegment(int index)
void removeSymbol(int index)
void setLoaderInformation(ILoaderInformation ldinfo)
void setMemoryMappedImage(IVirtualMemory mem)
Protected Methods
IVirtualMemory mapImageToMemory(IVirtualMemory mem)
Standard memory mapping of all publicized segments.
[Expand]
Inherited Methods
From class com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
From class com.pnfsoftware.jeb.core.units.AbstractUnit
From class com.pnfsoftware.jeb.core.events.JebEventSource
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.units.IBinaryUnit
From interface com.pnfsoftware.jeb.core.units.IUnit
From interface com.pnfsoftware.jeb.core.units.codeobject.ICodeObjectUnit
From interface com.pnfsoftware.jeb.util.events.IEventSource

Public Constructors

public AbstractCodeObjectUnit (IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)

Protected Constructors

protected AbstractCodeObjectUnit ()

Public Methods

public void addAllSections (Collection<? extends ISegmentInformation> sections)

public void addAllSegments (Collection<? extends ISegmentInformation> segments)

public void addAllSymbols (Collection<? extends ISymbolInformation> symbols)

public void addSection (ISegmentInformation section)

public void addSegment (ISegmentInformation segment)

public void addSymbol (ISymbolInformation symbol)

public long convertFileOffsetToRelativeAddress (long offset)

Convert a file offset to a memory address, relative to the base.

Parameters
offset a file offset
Returns
  • a base-relative memory address, or -1 if unsupported or if the offset does not map to anywhere in memory

public long convertRelativeAddressToFileOffset (long rel)

Convert a memory address (relative to the base) to a file offset.

Parameters
rel the base-relative memory address
Returns
  • a file offset, or -1 if unsupported or if the address does not map to anywhere in the file

public ByteOrder getByteOrder ()

Convenience method. Indicate the natural byte ordering for the code contained in this object file.

Returns
  • the byte order, little or big endian

public List<? extends ISymbolInformation> getExportedSymbols ()

Retrieve the list of exported symbols.

Returns
  • the list (possibly empty) of exported symbols, or null if unsupported

public List<? extends ISymbolInformation> getImportedSymbols ()

Retrieve the list of imported symbols.

Returns
  • the list (possibly empty) of imported symbols, or null if unsupported

public ILoaderInformation getLoaderInformation ()

Retrieve basic information about the object file.

Returns
  • the object file information, never null

public IVirtualMemory getMemoryMappedImage ()

public int getSectionCount ()

public List<? extends ISegmentInformation> getSections ()

Retrieve the list of sections defined in the object file. Typically, sections are used to point to areas of interest. Sections and segments may overlap.

Returns
  • the list of sections, or null if unsupported

public int getSegmentCount ()

public List<? extends ISegmentInformation> getSegments ()

Retrieve the list of segments defined in the object file. Typically, segments are mapped to memory by a code object loader. Segments and sections may overlap.

Returns
  • the list of segments, or null if unsupported

public int getSymbolCount ()

public List<? extends ISymbolInformation> getSymbols ()

public void insertSection (int index, ISegmentInformation section)

public void insertSegment (int index, ISegmentInformation segment)

public void insertSymbol (int index, ISymbolInformation symbol)

public void removeSection (int index)

public void removeSegment (int index)

public void removeSymbol (int index)

public void setLoaderInformation (ILoaderInformation ldinfo)

public void setMemoryMappedImage (IVirtualMemory mem)

Protected Methods

protected IVirtualMemory mapImageToMemory (IVirtualMemory mem)

Standard memory mapping of all publicized segments.

Parameters
mem optional memory image; if null, a new VM will be created
Returns
  • the memory image containing the mapped object file