From owner-freebsd-hackers Tue Mar 13 7:23:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from primo.verat.net (primo.verat.net [217.26.64.130]) by hub.freebsd.org (Postfix) with ESMTP id B3AA037B718 for ; Tue, 13 Mar 2001 07:23:08 -0800 (PST) (envelope-from milunovic@sendmail.ru) Received: from scorpion.cosmos.all.net (ppp-108.verat.net [217.26.65.108]) by primo.verat.net (x.y.z/1.1.1) with ESMTP id QAA29073; Tue, 13 Mar 2001 16:22:52 +0100 Received: from scorpion.cosmos.all.net (scorpion.cosmos.all.net [127.0.0.1]) by scorpion.cosmos.all.net (8.11.3/8.11.3) with ESMTP id f2DFTmr01057; Tue, 13 Mar 2001 16:29:50 +0100 (CET) Date: Tue, 13 Mar 2001 16:29:44 +0100 (CET) From: milunovic X-Sender: milunovic@scorpion.cosmos.all.net To: "Nickolay A. Kritsky" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: FreeBSD asm problem In-Reply-To: <00b701c0abca$624b7630$0600a8c0@ibmka.internethelp.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----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