Given the sample code below:
#include <iostream>
struct Data {
int a;
int b;
int c;
};
int main() {
Data *d = new Data;
d->a = 1337;
d->b = 1338;
d->c = 1339;
std::cout << d << std::endl;
return 0;
}
Printing out the address of the pointer d
is never the same (which seems logical). But the pointer that points to the base of d
is also never the same.
Is there a way to find a static address that is always the same and points to the base of d
? Or do I need to do this with a signature scan?
The main purpose is to always have a pointer to the base of d
, without disassembling it when I restarting the program.