Re: a.out Magic Number

Gigi Sullivan <[email protected]> Thu, 28 Oct 2004 18:09:40 +0200
Newsgroups gmane.comp.security.italian.devel
Message-ID <20041028160940.GA3560@fermi>
--===============1898152266==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr"
Content-Disposition: inline


--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Woa!

On Tue, Oct 26, 2004 at 04:09:05PM +0200, Lonely Wolf wrote:
> Salve a tutti.


> "The magic number a_magic indicates what kind of executable file this is.=
=20
> on the original PDP-11 was octal 407, which was a branch instruction that=
 would=20
> jump over the next seven words of the header to the beginning of the text=
=20
> segment.... Different magic numbers tell the operating system program
> loader to load  the file in to memory differently..."

   il valore 0x64010b se interpretato come opcode di istruzione assembly x8=
6,
   corrisponde a=20
  =20
      add    %ecx,%fs:(%ebx)

   che, sebbene mi pare legale, potrebbe causare un crash se %ebx contiene
   qualcosa di non indirizzabile da processo (%fs =3D 0 su kernel linux 2.4=
=2Ex,
   afaik, quindi ci si riferirebbe, tra l'altro anche alla NULL entry della=
=20
   GDT causando un general protection fault dalla cpu -- ok, non si sa anco=
ra
   se il sistema in questione e` un linux). Tutto questo, per dire, IMHO, c=
he
   il magic non viene trattato come opcode...

> ecco, forse non ho ancora capito bene e mi sfugge qualcosa, ma mi
> domandavo se questo pu=F2 aiutarmi a capire su quale piattaforma =E8 stato
> compilato o quantomeno, se dato il seguente magic number posso
> ricavare qualche altra info...oppure non significa un bel niente :)
>=20
> 64010Bh
  =20
   nel mio /usr/share/misc/file/magic (Debian GNU/Linux testing) e` presente
   un=20

      0  lelong      0x0064010b  Linux/i386 demand-paged executable (ZMAGIC)
      >16   lelong      0     \b, stripped

   quindi a quanto pare, IMHO, l'a.out e` di un sistema Linux/i386, ZMAGIC
   (demand loading, header, text e data segment sono "paddati" da ld a
   multipli della dimensione di una pagina in memoria e pagine di testo sono
   read-only mentre data read-write -- cfr.
   http://www.neosoft.com/neosoft/man/a.out.5.html la prima che ho trovato =
:))

> ah dimenticavo, architettura Intel.

   spero sia giusto...

> Grazie
>=20
>=20
> .::.Lonely Wolf.::.

bye,
GG sullivan

--=20
Lorenzo Cavallaro `Gigi Sullivan' <[email protected]>

Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)

See the reality in your eyes, when the hate makes you blind. (A.H.X)

--PNTmBPCT7hxwcZjr
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBgRnEH276LzRV+lwRAg+4AKCBsrvnB4X13Wb6Qvz7lPXig9ZLQwCfaNLo
ymYK+YmaaKl2UDbqnCy4NxI=
=zqnC
-----END PGP SIGNATURE-----

--PNTmBPCT7hxwcZjr--

--===============1898152266==
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

________________________________________________________
http://www.sikurezza.org - Italian Security Mailing List
--===============1898152266==--