Interface IBinaryPattern
- All Known Implementing Classes:
BinaryPattern
Definition of a binary pattern. The pattern can be masked. The basic verification routine
does something like: {@code if(checkedByte[i] == (pattern[i] & mask[i])) { ... }
@author Nicolas Falliere
@see BinaryPatternVerifier
-
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.boolean
validate
(INativeCodeAnalyzer<?> gca, long address, byte[] buffer, int offset, int offsetEnd) Final validation.
-
Method Details
-
getBinary
byte[] getBinary()Binary bytes. Mandatory.- Returns:
-
getMask
byte[] getMask()Binary mask. Optional. If present, must have same length asgetBinary()
.- Returns:
-
getRealStartOffset
int getRealStartOffset()The real start offset.- Returns:
-
getProcessorMode
int getProcessorMode()Valid processor mode for this Binary Pattern. Can beIProcessor.MODE_DEFAULT
if valid in any mode.- Returns:
-
validate
boolean validate(INativeCodeAnalyzer<?> gca, long address, byte[] buffer, int offset, int offsetEnd) Final validation. Optional method.- Parameters:
gca
-address
-buffer
-offset
-offsetEnd
-- Returns:
-
getExtra
Object getExtra()Get some extra data associated to this pattern. Client specific.- Returns:
- optional data
-