Class DirectEncodedMemoryArea

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

public class DirectEncodedMemoryArea extends AbstractEncodedMemoryArea
Represent a memory Area in code. A memory area is composed of an index and a length
  • Constructor Details

    • DirectEncodedMemoryArea

      protected DirectEncodedMemoryArea(int index, int length)
  • Method Details

    • getIndex

      public int getIndex()
      Retrieve the bit index of this area.
      Returns:
      bit index, where 0 represents the least significant bit
    • getLength

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

      public static DirectEncodedMemoryArea get(int index, int length)
      Build a DirectEncodedMemoryArea from index and length. Index 0 represents the least significant bit.
      Parameters:
      index - bit index
      length - length in bits
      Returns:
      encoded memory area
    • decodeInt

      public static int decodeInt(int index, int length, byte[] code)
      Decode bits from instruction bytes.
      Parameters:
      index - bit index
      length - length in bits
      code - instruction bytes
      Returns:
      decoded value
    • getThumb2

      public static DirectEncodedMemoryArea getThumb2(int index, int zone, int length)
      Build an DirectEncodedMemoryArea for Thumb-2
      Parameters:
      index - index in the 16-bit area
      zone - 0 for the LSB side, 1 for the MSB
      length - length in bits
      Returns:
      encoded memory area
    • decode

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

      public EncodedMemoryAreaList shift(int shift)
      Shift this encoded memory area to the left.
      Specified by:
      shift in interface IEncodedMemoryArea
      Overrides:
      shift in class AbstractEncodedMemoryArea
      Parameters:
      shift - shift amount in bits
      Returns:
      shifted encoded memory area