You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and there is an array of byte E0 A1 A2 A3 in it, but the struct has too much "junk" data that it is hard to find it by eyes, so making it able to scan bytes from FooAddress to FooAddress+0x100 will save some time.
It would be great if it supports wildcard(?) too
The text was updated successfully, but these errors were encountered:
// Define the struct Foo
struct Foo {
// Add fields as needed
uint8_t data[0x100];
};
int main() {
// Initialize your struct Foo
Foo foo;
// Simulate loading data into foo.data
// Replace this with actual data loading logic
for (int i = 0; i < 0x100; i++) {
foo.data[i] = 0xE0 + i;
}
// Specify the byte pattern you're searching for
uint8_t pattern[] = {0xE0, 0xA1, 0xA2, 0xA3};
// Search for the pattern within Foo's data
for (int i = 0; i <= 0x100 - sizeof(pattern); i++) {
bool found = true;
for (int j = 0; j < sizeof(pattern); j++) {
if (foo.data[i + j] != pattern[j]) {
found = false;
break;
}
}
if (found) {
std::cout << "Pattern found at offset " << i << std::endl;
}
}
return 0;
For example I have this struct
and there is an array of byte
E0 A1 A2 A3
in it, but the struct has too much "junk" data that it is hard to find it by eyes, so making it able to scan bytes fromFooAddress
toFooAddress+0x100
will save some time.It would be great if it supports wildcard
(?)
tooThe text was updated successfully, but these errors were encountered: