Re: Stack Exploit
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Sun, 10 Dec 2006 22:30:05 +0100
Frank Kotler wrote:
08048390 <printMessage>:
8048390: 55 push %ebp
8048391: 89 e5 mov %esp,%ebp
8048393: 57 push %edi
8048394: 56 push %esi
8048395: 83 ec 1c sub $0x1c,%esp
80483bc: 8d 65 f8 lea 0xfffffff8(%ebp),%esp
80483bf: 5e pop %esi
80483c0: 5f pop %edi
80483c1: 5d pop %ebp
80483c2: c3 ret
What's with the "lea 0xfffffff8(%ebp),%esp" after the "call"? Not the
It restores the stack to the value where %esi was saved.
+4(%ebp) -> return address
(%ebp) -> saved %ebp
-4(%ebp) -> saved %edi
-8(%ebp) -> saved %esi
way I would have expected to clean up stack... Mysterious are the ways
of gcc!
But if you compile it with -O2, you will get much better code.
.
- Follow-Ups:
- Re: Stack Exploit
- From: Frank Kotler
- Re: Stack Exploit
- References:
- Stack Exploit
- From: leon800219
- Re: Stack Exploit
- From: santosh
- Re: Stack Exploit
- From: Herbert Kleebauer
- Re: Stack Exploit
- From: Phil Carmody
- Re: Stack Exploit
- From: Herbert Kleebauer
- Re: Stack Exploit
- From: Phil Carmody
- Re: Stack Exploit
- From: Frank Kotler
- Stack Exploit
- Prev by Date: Re: Stack Exploit
- Next by Date: Re: TASM revisited
- Previous by thread: Re: Stack Exploit
- Next by thread: Re: Stack Exploit
- Index(es):
Relevant Pages
|