| 28 | } |
| 29 | |
| 30 | void Signature::fromIdaString(const std::string sigstr) |
| 31 | { |
| 32 | bytes.clear(); |
| 33 | mask.clear(); |
| 34 | |
| 35 | std::istringstream iss(sigstr); |
| 36 | int next = iss.peek(); |
| 37 | while (next != EOF) { |
| 38 | if (next == '?') { |
| 39 | iss.get(); |
| 40 | iss.get(); |
| 41 | iss.get(); |
| 42 | bytes.push_back(0xCC); |
| 43 | mask.push_back(0); |
| 44 | } |
| 45 | else { |
| 46 | int b; |
| 47 | iss >> std::hex >> b >> std::ws; |
| 48 | bytes.push_back((uint8_t) b); |
| 49 | mask.push_back(0xFF); |
| 50 | } |
| 51 | next = iss.peek(); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // Output the sig as a "F8 66 4B ?? ?? ?? 88" format string |
| 56 | std::string Signature::toIdaString() const |
no test coverage detected