Self-printing program (was Re: The Scope and Ownership of fedora-list)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(){printf(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@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux