| 5 | // https://github.com/learn-more/findpattern-bench |
| 6 | |
| 7 | bool compare(const uint8_t *data, const uint8_t *pattern, const char *mask) |
| 8 | { |
| 9 | for (; *mask; ++mask, ++data, ++pattern) |
| 10 | { |
| 11 | if (*mask == 'x' && *data != *pattern) |
| 12 | return false; |
| 13 | } |
| 14 | return !*mask; |
| 15 | } |
| 16 | |
| 17 | uintptr_t findInRange(uintptr_t start, uintptr_t end, const uint8_t *pattern, const std::string &mask) |
| 18 | { |