i want to intentionally bypass the statement
in the below program.but was unable to do.
i am using gcc and gdb on fedora 8 linux on AMD64 machine.
what i am getting is just segmentation fault.
please put some points how to do that.

/*.................         This program writes bypass a particular statement by process stack  overflow and return to the statement pass x=1 tp printf.... */

// Status: still does not work

function(int a, int b, int c) 
   char buffer1[5];
   char buffer2[10];
   int *ret;

   ret = buffer1 + 12;   // reaching at the ret statement; i.e. return address i.e. saved IP value before coming to function()
   (*ret) += 12;   //overwriting the IP value to past x=1;to know disassemble the main in gdb and count hw much to add hr(12)

int main()
  int x;

  x = 0;
  x = 1;            //this statement is to be skipped by overflow

Last edited by shabbir; 1Jun2009 at 22:06.. Reason: Code blocks