I'm currently taking a computer security class. The thing is, I haven't even taken an intro computer programming course. I taught myself a good deal of C++ back this summer, but I hardly know as much as the other students in the class.
we were asked to manipulate the following code so that the program returns x as 0 instead of 1.
So I need to manipulate the function in such a way that I alter the return address. I want to skip the x=1 step and, instead, go straight to the printf("%d\n", x)
void function(char *source) {
/* add stuff here Note: do not use a buffer overflow*/
}
void main(){
int x;
x=0;
function("...")
x=1;
printf("%d\n",x);
}
Note: I am not looking for straight answers. I would like some guidance on where to start. I know that this is a pointer exercise.