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 |
Convenient base class for code objects.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pnfsoftware.jeb.core.events.JebEventSource
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractCodeObjectUnit(IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| ||||||||||
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.
| ||||||||||
synchronized IVirtualMemory |
getRawMemoryMappedImage()
Retrieve a raw mapping of the code object.
| ||||||||||
ISegmentInformation | getSection(int i) | ||||||||||
int | getSectionCount() | ||||||||||
List<? extends ISegmentInformation> |
getSections()
Retrieve the list of sections defined in the object file.
| ||||||||||
List<? extends ISegmentInformation> |
getSections(int wflags, int bflags)
Retrieve a list of sections.
| ||||||||||
ISegmentInformation | getSegment(int i) | ||||||||||
int | getSegmentCount() | ||||||||||
List<? extends ISegmentInformation> |
getSegments(int wflags, int bflags)
Retrieve a list of segments.
| ||||||||||
List<? extends ISegmentInformation> |
getSegments()
Retrieve the list of segments defined in the object file.
| ||||||||||
int | getSymbolCount() | ||||||||||
Collection<? extends ISymbolInformation> | getSymbols() | ||||||||||
List<? extends ISymbolInformation> | getSymbols(int mustHaveFlags, int mustNotHaveFlags) | ||||||||||
List<? extends ISegmentInformation> |
getValidSections()
Retrieve the list of sections that are not marked INVALID.
| ||||||||||
List<? extends ISegmentInformation> |
getValidSegments()
Retrieve the list of segments that are not marked INVALID.
| ||||||||||
boolean |
map(IVirtualMemory mem, long wantedBase, boolean applyRelocations, ILinkInfoProvider linkInfoPrv)
Map this object file onto virtual memory.
|
Protected 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) | ||||||||||
boolean | addSymbol(ISymbolInformation symbol) | ||||||||||
abstract boolean |
applyRelocations(IVirtualMemory mem, long base, ILinkInfoProvider linkInfoPrv)
Relocate a mapped code object.
| ||||||||||
IVirtualMemory |
createSuitableMemory()
Create a virtual memory suitable to map this code object.
| ||||||||||
IInput |
getMappableInput()
Retrieve the input that is truly mappable.
| ||||||||||
void | insertSection(int index, ISegmentInformation section) | ||||||||||
void | insertSegment(int index, ISegmentInformation segment) | ||||||||||
boolean |
mapRawNoReloc(IVirtualMemory mem, long base)
Map the object's segments at the provided base without applying relocations.
| ||||||||||
void | removeSection(int index) | ||||||||||
void | removeSegment(int index) | ||||||||||
void | setLoaderInformation(ILoaderInformation ldInfo) | ||||||||||
abstract boolean |
shouldAllocateFullImage()
Indicate whether the loader should allocate the full image range when preparing to load and
map a code object file to memory.
|
[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.IUnitCreator
| |||||||||||
From interface
com.pnfsoftware.jeb.core.IUserDataSupport
| |||||||||||
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
|
Convert a file offset to a memory address, relative to the base.
offset | a file offset |
---|
Convert a memory address (relative to the base) to a file offset.
rel | the base-relative memory address |
---|
Retrieve the list of exported symbols.
Retrieve the list of imported symbols.
Retrieve basic information about the object file.
Retrieve a raw mapping of the code object. No relocations are applied. Do not attempt to modify the returned VM object; it should be considered read-only.
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.
Retrieve a list of sections.
wflags | must-have flags |
---|---|
bflags | must-not-have flags |
Retrieve a list of segments.
wflags | must-have flags |
---|---|
bflags | must-not-have flags |
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.
Retrieve the list of sections that are not marked INVALID.
Retrieve the list of segments that are not marked INVALID.
Map this object file onto virtual memory.
mem | memory image onto which the mapping should be done |
---|---|
wantedBase | wanted base; set to -1L to request mapping at the normal base |
linkInfoPrv | optional |
Relocate a mapped code object.
mem | virtual memory |
---|---|
base | mapping base address |
linkInfoPrv | optional |
Create a virtual memory suitable to map this code object.
Retrieve the input that is truly mappable. The default implementation simply returns
getInput()
, as is expected in most cases (eg, ELF, PE). For formats requiring
pre-processing of the input data, such as IHEX or other ascii-encoded code objects, this
method should be overridden.
Map the object's segments at the provided base without applying relocations.
Indicate whether the loader should allocate the full image range when preparing to load and map a code object file to memory.
Typically, the answer is yes for PE-like files, no for ELF-like files.