On Wed, Jan 02, 2002 at 01:15:07PM -0500, Eric Thomas wrote:
> When I run this code, which is ripped straight from the article, the
> x=1; instruction doesn't get skipped.  I've run it through gdb,
> checked my math, and everything seems okay.  When I have the
> program print the return address values, I get weird things - the
> return address should be something like 0x804849B, but prints out
> as OxE12E4001D.
It is not return address you are really getting. Return address is actually
little bit deeper in a stack.

> My question is this - has anything changed in Linux or the i386
> architecture during the last 5 years (since the article was written)
> that would invalidate this code?
No, code is not wrong, it just needs adjustments. gcc nowadays align
differently than in the days when this article was written. So what you are
getting as 'return address' is probably just padding. Try to write content
of your stack onto screen and find correct position of return address, then
adjust code as needed.

--
Jan Sembera

Reply via email to