Class BinaryPattern
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.analyzer.BinaryPattern
- All Implemented Interfaces:
IBinaryPattern
Basic implementation of a binary pattern. The checks are bytes+mask only; The custom verification
method simply returns true.
-
Constructor Summary
ConstructorDescriptionBinaryPattern
(byte[] binary) BinaryPattern
(byte[] binary, byte[] mask) BinaryPattern
(byte[] binary, byte[] mask, int realStartOffset) BinaryPattern
(byte[] binary, byte[] mask, int realStartOffset, int processorMode) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Binary bytes.getExtra()
Get some extra data associated to this pattern.byte[]
getMask()
Binary mask.int
Valid processor mode for this Binary Pattern.int
The real start offset.toString()
boolean
validate
(INativeCodeAnalyzer<?> gca, long address, byte[] buffer, int offset, int offsetEnd) Final validation.
-
Constructor Details
-
BinaryPattern
public BinaryPattern(byte[] binary) -
BinaryPattern
public BinaryPattern(byte[] binary, byte[] mask) -
BinaryPattern
public BinaryPattern(byte[] binary, byte[] mask, int realStartOffset) -
BinaryPattern
public BinaryPattern(byte[] binary, byte[] mask, int realStartOffset, int processorMode)
-
-
Method Details
-
getBinary
public byte[] getBinary()Description copied from interface:IBinaryPattern
Binary bytes. Mandatory.- Specified by:
getBinary
in interfaceIBinaryPattern
- Returns:
-
getMask
public byte[] getMask()Description copied from interface:IBinaryPattern
Binary mask. Optional. If present, must have same length asIBinaryPattern.getBinary()
.- Specified by:
getMask
in interfaceIBinaryPattern
- Returns:
-
getRealStartOffset
public int getRealStartOffset()Description copied from interface:IBinaryPattern
The real start offset.- Specified by:
getRealStartOffset
in interfaceIBinaryPattern
- Returns:
-
getProcessorMode
public int getProcessorMode()Description copied from interface:IBinaryPattern
Valid processor mode for this Binary Pattern. Can beIProcessor.MODE_DEFAULT
if valid in any mode.- Specified by:
getProcessorMode
in interfaceIBinaryPattern
- Returns:
-
validate
public boolean validate(INativeCodeAnalyzer<?> gca, long address, byte[] buffer, int offset, int offsetEnd) Description copied from interface:IBinaryPattern
Final validation. Optional method.- Specified by:
validate
in interfaceIBinaryPattern
- Returns:
-
getExtra
Description copied from interface:IBinaryPattern
Get some extra data associated to this pattern. Client specific.- Specified by:
getExtra
in interfaceIBinaryPattern
- Returns:
- optional data
-
toString
-