Related articles |
---|
code transformations? lord@emf.net (1996-09-22) |
Re: code transformations? null@diku.dk (1996-09-23) |
Re: code transformations? cef@geodesic.com (Charles Fiterman) (1996-09-23) |
Re: code transformations? ma@camcon.co.uk (1996-09-25) |
Re: code transformations? darius@phidani.be (Darius Blasband) (1996-09-26) |
Re: code transformations? meulenbr@prl.philips.nl (1996-09-26) |
Re: code transformations? albaugh@agames.com (1996-09-26) |
Re: code transformations? torbenm@diku.dk (1996-09-29) |
[5 later articles] |
From: | null@diku.dk (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 |
lord@emf.net (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
algorithm.
--
Niels Ull Jacobsen, Dep. of CS, U of Copenhagen (null@diku.dk)
Roenne Alle 3 st.th, 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]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.