Advanced Xlua - Bytecode Encryption

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.exesum 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

source code directory

2. Use VisualStudio to create a new project -> C++Win desktop -> console application

img

Add src to the solution directory

img

Ctrl+A Select all files in the src directoryÿ

Guess you like

Origin blog.csdn.net/qq563129582/article/details/120661716