Re: code transformations? (Niels Ull Jacobsen)
23 Sep 1996 21:00:34 -0400

          From comp.compilers

Related articles
code transformations? (1996-09-22)
Re: code transformations? (1996-09-23)
Re: code transformations? (Charles Fiterman) (1996-09-23)
Re: code transformations? (1996-09-25)
Re: code transformations? (Darius Blasband) (1996-09-26)
Re: code transformations? (1996-09-26)
Re: code transformations? (1996-09-26)
Re: code transformations? (1996-09-29)
[5 later articles]
| List of all articles for this month |

From: (Niels Ull Jacobsen)
Newsgroups: comp.compilers
Date: 23 Sep 1996 21:00:34 -0400
Organization: Department of Computer Science, U of Copenhagen
References: 96-09-094
Keywords: translator, comment (Tom Lord) writes:

>Some time ago, somebody suggested to me the idea of writing a certain
>kind of C preprocessor. The gist of it was that the preprocessor
>would actually parse the program, make some changes to the AST and
>then write source back to disk. This got me to thinking -- suitably
>sophisticated transformations could preserve the semantics of the
>program, while completely disguising the text of the source. This has
>obvious implications for anyone into intellectual property theft.

>So the question is, has anybody written such a program? Will anyone?
>Would releasing such a program on the net be like the SATAN of IP?

>[There are certainly C obfuscators, but the ones I know of perform primarily
>lexical smooshing. -John]

As noted by the moderator, this would probably be nothing more than an
advanced obfuscator. You can, of course, replace most high-level
constructs with goto's and if's (basically creating a flow-chart
version of the program), split compound expressions into pieces and
even change the order of some statements.

The problem is the same as with an obfuscator - the code will become
unreadable and unmaintainable. Even if you reconstruct some higher
level construct, they're likely to either become the old program or to
become much harder to understand. After all, the original program as
written is probably the most straightforward way of expressing the

      Niels Ull Jacobsen, Dep. of CS, U of Copenhagen (
      Roenne Alle 3, 2860 Soeborg, Denmark, tel. +45 39 66 39 86
[I suppose a counter-example is struct, an old Bell Labs Unix tool that
apparently did a remarkably good job of discovering structure in Fortran
spaghetti code, turning if-goto into loops. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.