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
Represent a memory Area in code. A memory area is composed of an index and a length
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongdecode(byte[] code) Decode the area from instruction bytes.static intdecodeInt(int index, int length, byte[] code) Decode bits from instruction bytes.static DirectEncodedMemoryAreaget(int index, int length) Build aDirectEncodedMemoryAreafrom index and length.intgetIndex()Retrieve the bit index of this area.intRetrieve the encoded area length in bits.static DirectEncodedMemoryAreagetThumb2(int index, int zone, int length) Build anDirectEncodedMemoryAreafor Thumb-2shift(int shift) Shift this encoded memory area to the left.Methods inherited from class com.pnfsoftware.jeb.core.units.code.asm.processor.memory.AbstractEncodedMemoryArea
decodeInt
-
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:IEncodedMemoryAreaRetrieve the encoded area length in bits.- Returns:
- length in bits
-
get
Build aDirectEncodedMemoryAreafrom index and length. Index 0 represents the least significant bit.- Parameters:
index- bit indexlength- 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 indexlength- length in bitscode- instruction bytes- Returns:
- decoded value
-
getThumb2
Build anDirectEncodedMemoryAreafor Thumb-2- Parameters:
index- index in the 16-bit areazone- 0 for the LSB side, 1 for the MSBlength- length in bits- Returns:
- encoded memory area
-
decode
public long decode(byte[] code) Description copied from interface:IEncodedMemoryAreaDecode the area from instruction bytes.- Parameters:
code- instruction bytes- Returns:
- decoded value
-
shift
Shift this encoded memory area to the left.- Specified by:
shiftin interfaceIEncodedMemoryArea- Overrides:
shiftin classAbstractEncodedMemoryArea- Parameters:
shift- shift amount in bits- Returns:
- shifted encoded memory area
-