Hey guys, what's up??
I've been diving into executable protection and things like that and I find that I'm being limited by C++'s static linking ( I cannot modify the code while running)
Remember that little [TEST] thread of mine a while ago? I said I used techniques that would modify my code on the fly, it turned out that I was being tricked by my own program. There was nothing realy special about it.
I want to be able to change the way my program encrypts and thus decrypts itself every time it runs. I thought I had completed my objective but I was wrong...
Now I'm trying it again, and I want to do it like this:
I've read about a function called eval(), that exists in certain languages. The eval function would execute a string as code (!)
say this is an sample of a non-existant language:
Code:
var i = 1
echo( eval("i = i + i") )
The program would take the string "i = i + i" and execute it as code, so the echo function (which would be C++'s equvilant of printf()) would print: '2' to the screen.
Now before you get all excited about this, C++ doesn't support the eval() function.
I realy need such a function to complete my objective. And since there's nothing like this flying around the internets I'm going to code it myself
Does anyone have any experience with marco-languages and custom scripting? I alreay have a few basic ideas. But I've stumbled on a problem. How do I link strings to variable names?
Suppose I have a program like this:
Code:
int i = 0;
string str = "i = 2";
eval(str);
How do I make the i in the string refer to the i in the program?
Is this even possible?
-SCHiM