| 193 | } |
| 194 | |
| 195 | uintptr_t KittyScannerMgr::findIdaPatternFirst(const uintptr_t start, const uintptr_t end, const std::string &pattern) |
| 196 | { |
| 197 | if (!_pMem || start >= end) |
| 198 | return 0; |
| 199 | |
| 200 | std::string mask; |
| 201 | std::vector<char> bytes; |
| 202 | |
| 203 | const size_t pattren_len = pattern.length(); |
| 204 | for (std::size_t i = 0; i < pattren_len; i++) |
| 205 | { |
| 206 | if (pattern[i] == ' ') |
| 207 | continue; |
| 208 | |
| 209 | if (pattern[i] == '?') |
| 210 | { |
| 211 | bytes.push_back(0); |
| 212 | mask += '?'; |
| 213 | } |
| 214 | else if (pattren_len > i + 1 && std::isxdigit(pattern[i]) && std::isxdigit(pattern[i + 1])) |
| 215 | { |
| 216 | bytes.push_back(std::stoi(pattern.substr(i++, 2), nullptr, 16)); |
| 217 | mask += 'x'; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | if (bytes.empty() || mask.empty() || bytes.size() != mask.size()) |
| 222 | return 0; |
| 223 | |
| 224 | return findBytesFirst(start, end, bytes.data(), mask); |
| 225 | } |
| 226 | |
| 227 | std::vector<uintptr_t> KittyScannerMgr::findDataAll(const uintptr_t start, |
| 228 | const uintptr_t end, |