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

Method findHexFirst

KittyMemoryEx/KittyScanner.cpp:140–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 uintptr_t current_remote = start;
139
140 while (current_remote < end)
141 {
142 const size_t bytes_left = end - current_remote;
143 if (bytes_left < pattern_len)
144 break;
145
146 const size_t bytes_to_read = std::min(buf.size(), bytes_left);
147 const size_t bytes_read = _pMem->Read(current_remote,
148 buf.data(),
149 bytes_to_read,
150 MemMode::SkipInaccessiblePages);
151
152 // Handle failed reads or partial page reads on unmapped/protected memory
153 if (bytes_read < pattern_len)
154 {
155 const size_t page_offset = current_remote % kPageSize;
156 const size_t bytes_to_next_page = kPageSize - page_offset;
157
158 // Skip to the next page boundary or past read bytes (whichever advances further)
159 current_remote += std::max(bytes_read, bytes_to_next_page);

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected