MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / findIdaPatternFirst

Method findIdaPatternFirst

KittyMemoryEx/KittyScanner.cpp:195–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195uintptr_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
227std::vector<uintptr_t> KittyScannerMgr::findDataAll(const uintptr_t start,
228 const uintptr_t end,

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected