Suppose I have a small program like this one:
int i = 0;
int *pi = &i;
int **ppi = π
int main(int argc, char *argv[]) {
return i + *pi + **ppi;
}
Is there a way to intercept the initialization of pi
and ppi
when they are set during program load/setup? I'd like to hook into their initialization so that I may rewrite the pointer values and stick a few of my own bits in, if possible before main() runs. All this should be transparent and automated.
I have looked into the LD Audit interface (link) but that provided only callbacks for functions.