MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / pattern_to_bytes

Function pattern_to_bytes

core/src/utils/dylib.cc:30–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30static auto pattern_to_bytes(const char *pattern, bool *wildcard)
31{
32 *wildcard = false;
33 std::vector<int> bytes;
34 const char *end = pattern + strlen(pattern);
35
36 for (const char *cur = pattern; cur < end; ++cur)
37 {
38 if (*cur == '?')
39 {
40 ++cur;
41 if (*cur == '?')
42 ++cur;
43 bytes.push_back(-1);
44 *wildcard = true;
45 }
46 else
47 {
48 char *end;
49 bytes.push_back(strtol(cur, &end, 16));
50 cur = end;
51 }
52 }
53 return bytes;
54}
55
56static void *scan_memory_pattern(void *data, size_t length, const std::vector<int> &pattern)
57{

Callers 1

find_memoryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected