MCPcopy Create free account
hub / github.com/Norbyte/ositools / Scan

Method Scan

OsiInterface/DataLibraries.cpp:137–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 }
136
137 void Pattern::Scan(uint8_t const * start, size_t length, std::function<void(uint8_t const *)> callback, bool multiple)
138 {
139 // Check prefix length
140 auto prefixLength = 0;
141 for (auto i = 0; i < pattern_.size(); i++) {
142 if (pattern_[i].mask == 0xff) {
143 prefixLength++;
144 }
145 else {
146 break;
147 }
148 }
149
150 auto end = start + length - pattern_.size();
151 if (prefixLength >= 4) {
152 ScanPrefix4(start, end, callback, multiple);
153 } else if (prefixLength >= 2) {
154 ScanPrefix2(start, end, callback, multiple);
155 } else {
156 ScanPrefix1(start, end, callback, multiple);
157 }
158 }
159
160 bool LibraryManager::IsFixedStringRef(uint8_t const * ref, char const * str) const
161 {

Calls

no outgoing calls

Tested by

no test coverage detected