Date: Tue, 13 Mar 2001 16:29:44 +0100 (CET) From: milunovic <milunovic@sendmail.ru> To: "Nickolay A. Kritsky" <nkritsky@internethelp.ru> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: FreeBSD asm problem Message-ID: <Pine.BSF.4.21.0103131625510.1040-100000@scorpion.cosmos.all.net> In-Reply-To: <00b701c0abca$624b7630$0600a8c0@ibmka.internethelp.ru>
index | next in thread | previous in thread | raw e-mail
-----BEGIN PGP SIGNED MESSAGE-----
On Tue, 13 Mar 2001, Nickolay A. Kritsky wrote:
> Hi all!
> It seems to me that you guys are my last hope, but if i am asking in the
> wrong place - sorry.
>
> I wrote my first asm program for FreeBSD:
>
> section .code
> global _start
> _start:
> push dword envp
> push dword argvp
> push dword fname
> mov eax,59 ; execve
Here you must push long (dword) because int 0x80 expects EIP
main :
pushl 3rd
pushl 2nd
pushl 1st
call execve <--- call will push EIP on stack
execve :
leal $0x3b,%eax
int $0x80
Stack should be ->
[EIP][1st][2nd][3rd] but instead EIP you can just push anything you
want.
Vojislav Milunovic
milunovic@sendmail.ru
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv
iQEVAwUBOq486y3gPLld8IkLAQEy2gf9HLvwmii7QTyNuHBt6qQqf5jBqMPFPw8j
kcW/5Oss05kfayh6tmrLVRCzP3MYNYXXKSgxjAKzH+OmN/FHlaTsZIIfQFnU561z
a1Qau+CWjJ5hUuIfE1xGPPVDaWC8e3MF83ZwH9CN3pnIZVUh/3OectyiTGwgwyEV
iGo65HAlgW9GBZznmzYK7PXOkWrRV3olcflIverL1dKMZbow0MCOQ57LMLnNY4ck
Kl6dt8lVLd+K1sHnXdO09eqogiyXPmJEmIJJGRiR2iKMo3Zl5ptGfN/pb00NnNiT
5eNeOQbVEmDJg0swig6VrY2kSqUsMjCpWFW2TDItvtUp8nW9uJ1mtA==
=6Qs3
-----END PGP SIGNATURE-----
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0103131625510.1040-100000>
