Reputation: 105
I'm trying to use this 'advanced lua obfuscator' named XFuscator to obfuscate some code I created. However, I am not sure about how to go about using this. Could you guys give me a brief explanation? Here's the github link: https://github.com/mlnlover11/XFuscator
Thanks in advance.
Upvotes: 0
Views: 3439
Reputation: 974
XFuscator\Step2.lua
(see below) cd
to XFuscator root directory (where README.txt
is located) lua XFuscator.lua "path\to\your_program.lua"
(lua should be in your PATH) path\to\your_program [Obfuscated].lua
Please note that obfuscated program can run only on the same OS and on the same Lua version (obfuscated program is heavily depends on math.random()
and math.randomseed()
behavior, these functions are OS-dependent and Lua-dependent).
You can play with option -uglify
and levels of obfuscation (see usage message inside XFuscator.lua
)
About the error:
In the file XFuscator/Step2.lua
the logic of lines #5,#6,#12 is incorrect:
Step2.lua
uses the number intact (double has 17 digits precision), while only 14 digits (that's the default Lua number format) are saved into obfuscated file on line #6. This inconsistency sometimes leads to different pseudorandom sequence and you see error message attempt to call a nil value
when trying to execute your obfuscated program.math.randomseed()
; for example, PUC Lua simply ignores fractional part, only low 32-bits of integer part are accepted as seed (unfortunately, Lua manual keeps silence about that). So, it is better for the seed to be an integer.How to fix the error:
Replace line #5
local __X = math.random()
with the following line:
local __X = math.random(1, 9^9)
Upvotes: 2