Brandon
2012-01-07 22:43:19
Is it possible to have simba read a string and execute that?
Example:
var
Data, X: String;
Begin
X:= 'blehsdgsgs';
Data:= 'begin writeln(X); end;';
//Read Data and execute whatever is in that string..
//This it would output the value of X?
End.
Dgby714
2012-01-07 22:51:10
Not currently. Tho you can use CallProc(Proc: string; Args: TVariantArray); to call a procedure by name (string).
Brandon
2012-01-07 22:56:41
From: Dgby714
Not currently. Tho you can use CallProc(Proc: string; Args: TVariantArray); to call a procedure by name (string).
Ahhh defeats the whole purpose of reading a file into a string and then having simba run the procedures contained in that =l
Oh well I'll try that CallProc and see what I can do. I asked because I encrypted an entire script and wanted to decrypt/run it without really showing the data..
Dgby714
2012-01-07 22:59:54
From: ggzz
Ahhh defeats the whole purpose of reading a file into a string and then having simba run the procedures contained in that =l
Oh well I'll try that CallProc and see what I can do.
Does the function need to be a full fledged compiler+MML, or will a simpler one work?
I can prob throw together a simple procedure that loads the string into Lape and executes it.
It won't be able to use the current scripts resources tho. (variables, constants, functions)
Brandon
2012-01-07 23:03:39
From: Dgby714
Does the function need to be a full fledged compiler+MML, or will a simpler one work?
I can prob throw together a simple procedure that loads the string into Lape and executes it.
It won't be able to use the current scripts resources tho. (variables, constants, functions)
Ahhh I see hmm I'll get back to you on that. The scripts I encrypted were full on pascal scripts that actually use smart and yeah it won't be of much use if I couldn't use the includes.. If this was done, would I myself be able to translate each function to Python? If I can, then I'd actually start on that.
Ahh don't worry yourself about it, I'll find another way.
[Nathan]
2012-01-07 23:14:53
Here is my suggestion on how to increase security, any static variables, strings, ints, colors, etc, load into an array from an authed web server. Have them be encrypted by a given string (maybe a users IP address) and use that string to decrypt the data at runtime. Also obfucate the code obviously. That will secure your script against the majority of people trying to crack it. If someone can get through that, they most likely have the ability to get through any security you can place on any code given the nature of simba (must show source code)
Edit: I didn't know about this callproc function, but with that you could have it load your entire main loop from online, just have a bunch of bogus procedures very similar but not-functioning or functioning in adverse ways in the script to make it harder to crack. And then in the main loop call each procedure by an encrypted spot in the initial array so no procedure name is ever displayed. That would be a bit harder to get through.
Brandon
2012-01-07 23:28:15
From: [Nathan]
Here is my suggestion on how to increase security, any static variables, strings, ints, colors, etc, load into an array from an authed web server. Have them be encrypted by a given string (maybe a users IP address) and use that string to decrypt the data at runtime. Also obfucate the code obviously. That will secure your script against the majority of people trying to crack it. If someone can get through that, they most likely have the ability to get through any security you can place on any code given the nature of simba (must show source code)
Edit: I didn't know about this callproc function, but with that you could have it load your entire main loop from online, just have a bunch of bogus procedures very similar but not-functioning or functioning in adverse ways in the script to make it harder to crack. And then in the main loop call each procedure by an encrypted spot in the initial array so no procedure name is ever displayed. That would be a bit harder to get through.
Problem.. Simba cannot execute code within a string.. So loading the script from any servers = nope.. never.. It's exactly the same thing your proposing as in my first post -_-
When simba gets a page, it returns the html file in a string.. and if I were to do it any other way, that would require sockets and there's no way I'm going to do that just for a script.. maybe if it was a database or something.. I'm pretty sure even if I were to use sockets, it'd still not be able to compile whatever I downloaded.. Why? Because I'd have to decrypt the file.. that'd make the whole point of this thread useless because any old smart guy can easily just find the decrypted file and yeah.. wasted my time.
belbn
2012-01-07 23:34:48
From: ggzz
Problem.. Simba cannot execute code within a string.. So loading the script from any servers = nope.. never.. It's exactly the same thing your proposing as in my first post -_-
When simba gets a page, it returns the html file in a string.. and if I were to do it any other way, that would require sockets and there's no way I'm going to do that just for a script.. maybe if it was a database or something.. I'm pretty sure even if I were to use sockets, it'd still not be able to compile whatever I downloaded.. Why? Because I'd have to decrypt the file.. that'd make the whole point of this thread useless because any old smart guy can easily just find the decrypted file and yeah.. wasted my time.
It is possible, though I'm not sure how.
Freddy1990 said he'd be designing something like this in the near future. He's the guy to ask.
[Nathan]
2012-01-07 23:56:21
From: ggzz
Problem.. Simba cannot execute code within a string.. So loading the script from any servers = nope.. never.. It's exactly the same thing your proposing as in my first post -_-
When simba gets a page, it returns the html file in a string.. and if I were to do it any other way, that would require sockets and there's no way I'm going to do that just for a script.. maybe if it was a database or something.. I'm pretty sure even if I were to use sockets, it'd still not be able to compile whatever I downloaded.. Why? Because I'd have to decrypt the file.. that'd make the whole point of this thread useless because any old smart guy can easily just find the decrypted file and yeah.. wasted my time.
You missunderstand what im saying, i didn't say execute any string in there. I meant the string being the name of an already coded procedure. You have all the procedures + decoy ones in the script, and in the main thread you call them by their name, but using a name loaded from the webserver so its difficult to find out what procedure is actually being called
belbn
2012-01-07 23:57:51
From: Sex
Simba != SCAR.
We're talking basic Pascal here. There isn't much of a difference in terms of how the code is executed.
Brandon
2012-01-07 23:59:49
From: [Nathan]
You missunderstand what im saying, i didn't say execute any string in there. I meant the string being the name of an already coded procedure. You have all the procedures + decoy ones in the script, and in the main thread you call them by their name, but using a name loaded from the webserver so its difficult to find out what procedure is actually being called
Ahh but someone smart would just put Writeln(#number here) after each one that was called.. they'd just check which numbers were written and bam.. you know which proc's are called off the server -_-
[Nathan]
2012-01-08 00:04:58
From: ggzz
Ahh but someone smart would just put Writeln(#number here) after each one that was called.. they'd just check which numbers were written and bam.. you know which proc's are called off the server -_-
Thats why you've got to get creative ;) It's also a huge downside to trying to encrypt a simba script, because a simple writeln can usaually kill it for you. But there are ways around that