Class FunctionEncodedMemoryArea

java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.memory.AbstractEncodedMemoryArea
com.pnfsoftware.jeb.core.units.code.asm.processor.memory.FunctionEncodedMemoryArea
All Implemented Interfaces:
IEncodedMemoryArea

public class FunctionEncodedMemoryArea extends AbstractEncodedMemoryArea
Function Encoded Memory area uses a generic Function to determine the real memory area to use. Since Memory area is dynamic, the length is also dynamic and must be set by user (it is discouraged to use this FunctionEncodedMemoryArea in composed EncodedMemoryAreaList when length is dynamic).
  • Constructor Details

    • FunctionEncodedMemoryArea

      public FunctionEncodedMemoryArea(int length, Function<byte[],Long> f)
      Create a function-backed encoded memory area.
      Parameters:
      length - encoded area length in bits
      f - decoding function
  • Method Details

    • getLength

      public int getLength()
      Description copied from interface: IEncodedMemoryArea
      Retrieve the encoded area length in bits.
      Returns:
      length in bits
    • decode

      public long decode(byte[] code)
      Description copied from interface: IEncodedMemoryArea
      Decode the area from instruction bytes.
      Parameters:
      code - instruction bytes
      Returns:
      decoded value