Author Topic: [RESOURCE] Script_Compressor  (Read 11493 times)

A script I wrote which contains functions to compress or obfuscate code.

List of functions:
ObcompFolderTo(); - Copies, obfuscates, and compresses one folder to another.
ObcompFileTo(); - Copies, obfuscates, and compresses one file to another.
ObcompCode(); - Returns an obfuscated and compressed copy of the code.
CompressFolderTo(); - Copies and compresses one folder to another.
CompressFileTo(); - Copies and compresses one file to another.
CompressCode(); - Returns a compressed copy of the code.
ObfuscateFolderTo(); - Copies and obfuscates one folder to another.
ObfuscateFileTo(); - Copies and obfuscates one file to another.
ObfuscateCode(); - Returns an obfuscated copy of the code.

Script_Compressor.zip


I also need some help testing it for issues.  The specific criteria it needs to meet are as follows.
  • Valid code must always be turned into valid, equivalent, code.
  • Invalid code must never be turned into valid code.
  • For valid code, the following properties must hold true:
    • The output of the main three functions1 must always be the same length or shorter than its input. strLen(%code) >= strLen(CompressCode(%code))
    • If fed their own output, the main three functions must produce the same result. CompressCode(%code) $= CompressCode(CompressCode(%code))
    • The CompressCode(); function must remove all whitespace which is not necessary for the code to remain valid.

1CompressCode();, ObfuscateCode();, and ObcompCode();.


If you find any code which fails one of the above criteria, please post the criterion, the functions which fail, the original code, and output code.

Also, if you have any suggestions for additional criteria, please post them.
« Last Edit: October 13, 2014, 04:15:36 PM by Xalos »

Gross.
There isn't much point to this except for really huge mods.
« Last Edit: November 19, 2014, 07:51:32 AM by jes00 »

Really? Obfuscate? Released Addons aren't supposed to be kept secret. They should be kept open source for other users to learn from the code. That creates a potential for people to create new addons from what they've learned from the source code.

There are stealers? So what? Use the same method you guys used to send zedrow off the face of the earth.

If this turns to a problem we will see a de-obfuscator very soon considering that something open-source is going to be the obfuscating tool.

If this turns to a problem we will see a de-obfuscator very soon considering that something open-source is going to be the obfuscating tool.

Then it will be a battle that won't end very well

All it does is rename the script's local variables.  Who cares.  All it does is make you have to take three seconds longer to be sure you're changing the right variable.

Really, it's the compressor that makes the code harder to read.


Ew no
there is no good use for this

Edit: well except for massive mods, but it's going in a zip file in the end anyway
« Last Edit: December 02, 2014, 01:55:29 PM by TristanLuigi »

Really? Obfuscate? Released Addons aren't supposed to be kept secret. They should be kept open source for other users to learn from the code. That creates a potential for people to create new addons from what they've learned from the source code.

There are stealers? So what? Use the same method you guys used to send zedrow off the face of the earth.
lol

Gross.
There isn't much point to this except for really huge mods.
Edit: well except for massive mods, but it's going in a zip file in the end anyway
Doesn't justify making the code unusable to people who'd want to learn from it. There's no add-on so massive that it'd need something like this to reduce the size, let alone gaining that size through code alone. Can't even imagine anyone that could benefit from this thing.

Actually I thought of one use just now: You could write a decently sized add-on (or just re-release RTB with a new doodad in it, doesn't matter as long as you get a decently sized script going), put in a backdoor to steal keys or whatever, and then run it through this so you maximise the damage done by making it take longer to be found. So yeah, thanks for that.