Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Vulnerability Development: RE: The generated binary code has different main?

RE: The generated binary code has different main?

From: Dom De Vitto <dom_at_DeVitto.com>
Date: Wed, 4 Sep 2002 23:34:18 +0100

In a small corner of the C std it says that the compiler writer may add
arguments
to the beginning/end of the function call list.

That's why the variable argument list routines are necessary.

As an example, some compilers put the stack tidy code in the function,
rather than
the calling code - which means you need to pass in the amount that you
want the
routine to re-jig the stack by.

Why not disassemble a small exe, from the entry point onwards and see
what where the caller got 20800,0,0 from....

Dom De Vitto
-----Original Message-----
From: Minchu Mo [mailto:morris_minchu_at_iwon.com]
Sent: Wednesday, September 04, 2002 10:49 PM
To: vuln-dev_at_securityfocus.com
Subject: The generated binary code has different main?

I used cc compiler to compile a simple c code under solaris /sparc. The
c
code has main(int argc, char* argv[]) function as entry point as
everybody
knows.

But when I run the generated code under adb, I found the main function
under adb look like this:

main(2,ffbefd0c,ffbefd18,20800,0,0)

I know that:
2 is the number of arguments,
ffbefd0c is *argv
ffbefd18 is *envp,
but what are 20800 and 0, 0 for?

Anybody knows? Thanks
Received on Sep 05 2002

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos