Lua code obfuscation

Has anyone ever done this with lua? I’ve done it a multiple times in my C++/C codes and to be honest now I need it the most.
The thing is my actual code is a small function, maybe 5-7 lines. Instead of messing it up, I thought I’d find some useless literally meaningless code that the interpreter won’t mind it being there, and make it like literally do nothing, and in between the lines put my actual code. Does anyone have an idea where I could find this code or other ways to obfuscate my code?

There was a pretty recent discussion about Lua Obfuscation:

The short version is: Don’t really bother because no matter what you do it’ll be almost trivial to get it readable again

Dont even bother, you wont get obfustication anywhere near C.

This always seems like a really odd thing for people to do with gmod lua, I think you should be personally do the opposite and make everything clean/add comments to actually assist the reader

I am doing this for a reason. It’s not something that they should view. Also @Exho, even if not, I just really need useless shit code that would work along with my code. No need of an obfuscation, just some random shit around my code.

The status quo of Lua code is to not obfuscate it. That means obfuscated code will stand out extremely clearly among non-obfuscated code.

Also there is no effective way to obfuscate only 5-7 lines of code. Sure, you can add bunch of dummy NOP code, but that’s not gonna do anything when they figure out what the real code is. If you call any of the GMod library functions (eg http.Fetch), it’ll be pretty damn clear what you’re attempting to do under obfuscation even if variable names are scrambled.

I’m going to assume it’s exploit code. Prove me wrong.

So assist people trying to decrypt clientside Lua?

90% of people decrypting the Lua cache are 12 year olds with no knowledge of Lua doing so just to post it to leakforums for the rep.

Oh, okay, that makes sense

Not an exploit. I’m going to write a PHP script that gets the people who use this addon, and see if there’s a match with any of my buyers on scriptfodder, because hell, my shit is being leaked way too much lately

Leakers take out any checks and put their own exploits in. They will most certainly find your obfuscated code and dismantle it. It’s simply because they know Lua.

Maybe you should make things that people feel that they shouldn’t be free in the first place. I introduced ARCLoad AFTER I got the community to respect me.

You will never be able to obfuscate your GLua scripts in a way that would make it impossible to deobfuscate or reverse engineer. What you are trying to do sounds so incredibly easy to get around if you were to do what I just said to it. It’s just a fact of life.

Obfuscation of Lua is good though? You’ve gotta be missing a whole lot of imagination if you think there is any language where “deobfuscation” is impossible.

It’s possible to mangle names, complicate logic, replace control structures with alternatives. All things which make a script pretty damn hard to read if you do it right. People may work out what makes your script tick, it’s doubtful they will end up with the original or something easy to modify without rewriting large portions.

Hell, you could write a VM if you really wanted and upload your scripts as bytecode.

Hey, most of you didn’t get me. I don’t mean to encrypt it fully and make it undecryptable; I just want to hide it between some dummy code. Sure some will find it, but the average leaker is a 11 years old kid who can’t afford a script without mom’s permission and thus they won’t even notice. If they knew lua they’d make their shit and not steal it. Also @LegoGuy, I dont care what they think, whether it should be free or not, they’re not the ones to decide that.

That is false in most cases :smiley: Many of them even keep the license key in there…

No, you don’t know how many times I’ve seen the steam ID of a guy called ChewGum in leaks. Almost all leaks have an exploit to make him superadmin.

Saying that he shouldn’t obfuscate his code just because it will always be possible to deobfuscate it is like saying we shouldn’t use anti viruses just because there will always be some viruses out there that get past it.

Anyways, any idea where I could find some dummy code?