|Name obfuscation precompiler email@example.com (2004-01-22)|
|Re: Name obfuscation precompiler firstname.lastname@example.org (2004-01-31)|
|Re: Name obfuscation precompiler email@example.com (2004-02-01)|
|Date:||1 Feb 2004 12:49:18 -0500|
|Organization:||AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com|
|Posted-Date:||01 Feb 2004 12:49:18 EST|
firstname.lastname@example.org (email@example.com) schreibt:
>Is there any sample compiler source code available that does
>anything remotely similar to the above or can anyone give me any
>suggestions on a quick proof of concept implementation of my own?
You may have a look at the cpp preprocessor of gcc. A simple
obfuscation then is possible by replacing all non-predefined symbols
(token "names") by other strings. Since the preprocessor doesn't
distinguish between identifiers for local and global identifiers, or
identifiers in different namespaces, the same name then is substituted
for e.g. a local variable "i" in every subroutine.
But why do you want obfuscation at all? When your code refers to
external (library) symbols, or exports symbols for use by other
applications, then you'll need at least a list of names which never
must be obfuscated. Then stripping all debug information from the
compiled files should provide the same results as your obfuscator. If
then still remain unwanted symbols in the compiled files, it may be
easier to tweak the name list in the object files, instead of
bothering with the source code.
[The usual point of obfuscation is to be able to provide source code to
people running on systems for which you don't have a compiler without
giving them full access to the useful source code. -John]
Return to the
Search the comp.compilers archives again.