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 current_remote += std::max(bytes_read, bytes_to_next_page);
96 continue;
97 }
98
99 const uintptr_t local_base = reinterpret_cast<uintptr_t>(buf.data());
100 const uintptr_t local_end = local_base + bytes_read;
101 uintptr_t current_local = local_base;
102
103 while (current_local < local_end)
104 {
105 uintptr_t found_local = findInRange(current_local,
106 local_end,
107 reinterpret_cast<const uint8_t *>(bytes),
108 mask);
109 if (!found_local)
110 break;
111
112 const size_t offset = found_local - local_base;
113 results.push_back(current_remote + offset);
114
115 current_local = found_local + 1;
116 }
117
118 // Slide the window forward based on actual bytes read to handle chunk boundaries
119 current_remote += (bytes_read - pattern_len + 1);
120 }

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 2

findInRangeFunction · 0.85
ReadMethod · 0.80

Tested by

no test coverage detected