Lua encryption
I. Introduction
Generally speaking, the encryption of lua refers to compiling lua into bytecode, because when the lua interpreter executes lua code, it also converts lua source code into bytecode first, and then executes the bytecode, so we put lua Converted into bytecode, one can encrypt our lua script, and secondly, it can improve the loading efficiency of lua.
However, if we want to convert lua source code into bytecode, we need a tool: the lua compiler luac.exe
. So we must first compile the source code of lua, and compile the lua.exe
sum luac.exe
.
Two.lua source code compilation
1. Download the lua source code from the Lua official website and unzip it as shown in the figure below
Lua official website http://www.lua.org/download.html
2. Use VisualStudio to create a new project -> C++Win desktop -> console application
Add src to the solution directory
Ctrl+A Select all files in the src directoryÿ