Well assuming we have some trivial program:
I want to make it so that it outputs some alternative ending that I insert into the program other than "this is the end of foo(). Goodbye. " so rather than it printing:
void foo(char* name)
sprintf(buffer, "Dear %s ", name);
printf("this is the end of foo(). Goodbye. \n");
void main(int argc, char **argv)
if ( argc > 1 )
Dear Julie this is the end of foo(). Goodbye.
I wanted to overwrite it so that it would do something to effect of:
./prog Julie, you stink.
Dear Julie, you stink.
and it would completely bypass the last printf statement in foo().
I'm still relatively new to using GDB and other than run, step, b, and disas I'm not too sure what other functions could show me a sort 'snapshot' of the register contents and what is being overwritten.