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

Method findBytesFirst

KittyMemoryEx/KittyScanner.cpp:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97uintptr_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
119std::vector<uintptr_t> KittyScannerMgr::findHexAll(const uintptr_t start,
120 const uintptr_t end,

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 2

findInRangeFunction · 0.85
ReadMethod · 0.80

Tested by

no test coverage detected