As the title suggests, what would be the scope of the code loaded using loadstring or dofile? One of the issues at the moment with lua is the easy decompilation, so if there were techniques used to circumvent this, what would be the scope of the code block (compiled bytecode) loaded in this way?
I'm saying this from my own experience. It seems that dofile has it's own scope. I haven't been able to access anything declared local outside of the file.
One way to thwart Lua decompilation is to put some of the code in a native plugin.
The functions load/loadfile/dofile/loadstring executes Lua codes as chunks: http://www.lua.org/manual/5.1/manual.html#2.4.1 Also the Lua files inside a Gideros project are executed as chunks. @OZApps, I think it's possible to encrypt Lua files within Lua.
@Magnusviri Also a simple plugin can be used to load encrypted lua files. (e.g. through a loadencryptedfile function)
Comments
One way to thwart Lua decompilation is to put some of the code in a native plugin.
My apps: http://www.yummyyellow.com
@Magnusviri Also a simple plugin can be used to load encrypted lua files. (e.g. through a loadencryptedfile function)