Skip to contentSkip to conversation

stack smashing

DISCUSSION kaushal 1 participant 1 message Feb 3, 2005

lore
Share & tools
lore

kaushal

author
#0 lore raw

Hello all,
I wanted to understand the stacksmashing work.I simply copied and run
the first example code-snippet from the ALEPH-ONE's paper on "smashing the stack for fun and profit"(http://www.insecure.org/stf/smashstack.txt ).But it did not skip the instruction.I tried this on the linux -x86 machine.The code follows:

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

ret = buffer1 + 12;
(*ret) += 8;
}

void main() {
int x;

x = 0;
function(1,2,3);
x = 1;
printf("%d\n",x);
}
----------------------------------------------------------------------------
Can somebody throw light on this?

-liuser