FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-27-2008, 10:46 PM
Chris Tyler
 
Default Self-printing program (was The Scope and Ownership of fedora-list)

On Wed, 2008-08-27 at 16:54 -0430, Patrick O'Callaghan wrote:
> On Wed, 2008-08-27 at 13:18 -0500, Mike Chambers wrote:
> > > p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){pri ntf(p,34,p,34);}
> >
> > Not being a programmer or anything, WHAT in the heck IS that? LOL
>
> It's C. There's a whole class of things like this. Google for
> "Obfuscated C Contest".
>
> BTW it won't compile without a load of warnings. I can't be bothered
> working out how to turn them off.
>
> poc

This is a short program of the type that Thompson described in
"Reflections on Trusting Trust"[0]. This version can be compiled with
gcc (with one warning):

char* p="char* p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf (p,34,p,34);}

When run, it prints its own source code.

-Chris


[0] This is an amazing paper. It describes why you can't trust software
for which you have audited the source code and compiled your own binary.
Original PDF from the ACM site:
http://portal.acm.org/citation.cfm?id=358210
or html format from Ken Thompson's site at Bell Labs:
http://cm.bell-labs.com/who/ken/trust.html

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
 

Thread Tools




All times are GMT. The time now is 07:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org