I am currently trying to hot patch programs (update code and data in the program memory, according to a released patch).
Assume that we can stop a running program, and do the patch. If the patch changes some data initialization or assignment values, how could we know where the variables are, like those in stack or heap?
Example:
Before patch:
void func() {
int a = 1;
}
After patch:
void func() {
int a = 2;
}
When patching, how could we know the location of a
in the stack (or maybe not in the stack)?