# Interface: com.pnfsoftware.jeb.core.units.codeobject.ICodeObjectUnit

A common interface for object files that hold machine code such as ELF, PE, or Mach\-O. 

 Code objects are used to store program information, data, and code, at various stages of the program's life \- compilation, linkage, execution. Popular loaders include Linux ELF, Microsoft PE/COFF, and Apple Mach\-O. 

 This interface provides a unified representation for such files. Clients \(such as the official RCP client\) should be aware of this interface and use it to display additional details about the unit \- without the unit implementor having to generate documents \(although documents may be generated to represent unit\-specific bits of data\). 

 All methods return values are "optional".

## Method: convertFileOffsetToRelativeAddress
- parameter: `offset`, type: `long`
- return type: `long`

Description: Convert a file offset to a memory address, relative to the base.
parameter: offset: a file offset
return: a base\-relative memory address, or \-1 if unsupported or if the offset does not map to         anywhere in memory

## Method: convertRelativeAddressToFileOffset
- parameter: `rel`, type: `long`
- return type: `long`

Description: Convert a memory address \(relative to the base\) to a file offset.
parameter: rel: the base\-relative memory address
return: a file offset, or \-1 if unsupported or if the address does not map to anywhere in the         file

## Method: getExportedSymbols
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`

Description: Retrieve the list of exported symbols.
return: the list \(possibly empty\) of exported symbols, or null if unsupported

## Method: getImportedSymbols
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`

Description: Retrieve the list of imported symbols.
return: the list \(possibly empty\) of imported symbols, or null if unsupported

## Method: getLoaderInformation
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ILoaderInformation`

Description: Retrieve basic information about the object file.
return: the object file information, never null

## Method: getRawMemoryMappedImage
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: 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.
return: the virtual memory containing the mapped, unresolved code object; null on error or if         the code object unit decided to not map the object file

## Method: getSection
- parameter: `i`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`

Description: 
parameter: i: 
return: 

## Method: getSectionCount
- return type: `int`

Description: 
return: 

## Method: getSections
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: 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.
return: the list of sections, or null if unsupported

## Method: getSections
- parameter: `wflags`, type: `int`
- parameter: `bflags`, type: `int`
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: Retrieve a list of sections.
parameter: wflags: must\-have flags
parameter: bflags: must\-not\-have flags
return: 

## Method: getSegment
- parameter: `i`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`

Description: 
parameter: i: 
return: 

## Method: getSegmentCount
- return type: `int`

Description: 
return: 

## Method: getSegments
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: 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.
return: the list of segments, or null if unsupported

## Method: getSegments
- parameter: `wflags`, type: `int`
- parameter: `bflags`, type: `int`
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: Retrieve a list of segments.
parameter: wflags: must\-have flags
parameter: bflags: must\-not\-have flags
return: 

## Method: getSymbols
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`

Description: 
return: 

## Method: getSymbols
- parameter: `mustHaveFlags`, type: `int`
- parameter: `mustNotHaveFlags`, type: `int`
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`

Description: 
parameter: mustHaveFlags: 
parameter: mustNotHaveFlags: 
return: 

## Method: getValidSections
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: Retrieve the list of sections that are not marked INVALID.
return: 

## Method: getValidSegments
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`

Description: Retrieve the list of segments that are not marked INVALID.
return: 

## Method: map
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`
- parameter: `wantedBase`, type: `long`
- parameter: `applyRelocations`, type: `boolean`
- parameter: `linkInfoPrv`, type: `com.pnfsoftware.jeb.core.units.codeobject.ILinkInfoProvider`
- return type: `boolean`

Description: Map this object file onto virtual memory.
parameter: mem: memory image onto which the mapping should be done
parameter: wantedBase: wanted base; set to \-1L to request mapping at the normal base
parameter: applyRelocations: 
parameter: linkInfoPrv: optional
return: success indicator

