Obfuscated
Obfuscated

Reputation: 105

How would I use this?

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

Answers (1)

Egor   Skriptunoff
Egor Skriptunoff

Reputation: 974

  1. Download XFuscator source code to your computer.
  2. Fix error in the file XFuscator\Step2.lua (see below)
  3. Open console and cd to XFuscator root directory (where README.txt is located)
  4. Run lua XFuscator.lua "path\to\your_program.lua" (lua should be in your PATH)
  5. See the result (obfuscated program) is in 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:

  • Line #12 of 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.
  • Not all Lua implementations are sensitive to fractional part of a number given as an argument to 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

Related Questions