I am currently developing a game in C and Lua. Because I plan to sell my game when it is finished, I would like to keep the source code closed. So my question is whether there is a way I can hide, or somehow access my Lua code from C, without the user being able to look. Right now, my executable is placed in the same place as my Lua code so it can be accessed.
Thanks for reading this, and any help is appreciated. Please ask me for more details if I am being too vague.
I think the correct answer is, that you can't. You can only make life harder for the cracker. Better protection schemes than compiling code into bytecode have been cracked. If your game does not prove popular, it won't matter anyway. Write the game first, then worry about hiding your code.
Lua manual says:
[Lua] Chunks can also be precompiled into binary form; see program
luac
for details. Programs in source and compiled forms are interchangeable; Lua automatically detects the file type and acts accordingly.
This means you can use luac (Lua compiler) to compile your Lua code to binary form, which will not be easily readable, but can still be disassembled to find out what it does (which can be done even with C if you are determined enough).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With