Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!compilers-sender From: jeffb@grace.cs.washington.edu (Jeff Bowden) Newsgroups: comp.compilers Subject: Re: Encripted source as an ANDF Message-ID: <3978@ima.ima.isc.com> Date: 24 May 89 23:12:12 GMT References: <3963@ima.ima.isc.com> Sender: compilers-sender@ima.ima.isc.com Reply-To: jeffb@grace.cs.washington.edu (Jeff Bowden) Lines: 35 Approved: compilers@ima.UUCP In article <3963@ima.ima.isc.com> henry@zoo.toronto.edu (Henry Spencer) writes: > >PROBLEM: what to do about things like putc(), which are macros I was going to post this objection. Since Mr. Spencer beat me to it, I will offer a solution (so someone else can tear *it* apart). 1) Write a preprocessor which, in addition to obfuscating, replaces #include with some goop that cpp will leave alone but will indicate the name (e.g. extern int _foo_h();) 2) Run the result through cpp. 3) Write a post processor which replaces the goop with the original #include 4) Ship product to customers. ......... One of the earlier poster mentioned transforming the source by changing control structures into gotos. This might work but I would guess that some optimizing compilers might lobotomize themselves temporarily when they find code with gotos in it (perhaps because it's not worth the effort to optimize code with little-used language features, especially when they have all sorts of hairy implications.) [Direct "goto" flames to /dev/tty. Amuse yourself.] -- "It has been discovered that C++ provides a remarkable facility for concealing the trivial details of a program - such as where its bugs are." [Rediscovering the structure of code written with gotos isn't all that hard, and is quite common in Fortran compilers where you don't have much choice. But it's true, it makes the ANDF back end harder than it has to be. -John] [From jeffb@grace.cs.washington.edu (Jeff Bowden)] -- Send compilers articles to compilers@ima.isc.com or, perhaps, Levine@YALE.EDU Plausible paths are { decvax | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request