Package com.github.junrar.unpack.vm
Class RarVM
- java.lang.Object
-
- com.github.junrar.unpack.vm.BitInput
-
- com.github.junrar.unpack.vm.RarVM
-
public class RarVM extends BitInput
DOCUMENT ME- Version:
- $LastChangedRevision$
-
-
Field Summary
Fields Modifier and Type Field Description private intcodeSizeprivate intflagsprivate intIPprivate intmaxOpCountprivate byte[]memprivate int[]Rprivate static intregCountprivate static longUINT_MASKstatic intVM_FIXEDGLOBALSIZEstatic intVM_GLOBALMEMADDRstatic intVM_GLOBALMEMSIZEstatic intVM_MEMMASKstatic intVM_MEMSIZE
-
Constructor Summary
Constructors Constructor Description RarVM()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddecodeArg(VMPreparedOperand op, boolean byteMode)voidexecute(VMPreparedProgram prg)private booleanExecuteCode(java.util.List<VMPreparedCommand> preparedCode, int cmdCount)private voidExecuteStandardFilter(VMStandardFilters filterType)private intfilterItanium_GetBits(int curPos, int bitPos, int bitCount)private voidfilterItanium_SetBits(int curPos, int bitField, int bitPos, int bitCount)byte[]getMem()private intgetOperand(VMPreparedOperand cmdOp)private intgetValue(boolean byteMode, byte[] mem, int offset)voidinit()private VMStandardFiltersIsStandardFilter(byte[] code, int codeSize)private booleanisVMMem(byte[] mem)private voidoptimize(VMPreparedProgram prg)voidprepare(byte[] code, int codeSize, VMPreparedProgram prg)static intReadData(BitInput rarVM)private booleansetIP(int ip)voidsetLowEndianValue(byte[] mem, int offset, int value)voidsetLowEndianValue(java.util.Vector<java.lang.Byte> mem, int offset, int value)voidsetMemory(int pos, byte[] data, int offset, int dataSize)private voidsetValue(boolean byteMode, byte[] mem, int offset, int value)
-
-
-
Field Detail
-
VM_MEMSIZE
public static final int VM_MEMSIZE
- See Also:
- Constant Field Values
-
VM_MEMMASK
public static final int VM_MEMMASK
- See Also:
- Constant Field Values
-
VM_GLOBALMEMADDR
public static final int VM_GLOBALMEMADDR
- See Also:
- Constant Field Values
-
VM_GLOBALMEMSIZE
public static final int VM_GLOBALMEMSIZE
- See Also:
- Constant Field Values
-
VM_FIXEDGLOBALSIZE
public static final int VM_FIXEDGLOBALSIZE
- See Also:
- Constant Field Values
-
regCount
private static final int regCount
- See Also:
- Constant Field Values
-
UINT_MASK
private static final long UINT_MASK
- See Also:
- Constant Field Values
-
mem
private byte[] mem
-
R
private final int[] R
-
flags
private int flags
-
maxOpCount
private int maxOpCount
-
codeSize
private int codeSize
-
IP
private int IP
-
-
Method Detail
-
init
public void init()
-
isVMMem
private boolean isVMMem(byte[] mem)
-
getValue
private int getValue(boolean byteMode, byte[] mem, int offset)
-
setValue
private void setValue(boolean byteMode, byte[] mem, int offset, int value)
-
setLowEndianValue
public void setLowEndianValue(byte[] mem, int offset, int value)
-
setLowEndianValue
public void setLowEndianValue(java.util.Vector<java.lang.Byte> mem, int offset, int value)
-
getOperand
private int getOperand(VMPreparedOperand cmdOp)
-
execute
public void execute(VMPreparedProgram prg)
-
getMem
public byte[] getMem()
-
setIP
private boolean setIP(int ip)
-
ExecuteCode
private boolean ExecuteCode(java.util.List<VMPreparedCommand> preparedCode, int cmdCount)
-
prepare
public void prepare(byte[] code, int codeSize, VMPreparedProgram prg)
-
decodeArg
private void decodeArg(VMPreparedOperand op, boolean byteMode)
-
optimize
private void optimize(VMPreparedProgram prg)
-
ReadData
public static int ReadData(BitInput rarVM)
-
IsStandardFilter
private VMStandardFilters IsStandardFilter(byte[] code, int codeSize)
-
ExecuteStandardFilter
private void ExecuteStandardFilter(VMStandardFilters filterType)
-
filterItanium_SetBits
private void filterItanium_SetBits(int curPos, int bitField, int bitPos, int bitCount)
-
filterItanium_GetBits
private int filterItanium_GetBits(int curPos, int bitPos, int bitCount)
-
setMemory
public void setMemory(int pos, byte[] data, int offset, int dataSize)
-
-