| 95 | } |
| 96 | |
| 97 | uintptr_t KittyScannerMgr::findBytesFirst(const uintptr_t start, |
| 98 | const uintptr_t end, |
| 99 | const char *bytes, |
| 100 | const std::string &mask) const |
| 101 | { |
| 102 | if (!_pMem || start >= end || !bytes || mask.empty()) |
| 103 | return 0; |
| 104 | |
| 105 | std::vector<char> buf(end - start, 0); |
| 106 | if (!_pMem->Read(start, &buf[0], buf.size())) |
| 107 | { |
| 108 | KITTY_LOGE("findBytesFirst: Failed to read into buffer."); |
| 109 | return 0; |
| 110 | } |
| 111 | |
| 112 | uintptr_t local = findInRange((uintptr_t)&buf[0], |
| 113 | (uintptr_t(&buf[0]) + buf.size()), |
| 114 | reinterpret_cast<const uint8_t *>(bytes), |
| 115 | mask.data()); |
| 116 | return local ? ((local - (uintptr_t(&buf[0]))) + start) : 0; |
| 117 | } |
| 118 | |
| 119 | std::vector<uintptr_t> KittyScannerMgr::findHexAll(const uintptr_t start, |
| 120 | const uintptr_t end, |
no test coverage detected