# Class: com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment

Simulation environment. Serves as a proxy to access outside method world. In particular it provides: 
 
- concrete values for parameters, routine calls, global variables 
- access to the underlying native unit 

 The environment might be modified by a simulation, namely by writing into global variables or into memory. The stateful information should be cleared before an environment can be re\-used for a simulation \(see [#clearState()](#clearState())\).

## Constructor: CEnvironment
- parameter: `nativeUnit`, type: `com.pnfsoftware.jeb.core.units.INativeCodeUnit<?>`


## Method: clearState

Description: This method should be called before re\-using the environment for another simulation.

## Method: getBaseTypeSize
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICType`
- return type: `int`

Description: Get base type size in bytes, i.e. the size of TYPE in 'TYPE \*'

## Method: getDefaultPointedSize
- return type: `java.lang.Integer`

Description: Gets the default size for memory reads through pointers, in bytes.

## Method: getGlobalVarValue
- parameter: `gvar`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- parameter: `readInMemory`, type: `boolean`
- return type: `java.lang.Long`


## Method: getParameterValue
- parameter: `param`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- return type: `java.lang.Long`


## Method: getParameterValue
- parameter: `param`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- parameter: `autoGenerate`, type: `boolean`
- return type: `java.lang.Long`


## Method: getPassedParameterValue
- parameter: `arg`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- return type: `long`


## Method: getRoutineDefaultReturnValue
- return type: `java.lang.Long`


## Method: getRoutineReturnValue
- parameter: `calledRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICMethod`
- parameter: `autoGenerate`, type: `boolean`
- return type: `java.lang.Long`


## Method: getTypeSize
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICType`
- return type: `int`

Description: Get type size in bytes

## Method: getVarAddress
- parameter: `var`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- return type: `java.lang.Long`


## Method: isAutoGenerateUndefinedIdentifierValue
- return type: `boolean`


## Method: isParameterValueSet
- parameter: `param`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- return type: `boolean`


## Method: readMemory
- parameter: `address`, type: `long`
- parameter: `bytesToRead`, type: `int`
- return type: `java.lang.Long`


## Method: setAutoGenerateUndefinedIdentifierValue
- parameter: `autoGenerateUndefinedIdentifierValue`, type: `boolean`


## Method: setAutoGeneratedParameterValue
- parameter: `param`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`


## Method: setAutoGeneratedRoutineReturnValue
- parameter: `calledRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICMethod`


## Method: setDefaultPointedSize
- parameter: `defaultPointedSize`, type: `java.lang.Integer`


## Method: setGlobalVarValue
- parameter: `gvar`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- parameter: `value`, type: `long`


## Method: setParameterValue
- parameter: `param`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- parameter: `value`, type: `long`


## Method: setRoutineReturnValue
- parameter: `calledRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICMethod`
- parameter: `retVal`, type: `long`


## Method: setVarAddress
- parameter: `var`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIdentifier`
- parameter: `address`, type: `long`


## Method: toString
- return type: `java.lang.String`


## Method: writeMemory
- parameter: `address`, type: `long`
- parameter: `value`, type: `long`


## Static Method: areEquivalent
- parameter: `env1`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment`
- parameter: `env2`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment`
- return type: `boolean`


## Static Method: copy
- parameter: `copy`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.simulator.CEnvironment`


