# Interface: com.pnfsoftware.jeb.core.units.INativeCodeUnit
- Type Parameter: InsnType extends `com.pnfsoftware.jeb.core.units.code.IInstruction`

- Super interfaces: `com.pnfsoftware.jeb.core.units.code.ICodeUnit`, `com.pnfsoftware.jeb.core.units.code.asm.items.IMethodManager`, `com.pnfsoftware.jeb.core.units.code.asm.INativeContext`

Specialized code unit that manages a native code processor and uses a virtual memory.  

  Code units own and work closely with the following objects:  
  
- [INativeCodeAnalyzer](com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzer.md) \- code analyzer  
- [IMemoryModel](com.pnfsoftware.jeb.core.units.code.asm.analyzer.IMemoryModel.md) \- code model for [INativeItem](com.pnfsoftware.jeb.core.units.code.asm.items.INativeItem.md) and derived objects  
- [ITypeManager](com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager.md) \- type and package manager  

  

  Note: if a debugger is attached, a temporary physical image base can be set.

## Static Final Field: externalSymbolsPrefix
Type: `java.lang.String`

Constant value: `extern`
Description: [SymbolType#EXTERN_FUNCTION](SymbolType#EXTERN_FUNCTION) routine prefix

## Static Final Field: importPtrPrefix
Type: `java.lang.String`

Constant value: `ptr_`
Description: [SymbolType#PTRFUNCTION](SymbolType#PTRFUNCTION) routine prefix

## Static Final Field: targetPrefix
Type: `java.lang.String`

Constant value: `*`
Description: Target routine prefix with named trampoline: '\*'

## Static Final Field: trampolinePrefix
Type: `java.lang.String`

Constant value: `→`
Description: Trampoline routines prefix: unicode RIGHTWARDS ARROW '→'

## Abstract Method: getAddressFromCodeCoordinates
- parameter: `cc`, type: `com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates`
- parameter: `precision`, type: `com.pnfsoftware.jeb.core.output.AddressConversionPrecision`
- return type: `java.lang.String`

Description: Convert code coordinates to an address string.
parameter: cc: code coordinates
parameter: precision: conversion precision
return: an address string, or null if none

## Abstract Method: getAnalyzerExtension
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzerExtension<InsnType>`

Description: Get the principal code analyzer extension attached to this unit.
return: the analyzer extension

## Abstract Method: getCanonicalMemoryAddress
- parameter: `address`, type: `java.lang.String`
- return type: `long`

Description: 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.
parameter: address: an address
return: the memory address, or \-1 \(0xFFFFFFFF\_FFFFFFFFL\) on failure

## Abstract Method: getCanonicalMemoryAddress
- parameter: `address`, type: `java.lang.String`
- parameter: `precision`, type: `com.pnfsoftware.jeb.core.output.AddressConversionPrecision`
- return type: `long`

Description: 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.
parameter: address: an address
parameter: precision: use COARSE to bypass early name resolution, and attempt a simple number             conversion first \(e.g., with coarse address "aabb" will be resolved to 0xAABB             before looking if an item is named "aabb"\); with FINE \(or DEFAULT\), item name             resolution is attempted first; therefore, for quick and unreliable conversions,             use COARSE; else, use the DEFAULT setting
return: the memory address, or \-1 \(0xFFFFFFFF\_FFFFFFFFL\) on failure

## Abstract Method: getClass
- parameter: `fqname`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeClassItem`


## Abstract Method: getClassByIndex
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeClassItem`

Description: Get a class by its internal index. Class indices are monotonously increasing, and gaps may  exist as classes get destroyed and created. The caller should not assume that  `getClassByIndex(i)==getClasses().get(i)`.
parameter: index: an opaque class index, eg one present in [ICodeCoordinates](com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates.md)
return: a class object or null

## Abstract Method: getClassManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.IClassManager`

Description: Get the class manager used by this unit.
return: the class manager

## Abstract Method: getClasses
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeClassItem>`


## Abstract Method: getCodeAnalyzer
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzer<InsnType>`

Description: Get the code analyzer.  

  Life\-cycle information: this method will return null until the unit is [processed](#process()).
return: the code analyzer, or null if unavailable

## Abstract Method: getCodeAnalyzerExtensionsManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzerExtensionsManager<InsnType>`

Description: Retrieve the currently\-set analyzer extensions manager. Life\-cycle information: this method  will return null until the unit is [processed](#process()).  

  Note: third\-party code should not use this for now.
return: the analyzer extensions manager, or null if unavailable

## Abstract Method: getCodeFormatter
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.GenericCodeFormatter<InsnType>`

Description: Get the helper object used to format instructions into a sink.  

  Do not confuse the code formatter with the unit's [formatter](#getFormatter()).
return: the code formatter

## Abstract Method: getCodeModel
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeModel<InsnType>`

Description: Get the code model.
return: the code model

## Abstract Method: getCodeObjectContainer
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ICodeObjectUnit`

Description: 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](com.pnfsoftware.jeb.core.units.codeobject.ICodeObjectUnit.md) or  any of the derived specialized interfaces.
return: a unit or null

## Abstract Method: getCommentManager
- return type: `com.pnfsoftware.jeb.core.units.code.NativeCommentManager`


## Abstract Method: getDataTypeAt
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`

Description: Get the native type of the data item located at the provided address.
parameter: address: item address
return: the native type, or null if none

## Abstract Method: getDecompiler
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.INativeDecompilerUnit<InsnType>`

Description: Retrieve or create a decompiler for this unit. If a corresponding `gendec` plugin is  not available with your JEB license, null is returned.
return: the native decompiler unit, or null if unavailable

## Abstract Method: getDisassemblyDocument
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.INativeDisassemblyDocument`


## Abstract Method: getEndianness
- return type: `com.pnfsoftware.jeb.util.io.Endianness`

Description: Retrieve the endianness. This method is for convenience only; byte ordering can always be  retrieved through the [IProcessor](com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor.md).
return: byte ordering for the target

## Abstract Method: getEntryPointAddress
- return type: `long`

Description: Get the address of the entry\-point of this unit, if any.
return: entry\-point address, or \-1L if none

## Abstract Method: getField
- parameter: `fqname`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeFieldItem`


## Abstract Method: getFieldByIndex
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeFieldItem`

Description: Get a field by its internal index. Field indices are monotonously increasing, and gaps may  exist as fields get destroyed and created. The caller should not assume that  `getFieldByIndex(i)==getFields().get(i)`.
parameter: index: an opaque field index, eg one present in [ICodeCoordinates](com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates.md)
return: a field object or null

## Abstract Method: getFieldManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.IFieldManager`

Description: Get the field manager used by this unit.
return: the field manager

## Abstract Method: getFields
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.items.INativeFieldItem>`


## Abstract Method: getHighLevelEntryPointAddress
- return type: `long`

Description: Get the address of the high\-level entry\-point of this unit, if any.  

  The high\-level entry\-point corresponds to a `main()` \(or similar\) routine. It is  the routine executed after the compiler\-generated initialization code is executed. Note that  it might be set as a result of the initial analysis.
return: real entry point address, \-1L if none

## Abstract Method: getInlineComment
- parameter: `address`, type: `long`
- return type: `java.lang.String`

Description: Convenience method used to retrieve the inline comment at the provided virtual address.
parameter: address: VA
return: a comment or null

## Abstract Method: getInternalMethod
- parameter: `memoryAddress`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`

Description: Retrieve an internal method by its entry\-point address. An internal method has an associated  [data](com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodDataItem.md) item associated to it. If multiple methods share the  provided entry\-point address, the first one is returned.
parameter: memoryAddress: entry\-point address
return: a routine item or null

## Abstract Method: getInternalMethod
- parameter: `memoryAddress`, type: `long`
- parameter: `addressIsEntryPoint`, type: `boolean`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`

Description: Retrieve an internal method by address \(any address within the method\). An internal method  has an associated [data](com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodDataItem.md) item associated to it. If multiple  methods share the provided address, the one with the lowest entry\-point address is returned.
parameter: memoryAddress: memory address
parameter: 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
return: a routine item or null

## Abstract Method: getInternalMethods
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem>`

Description: Retrieve all internal methods. An internal method has an associated  [data](com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodDataItem.md) item associated to it.
return: a list of internal methods

## Abstract Method: getInternalMethods
- parameter: `memoryAddress`, type: `long`
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem>`

Description: Retrieve the internal methods spanning over the provided address
parameter: memoryAddress: memory address
return: a list of internal methods spanning over the address

## Abstract Method: getInternalMethodsLeafFirst
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem>`

Description: Retrieve all internal methods, ordered from the leaves to the roots. An internal method has  an associated [data](com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodDataItem.md) item associated to it.
return: a list of internal methods

## Abstract Method: getInternalMethodsSizeFirst
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem>`

Description: Retrieve all internal methods, ordered from their ascending byte size. An internal method has  an associated [data](com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodDataItem.md) item associated to it.
return: a list of internal methods

## Abstract Method: getItemObject
- parameter: `id`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeItem`


## Abstract Method: getLock
- return type: `com.pnfsoftware.jeb.core.units.IUnitLock`

Description: 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.
return: the native model lock

## Abstract Method: getMemory
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: Retrieve the virtual memory managed used by this unit.
return: the virtual memory

## Abstract Method: getMethod
- parameter: `fqname`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`


## Abstract Method: getMethodByIndex
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`

Description: Get a method by its internal index. Method indices are monotonously increasing, and gaps may  exist as methods get destroyed and created. The caller should not assume that  `getMethodByIndex(i)==getMethods().get(i)`.
parameter: index: an opaque method index, eg one present in [ICodeCoordinates](com.pnfsoftware.jeb.core.output.code.coordinates.ICodeCoordinates.md)
return: a method object or null

## Abstract Method: getMethodManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.IMethodManager`

Description: Get the method manager used by this unit.
return: the method manager

## Abstract Method: getMethods
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem>`


## Abstract Method: getNativeItemAt
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Get the item located at the exact address.
parameter: address: item start address
return: the item, or null if none

## Abstract Method: getNativeItemOver
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Get the item spanning over the provided address.
parameter: address: an address
return: the item, or null if none

## Abstract Method: getNativeItemsOver
- parameter: `address`, type: `long`
- parameter: `size`, type: `int`
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Retrieve a read\-only map of the native items located within the provided memory range.
parameter: address: start address
parameter: size: range size in bytes
return: a map of item addresses to native items

## Abstract Method: getPackageManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.IPackageManager`

Description: Get the package/namespace manager used by this unit.
return: the package manager

## Abstract Method: getPackages
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.type.IPackage>`


## Abstract Method: getPhysicalImageDelta
- return type: `long`

Description: Retrieve the difference between Physical Image base as set by  [#setPhysicalImageBase(long)](#setPhysicalImageBase(long)) and Virtual Image Base as retrieved by  [#getVirtualImageBase()](#getVirtualImageBase()). **This value should only be used for  rendering.**
return: the physical image delta

## Abstract Method: getProcessor
- return type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor<InsnType>`

Description: Retrieve the machine code parser \(pseudo\-processor\) managed by this unit.
return: the processor

## Abstract Method: getProcessorName
- return type: `java.lang.String`

Description: Convenience method used to retrieve the processor's name. The processor value specifies,  among other things, the underlying instruction set used by the instructions of this code  unit.
return: a lower\-case string, never null \(if the processor is unknown or not set, 'unknown' is          retrieved\)

## Abstract Method: getSignatureManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.sig.NativeSignatureDBManager`

Description: Get the global signature manager used by this unit.
return: the signature manager

## Abstract Method: getStringByIndex
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeStringItem`

Description: Retrieve a string by index. Careful, this is not the same as [getStrings\(\).get\(index\)](#getStrings()).
parameter: index: internal string index
return: the string item, or null if none

## Abstract Method: getStrings
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.items.INativeStringItem>`


## Abstract Method: getSymbolicStringAddress
- parameter: `address`, type: `long`
- return type: `java.lang.String`

Description: Retrieve the simplest symbol address that corresponds to the given physical address. Same as  [getSymbolicStringAddress\(address, 0\)](#getSymbolicStringAddress(long, int)).
parameter: address: memory address
return: a symbolic address string

## Abstract Method: getSymbolicStringAddress
- parameter: `address`, type: `long`
- parameter: `sspref`, type: `int`
- return type: `java.lang.String`

Description: 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".
parameter: address: a memory address
parameter: sspref: resolution type: \(in the examples a below, a routine exists at address             0x401000\)
             0= will resolve to a standard hex\-formatted address, e.g. `0x402000` to             `402000h`
             1= will first resolve to any existing label, routine address, e.g.             `0x401000` to `sub_401000` etc.
             2= will first resolve to a routine\-based address, e.g. `sub_401010` to             `sub_401000+10h`
return: a symbolic address string

## Abstract Method: getTypeLibraryService
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryService`

Description: Get the global type library service.
return: the type library service

## Abstract Method: getTypeManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.ITypeManager`

Description: Get the global type manager used by this unit.
return: the type manager

## Abstract Method: getTypes
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.code.asm.type.INativeType>`


## Abstract Method: isAnalysisCompleted
- return type: `boolean`

Description: Determine whether a code analysis pass is ongoing.
return: false if a code analysis is currently taking place, true otherwise

## Abstract Method: isInitialAnalysisDone
- return type: `boolean`

Description: Determine whether or not an initial analysis pass has been done.
return: true if initial analysis has completed

## Abstract Method: performAnalysis
- parameter: `async`, type: `boolean`
- parameter: `includeAdvancedAnalysis`, type: `java.lang.Boolean`
- parameter: `onCompletion`, type: `java.lang.Runnable`
- return type: `boolean`

Description: Start an analysis.
parameter: async: if true, this method is executed asynchronously and returns immediately; use             [INativeCodeAnalyzer#isAnalyzing()](INativeCodeAnalyzer#isAnalyzing()) to determine whether the analysis has             completed.
parameter: 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
parameter: onCompletion: optional runnable to be executed on completion \(always\)
return: true if the analysis was started

## Abstract Method: performInitialAnalysis
- return type: `boolean`

Description: Perform the initial analysis pass. This method should be called once, after  [successful unit processing](#isProcessed()). The initial analysis pass parameters, such  as synchronicity, the inclusion of global or advanced analysis, etc. are determined  automatically.
return: true if the analysis pass was started or completed

## Abstract Method: performInitialAnalysis
- parameter: `blocking`, type: `java.lang.Boolean`
- return type: `boolean`

Description: Perform the initial analysis pass.
parameter: blocking: optional blocking mode
return: true if the analysis pass was started or completed

## Abstract Method: process
- return type: `boolean`

Description: Quickly process the unit. Be careful that the [IUnit](com.pnfsoftware.jeb.core.units.IUnit.md) is not analyzed while  [#performInitialAnalysis()](#performInitialAnalysis()) was not called.
return: true if [IUnit](com.pnfsoftware.jeb.core.units.IUnit.md) was processed \(may then check [#isInitialAnalysisDone()](#isInitialAnalysisDone())          to check that unit is fully usable\)

## Abstract Method: setAnalyzerExtension
- parameter: `ext`, type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzerExtension<InsnType>`

Description: Set the principal code analyzer extension for this unit.
parameter: ext: analyzer extension

## Abstract Method: setCallingConvention
- parameter: `cc`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.ICallingConvention`

Description: Set the default calling convention.
parameter: cc: calling convention

## Abstract Method: setCodeAt
- parameter: `address`, type: `long`
- parameter: `procmode`, type: `int`
- parameter: `undefineOverlappingItems`, type: `boolean`
- return type: `boolean`

Description: Parse and create an instruction at the provided address.
parameter: address: instruction address
parameter: procmode: processor mode \(refer to `MODE_xxx` constants in             [IProcessor](com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor.md)\)
parameter: undefineOverlappingItems: if false, the method will fail if existing items overlap with             the memory range needed to accommodate a newly\-created item
return: success indicator

## Abstract Method: setCodeFormatter
- parameter: `codeFormatter`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.GenericCodeFormatter<InsnType>`

Description: Set the helper object used to format instructions into a sink.
parameter: codeFormatter: code formatter

## Abstract Method: setCompilerType
- parameter: `compilerType`, type: `com.pnfsoftware.jeb.core.units.codeobject.CompilerType`

Description: Set a hint. This method may be called optionally, before process\(\). The hint may be  disregarded.
parameter: compilerType: compiler type hint

## Abstract Method: setDataAt
- parameter: `address`, type: `long`
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`
- parameter: `name`, type: `java.lang.String`
- return type: `boolean`

Description: Create or update a data item at the provided address. Overlapping items may be deleted.  

  Note: to create String items, see [#setStringAt(long, long, StringEncoding, int, int)](#setStringAt(long, long, StringEncoding, int, int)).
parameter: address: item address
parameter: type: item type
parameter: name: optional name
return: success indicator

## Abstract Method: setDataAt
- parameter: `address`, type: `long`
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`
- parameter: `name`, type: `java.lang.String`
- parameter: `undefineOverlappingItems`, type: `boolean`
- return type: `boolean`

Description: Create or update a data item at the provided address.  

  Note: to create String items, see [#setStringAt(long, long, StringEncoding, int, int)](#setStringAt(long, long, StringEncoding, int, int)).
parameter: address: item address
parameter: type: item type
parameter: name: optional name
parameter: undefineOverlappingItems: if false, the method will fail if existing items overlap with             the memory range needed to accommodate a newly\-created item
return: success indicator

## Abstract Method: setDataTypeAt
- parameter: `address`, type: `long`
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.INativeType`
- return type: `boolean`

Description: Convenience method to set the native type of a data item located at the provided address. If  no item exists at the provided address, one will be created. Overlapping items may be  deleted.  

  Note: to create String items, see [#setStringAt(long, long, StringEncoding, int, int)](#setStringAt(long, long, StringEncoding, int, int)).
parameter: address: item address
parameter: type: native type
return: success indicator

## Abstract Method: setInlineComment
- parameter: `address`, type: `long`
- parameter: `comment`, type: `java.lang.String`
- return type: `boolean`

Description: Convenience method used to set the inline comment at the provided virtual address.
parameter: address: VA
parameter: comment: a comment
return: success indicator

## Abstract Method: setMemory
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: 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](#process()) 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()](#getMemory()).
parameter: mem: optional VM

## Abstract Method: setPhysicalImageBase
- parameter: `physicalImageBase`, type: `long`

Description: 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.
parameter: physicalImageBase: the physical image base of this code unit; the value 0 means that             the physical address is unknown

## Abstract Method: setProcessor
- parameter: `proc`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor<InsnType>`

Description: 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](#process()) the unit.
parameter: proc: mandatory processor

## Abstract Method: setRoutineAt
- parameter: `address`, type: `long`
- return type: `boolean`

Description: 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.
parameter: address: routine start address
return: success indicator: if true, a routine was created \(or existed\) at the provided          address

## Abstract Method: setRoutineAt
- parameter: `address`, type: `long`
- parameter: `procmode`, type: `int`
- return type: `boolean`

Description: Parse and attempt to create a routine at the provided address. The analysis is done  forcefully.
parameter: address: routine start address
parameter: procmode: processor mode
return: success indicator: if true, a routine was created \(or existed\) at the provided          address

## Abstract Method: setRoutineAt
- parameter: `address`, type: `long`
- parameter: `procmode`, type: `int`
- parameter: `permission`, type: `int`
- return type: `boolean`

Description: Parse and attempt to create a routine at the provided address.
parameter: address: routine start address
parameter: procmode: processor mode
parameter: permission: one of the `PERMISSION_xxx` constants of             [INativeCodeAnalyzer](com.pnfsoftware.jeb.core.units.code.asm.analyzer.INativeCodeAnalyzer.md) \(refer to             [enqueuePointerForAnalysis](INativeCodeAnalyzer#enqueuePointerForAnalysis(com.pnfsoftware.jeb.core.units.code.Pointer, int)) for details\)
return: success indicator: if true, a routine was created \(or existed\) at the provided          address

## Abstract Method: setRoutinePrototype
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `prototypeString`, type: `java.lang.String`
- return type: `boolean`

Description: Set a routine prototype. This method uses non\-standard prototype declarations and should be  avoided. Use [#setRoutineSignature(INativeMethodItem, String, boolean)](#setRoutineSignature(INativeMethodItem, String, boolean)) instead.
parameter: routine: target routine
parameter: prototypeString: a prototype string having the following style:              

```

 <calling-convention> returnType(paramType1 _)
 <calling-convention> returnType(paramType1, paramType2)
 <calling-convention> returnType(paramType1, paramType2, ...)
            
```
return: success indicator

## Abstract Method: setRoutineReferenceAt
- parameter: `address`, type: `long`
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- return type: `boolean`

Description: Create a special data item representing a reference to a method. Those items are similar to  function pointer items \(pointer to prototypes\), except that they refer specifically to  routine objects managed by this unit.
parameter: address: item address
parameter: routine: target routine
return: success indicator

## Abstract Method: setRoutineSignature
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `signatureString`, type: `java.lang.String`
- parameter: `prototypeOnly`, type: `boolean`
- return type: `boolean`

Description: Set a routine signature or protytpe.
parameter: routine: target routine
parameter: signatureString: a C\-like signature; some C\+\+ features such as namespaces \(`::`\)             or templates \(`<...>`\) are allowed but disregarded
parameter: prototypeOnly: if true, only the prototype will be applied; method and parameter names,             if provided, will not be applied
return: success indicator

## Abstract Method: setStringAt
- parameter: `address`, type: `long`
- parameter: `addressMax`, type: `long`
- parameter: `stringType`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.StringEncoding`
- parameter: `minChars`, type: `int`
- parameter: `maxChars`, type: `int`
- return type: `boolean`

Description: Create a string data item. Overlapping items may be deleted.
parameter: address: mandatory start address
parameter: addressMax: optional maximum \(final\) address for the string; use \-1 for no limit
parameter: stringType: the string type hint; null to let this method determine the best string             type heuristically
parameter: minChars: minimum number of characters to be found in the string for it to be             considered valid; set to \-1 for default \(currently: 3\)
parameter: maxChars: maximum number of characters \(not bytes\) to be parsed; set to \-1 for default             \(currently: 100\_000\)
return: success indicator

## Abstract Method: setStringAt
- parameter: `address`, type: `long`
- parameter: `addressMax`, type: `long`
- parameter: `stringType`, type: `com.pnfsoftware.jeb.core.units.code.asm.type.StringEncoding`
- parameter: `minChars`, type: `int`
- parameter: `maxChars`, type: `int`
- parameter: `undefineOverlappingItems`, type: `boolean`
- return type: `boolean`

Description: Create a string data item.
parameter: address: mandatory start address
parameter: addressMax: optional maximum \(final\) address for the string; use \-1 for no limit
parameter: stringType: the string type hint; null to let this method determine the best string             type heuristically
parameter: minChars: minimum number of characters to be found in the string for it to be             considered valid; set to \-1 for default \(currently: 3\)
parameter: maxChars: maximum number of characters \(not bytes\) to be parsed; set to \-1 for default             \(currently: 100\_000\)
parameter: undefineOverlappingItems: if false, the method will fail if existing items overlap with             the memory range needed to accommodate a newly\-created item
return: success indicator

## Abstract Method: setSubsystemType
- parameter: `subsystemType`, type: `com.pnfsoftware.jeb.core.units.codeobject.SubsystemType`

Description: Set a hint. This method may be called optionally, before process\(\). The hint may be  disregarded.
parameter: subsystemType: subsystem type hint

## Abstract Method: setVirtualImageBase
- parameter: `virtualImageBase`, type: `long`

Description: Set preferred image base
parameter: virtualImageBase: preferred virtual image base

## Abstract Method: undefineItem
- parameter: `address`, type: `long`
- return type: `boolean`

Description: Undefine the memory item starting at the provided address. Careful, this method may have  unintended side effects. Example: deleting an instruction item that's part of a routine body  will also discard that routine, which in turn may discard other items or references, within  this unit or other units.
parameter: address: item address
return: success indicator

