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

Method ScanPrefix4

OsiInterface/DataLibraries.cpp:120–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 void Pattern::ScanPrefix4(uint8_t const * start, uint8_t const * end, std::function<void(uint8_t const *)> callback, bool multiple)
121 {
122 uint32_t initial = pattern_[0].pattern
123 | (pattern_[1].pattern << 8)
124 | (pattern_[2].pattern << 16)
125 | (pattern_[3].pattern << 24);
126
127 for (auto p = start; p < end; p++) {
128 if (*reinterpret_cast<uint32_t const *>(p) == initial) {
129 if (MatchPattern(p)) {
130 callback(p);
131 if (!multiple) return;
132 }
133 }
134 }
135 }
136
137 void Pattern::Scan(uint8_t const * start, size_t length, std::function<void(uint8_t const *)> callback, bool multiple)
138 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected