|Exception Handling firstname.lastname@example.org (David Jobet) (2002-07-21)|
|Re: Exception Handling email@example.com (VBDis) (2002-07-24)|
|Re: Exception Handling firstname.lastname@example.org (Casse Hugues) (2002-07-24)|
|Re: Exception Handling email@example.com (jacob navia) (2002-07-24)|
|Re: Exception Handling firstname.lastname@example.org (David Jobet) (2002-07-25)|
|Re: Exception Handling email@example.com (journeyman) (2002-08-04)|
|Re: Exception Handling firstname.lastname@example.org (Nick Maclaren) (2002-08-10)|
|Re: Exception Handling email@example.com (Marco van de Voort) (2002-08-10)|
|Re: Exception Handling firstname.lastname@example.org (Maxim Reznik) (2002-08-10)|
|Re: Exception Handling email@example.com.OZ.AU (Fergus Henderson) (2002-08-14)|
|[5 later articles]|
|From:||"jacob navia" <firstname.lastname@example.org>|
|Date:||24 Jul 2002 02:29:25 -0400|
|Organization:||Wanadoo, l'internet avec France Telecom|
|Keywords:||C, translator, errors|
|Posted-Date:||24 Jul 2002 02:29:25 EDT|
> Problem is I don't know how to get this return address in order to produce
> the good case (here h_addr and f_addr).
> Is there any way to get them using assembly ?
Yes, it has been done many times.
Most procedures do:
So, reading the adress pointed to by ebp you get the old ebp, i.e. the frame
of the calling procedure. The machine return address is at 4(ebp).
when you do
within foo, the return address is the address of the first opcode of the
a+=b operation. The value at (ebp) points to the frame of the calling
procedure, where you find a,b,c if you know the offsets. Addresing from esp
only, you find the return address at (esp) immediately after the call, but
esp varies when a call frame is being built and the frame of the called
procedure is done, so it is more difficult to use.
All this supposes a standard setting with frame optimizations off. If you
are optimizing many of those constructs could be optimized away.
Return to the
Search the comp.compilers archives again.