## obfuscator

rnd
Member

Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

### obfuscator

Having trouble reading and understanding the code? Your worries will soon be over with my latest GPL OSI compliant open source mod that magically transforms your open source lua code to crystal clarity. Imagine the possibilities! :)

Depends : default

--------------------------------------

Inspired by recent comments on anticheat forum topic i realised the error of my ways of hiding the code inside compiled binary, which is very unfair to the community since it blocks off the ability to read/edit/share code. Not to mention i could be hiding potentially bad stuff in binary .. which is just outrageous!
I now know that the only true way is to provide FULL OPEN SOURCE code, so i wrote this little mod, which is fully open source too.

Why write such a wonderful thing you ask? because we want to be FREE to use names like v_______ for our variables! FREEEEEEEEDOM :)

If you want challenge you can rewrite this mod into "normal" form so you can see how "exactly" it works - the main program was used to obfuscate itself.

Very very short example:
Code: Select all
`--  BEFORE: ---local i,nfactors = function( n )     local f = {}       for i = 1, n/2 do -- here we try all the possible factors of n        if n % i == 0 then -- here we check if n is divisible by i            f[#f+1] = i -- we found factor, add it to the list        end    end    f[#f+1] = n    print("factors of " .. n .. " are : " .. table.concat(f,","))endfactors(25)-- AFTER : ---v____ = function( v___ ) local v__ = {}  for v_ = 1, v___/2 do if v___ % v_ == 0 then v__[#v__+1] = v_ end end v__[#v__+1] = v___ print("factors of " .. v___ .. " are : " .. table.concat(v__,",")) end v____(25)`
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

Linuxdirk
Member

Posts: 2423
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

### Re: obfuscator

Don't forget to provide the non-obfuscated code with your obfuscated code if you release the code under GPL.

Section 3 of GPL version 2 wrote:The source code for a work means the preferred form of the work for making modifications to it.

And no, the obfuscated code is NOT the preferred form.

rnd
Member

Posts: 220
Joined: Sun Dec 28, 2014 12:24
GitHub: ac-minetest
IRC: ac_minetest
In-game: rnd

### Re: obfuscator

http://www.doc.ic.ac.uk/~susan/475/unmain.html

yes this is "classic" - already did many things from this like "logic variable names" and "one liner". I will later add more ideas:

1- collect all visible global variables into list and assign local to each of them
2- encrypt all literal strings

1,2 for example give you: minetest.get_node == minetest["get_node"] ----> v_______["\$%^7gl_ff"]
additionaly you can modify strings like
print("hello") ---> print("\115\116\114\105\110\103")

3- another fun idea: whenever a local function is called like f(x1,x2,...,xn) add few dummy variables X1,..,Xm in random position so you need to call it like f(x1,X2,x3, X1, .. xn) ..
and inside target function add few dummy checks at random locations involving those dummy variables like:
if X1 == X2+x1 then X3 = X3+X1 end so it will look important but it doesnt really do anything worthwhile. But how do you know that ? :)
1EvCmxbzl5KDu6XAunE1K853Lq6VVOsT

Member

Posts: 1717
Joined: Sun Jun 01, 2014 20:00
Location: New Hampshire U.S.A