retdec
|
#include <signature.h>
Public Types | |
enum class | Type { NORMAL , WILDCARD , CAPTURE } |
Public Member Functions | |
Byte () | |
Byte (uint8_t byte) | |
Byte (Type type, uint8_t expectedValue, uint8_t wildcardMask) | |
Byte (const Byte &byte) | |
Type | getType () const |
uint8_t | getExpectedValue () const |
uint8_t | getWildcardMask () const |
Byte & | operator= (uint8_t rhs) |
Byte & | operator= (Byte rhs) |
bool | operator== (uint8_t rhs) const |
bool | operator!= (uint8_t rhs) const |
Private Attributes | |
Type | _type |
Type of the byte. More... | |
uint8_t | _expectedValue |
Expected value of the byte. More... | |
uint8_t | _wildcardMask |
Wildcard mask specifying the bits that are wildcard and that are exact. More... | |
Friends | |
bool | operator== (uint8_t lhs, const Byte &rhs) |
bool | operator!= (uint8_t lhs, const Byte &rhs) |
Represents single byte in signature that is used by Signature class. Bits that are set in wildcardMask to 1 are wildcarded and are matched as always equal. expectedValue contains the exact value of the bits that is expected. If there is collision between wildcard mask and expected value, the bits that are set in expected value and wildcard mask simultaneously are set back to 0 in expected value.
Examples:
There are macros which allow shorter initialization of Signature::Byte - these are ANY, CAP, ANYB and CAPB.
|
strong |
retdec::unpacker::Signature::Byte::Byte | ( | ) |
Default constructor. Initializes exact match byte with expected value 0.
retdec::unpacker::Signature::Byte::Byte | ( | uint8_t | byte | ) |
Single byte implicit constructor. Initializes exact match byte with specified expected value.
byte | Expected value of exact match byte. |
retdec::unpacker::Signature::Byte::Byte | ( | Type | type, |
uint8_t | expectedValue, | ||
uint8_t | wildcardMask | ||
) |
Explicit constructor. Initializes bytes according to all specified values. In case of conflict between expectedValue and wildcardMask, all bits that are set to 1 in both are set back to 0 in expectedValue.
type | Type of the byte. |
expectedValue | Expected value of the byte. |
wildcardMask | Wildcard mask of the byte. |
retdec::unpacker::Signature::Byte::Byte | ( | const Byte & | byte | ) |
Copy constructor.
byte | Another Signature::Byte object. |
uint8_t retdec::unpacker::Signature::Byte::getExpectedValue | ( | ) | const |
Returns the expected value of the byte.
Signature::Byte::Type retdec::unpacker::Signature::Byte::getType | ( | ) | const |
Returns the type of byte.
uint8_t retdec::unpacker::Signature::Byte::getWildcardMask | ( | ) | const |
Returns the wildcard mask of the byte.
bool retdec::unpacker::Signature::Byte::operator!= | ( | uint8_t | rhs | ) | const |
Non-equality operator for comparison with raw bytes.
rhs | Raw byte to compare with. |
Signature::Byte & retdec::unpacker::Signature::Byte::operator= | ( | Signature::Byte | rhs | ) |
Assigment operator for Signature::Byte assignment.
rhs | Signature::Byte object to copy. |
Signature::Byte & retdec::unpacker::Signature::Byte::operator= | ( | uint8_t | rhs | ) |
Assignment operator for raw byte assignment. Initializes exact match byte.
rhs | Raw byte to assign. |
bool retdec::unpacker::Signature::Byte::operator== | ( | uint8_t | rhs | ) | const |
Equality operator for comparison with raw bytes.
rhs | Raw byte to compare with. |
|
friend |
Non-equality operator for comparison with raw bytes.
lhs | Raw byte to compare with. |
rhs | Signature::Byte object to compare. |
|
friend |
Equality operator for comparison with raw bytes.
lhs | Raw byte to compare with. |
rhs | Signature::Byte object to compare. |
|
private |
Expected value of the byte.
|
private |
Type of the byte.
|
private |
Wildcard mask specifying the bits that are wildcard and that are exact.