Hiding Lua source code in C application

I am currently developing a game in C and Lua. Since I plan to sell my game when it's finished, I would like to keep the source code closed. So my question is whether there is a way that I can hide, or somehow access the Lua code with C, without being able to be viewed by the user. Right now, my executable is placed in the same place as my Lua code, so it may be available.

Thanks for reading this and any help is appreciated. Please ask me if I am too vague.

+6
source share
2 answers

I think the correct answer is that you cannot. You can make life stronger for a cracker. More effective protection schemes have been fixed than compiling code into bytecode. If your game does not prove to be popular, in any case, it does not matter. Write a game first, and then consider hiding your code.

+5
source

Lua manual says :

[Lua] Chunks can also be precompiled into binary form; see the luac program for more information. Programs in source and compiled forms are interchangeable; Lua automatically detects the file type and acts accordingly.

This means that you can use luac (the Lua compiler) to compile your Lua code into binary form, which will not be easy to read, but can still be parsed to find out what it does (which can be done even with C if you have enough defined).

+5
source

Source: https://habr.com/ru/post/955726/


All Articles