如何混淆lua代码? [英] How to obfuscate lua code?

查看:1130
本文介绍了如何混淆lua代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google上找不到用于加密/混淆我的lua文件的工具的任何内容,因此我决定在这里询问.也许有些专业人士知道该怎么做? (免费).

I can't find anything on Google for some tool that encrypts/obfuscates my lua files, so I decided to ask here. Maybe some professional knows how to do it? (For free).

我现在已经在lua中制作了一个简单的游戏,我不希望人们看到代码,否则他们很容易作弊.我怎样才能使.lua文件中的整个文本变成随机的字母和东西?

I have made a simple game in lua now and I don't want people to see the code, otherwise they can easily cheat. How can I make the whole text inside the .lua file to just random letters and stuff?

我曾经用C#编程,我有一个名为SmartAssembly的.NET混淆器,效果很好.当有人尝试检查我的应用程序的代码时,它只是一堆字母和数字以及汉字和其他东西.

I used to program in C# and I had this .NET obfuscator called SmartAssembly which works pretty good. When someone would try check the code of my applications it would just be a bunch of letters and numbers together with chinese characters and stuff.

有人知道还有什么程序可以对lua做到这一点吗?只需加载要加密的文件,然后单击加密"或加密"即可.可以!!

Anyone knows any program that can do this for lua aswell? Just load what file to encrypt, click Encrypt or soemthing, and bam! It works!?

例如:

print('Hello world!')

会变成类似

sdf9sd@@@&/sdfsdd9fd0f0fsf/&

推荐答案

只需预编译文件(块)并加载二进制块. luac允许您剥离调试信息.如果这还不够,请在已编译的lua上定义自己的转换,并在可能的情况下剥离名称.尽管对lua混淆器的需求并不多...

Just precompile your files (chunks) and load binary chunks. luacallows you to strip debugging info. If that is not enough, define your own transformations on the compiled lua, stripping names where possible. There's not really so much demand for lua obfuscators though...

此外,您还失去了使用嵌入式脚本语言的主要优势之一:可扩展性.

Also, you loose one of the main advantages of using an embedded scripting language: Extensibility.

这篇关于如何混淆lua代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆