Apparently there has been a gross misunderstanding here. Of course what
you describe is possible. I had no intention of denying that. It is a
completely different thing, though, for a program to *recognize* by mere
code analysis *whether* two functions (that have *non-trivial* differences,
[ ... ] And if one reads more
closely, *that* is the problem posed by you in the OP (as also indicated
by the Subject line "... more than obfuscator ...").
With all due respect, I don't think that is what the OP was
suggesting. It's hard to know of course, but I think this from the
OP:
| BUT: I am looking for something that would NOT (only) do
| the basic comments stripping / names renaming, but also
| changed the (apparent, of course) flow of the program.
more implies something that can operate at the syntactic level. The
original example (which, as already pointed out, doesn't work) seemed
to me to attempt to operate on a function in a manner that could be
automated without any recognition of what the function was
calculating. I would expect that if the OP really wanted a tool that
would comprehend the meaning of the functions, he would have actually
said so.
I can understand that "more than obfuscator" sounds more like
something beyond the limits of Rice's theorem, I took it to mean more
than the weak current obfuscator. This seems to offer additional
evidence: "To unscramble such code you would in general need an
execution optimizer." Such tools also work at the syntactic level,
albeit with some deep understanding of the language and their
interpreters/compilers. It's hard to imagine a semantic encoding that
could be decoded syntactically.
But perhaps the OP is still around? Andrew, do you mean that the code
would have to recognize, for instance, a squaring function and change
it based upon that? Or would it be enough that the tool could somehow
do syntactic changes hard to recognize and reverse?