Jump to content


Photo

Game Maker Obfuscator - Protect your GM source


  • Please log in to reply
993 replies to this topic

#1 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1455 posts

Posted 01 May 2008 - 04:06 PM

GM Obfuscator
Written by Schreib in Java


"I tested this program on a few simple games, and it sure got me. The source code is rendered nearly impossible to read, by anyone other than the amazingly desperate." - anonymouss

"One does not simply undo obfuscation." - Big J

*~ Download ~*

Above link doesn't work? Try this mirror.

REQUIRES JAVA 6.0 OR LATER. Get the latest version at www.java.com.


:GM8: A GM8.1 version is now available! Sprite obfuscation possible! :GM8:



Posted Image
Screenshot of the GM Obfuscator v0.3.0


Update 0.3.0: Massive content update including sprite obfuscation, greatly enhanced obfuscation abilities and is now very unlikely to produce buggy code


Table of contents:
I. What is an obfuscator?
II. What was the purpose of this project?
III. I'm having problems with this! It messes up my game completely!
IV. Who made this program, and what language was it written in?
V. How do I use this program?
VI. "When I open the ZIP all I see is .class files. How do I run the program?"
VII. Screenshots
VIII. Download
IX. Acknowledgements
X. Bugs & Suggestions
XI. Licensing and terms of use
XII. Final words


I. What is an obfuscator?
An obfuscator is a software program that will rewrite source code of a program to make it as unreadable as possible to human agents, often to prevent people from decompiling/reverse engineering the program and exploiting the code and resources in it. This project is such a program - specifically, it will take a :GM5:/>, :GM6:/>, :GM7:/> or :GM8: and spit out a new source with the code, resources and variables completely unreadable and in-understandable. An option even makes sprite and background obfuscation possible, with some limitations.

II. What was the purpose of this project?
This project was originally designed to provide an immediate solution to imminent issues Game Maker executables had with decompilation, but has more recently taken on other tasks. Being tremendously more powerful than its predecessor, and much more accurate in preserving code logic, as well as its support for newer Game Maker versions completes what its predecessor had problems with. Remember, this program does not make your games undecompilable. Additionally, this program was NOT designed to specifically counter the decompilation project, as I respect the work put into it a lot. The program's original purpose, and largely its current purpose was respectively is to hinder "noobs" who used the decompiler to understand the game source structure and code. As its obfuscation horizons have expanded greatly, even expert users will have trouble reverting the code back to an understandable format now.

III. I'm having problems with this! It messes up my game completely!
Here are a few pointers.

  • Try obfuscating again. Because of the obfuscator's innate randomness, although very unlikely now, re-obfuscation might eliminate an unlikely random error.
  • Using an extension package? Because of their nature, you are expected to add all functions and references to the extension package to the Do Not Modify list, as the obfuscator cannot automatically tell what is an extension function and what isn't.
  • Use the debug check box. The obfuscator will then insert the original names as comments, allowing you to find the part which Game Maker cannot compile and edit it back to its original state.
  • Uncheck "Nasty Obfuscation" and see if the state improves. If so, please contact me and describe the differences.
  • Make sure you are not using deprecated functions, such as image_single, move_contact, make_color, external_call0, external_call1, image_single, image_single, image_single or the like. If you are, simply add the deprecated function (without the parenthesis) to the "Do Not Modify" list.
  • If you think a particular function or variable is the cause, try adding it to the Do Not Modify list.
  • If the problem remains unfixed, uncheck "Rename resources", obfuscate and try to run the obfuscated copy. Once you get an error, take a look in which script or piece of code the error occurs in. Then post the un-obfuscated script or code here. It will most likely be a problem like the ones above, but in the circumstance it isn't, I will see if I can fix other types of problems.
If all else fails, please e-mail me at axiomates@gmail.com.

IV. Who made this program, and what language was it written in?
The program was made solely by me, Schreib. I've received much Java help from others, including the person going unnamed who made the decompiler. I want to sincerely thank ISMAvatar for providing such excellent Game Maker editable file format documentation, and xot for assisting greatly in developing clever image obfuscation algorithms.
The program was written in Java using the open-source development platform Eclipse, utilizing JavaX Swing components to make the GUI.

V. How do I use this program?
To run the program under Windows, usually, given that you have Java 6.0 or later installed, all you have to do is double-click the .jar file and it should launch momentarily.

If you're under another operating system and/or this method does not work, try using the following command in a terminal/command window:
java -jar url
where "url" is the path to your .jar (for instance, java -jar "C:\Users\Schreib\Desktop\GM Obfuscator 030.jar")

Using program is rather straightforward. Simply select your .gmd (for GM5), .gm6 (for GM6), .gmk (for GM7 or GM8.0) or .gm81 (for GM8.1) file (don't forget to read the license!), specify your settings and process your Game Maker editable to a new location. If you wonder what a certain setting does, hover your cursor over it and a tooltip will appear explaining what it does. Take this final file, open it and create an executable out of it. That's it, your game functions just as well as before, but when decompiled is quite difficult to understand.

If you've used the Sprite Obfuscation option, you may have to take additional steps before creating your final executable. This is explained, however, when you attempt to run your game directly after obfuscation.

VI. "When I open the ZIP all I see is .class files. How do I run the program?"
Internet Explorer tends to think that a downloaded .jar file is actually a .zip file (which it is, in one sense). This rarely happens on later editions, however. Simply make sure that it has the .jar extension.

VII. Screenshots
Here are few screenshots GM project that have been obfuscated.
Posted Image
Posted Image
More screenshots:
  • Space Cleaner's sprites have been completely ravaged. [1]
  • Space Cleaner works fine despite this. [2]
  • The original code for the obfuscated code above. [3]
  • Hey, don't ask me, I'm sure this stuff was legible before. [4]

VIII. Download
If you missed the large upload link above, here it is again: JAR (read section VI above, IE6 users!) from one of these two mirrors:

Main link (0.3.0): host-a.net
Mirror (0.3.0): speedyshare.com


Old links (0.2.2, 0.0.3):
mediafire.com
mediafire.com

IX. Acknowledgements
Again, my biggest thanks go to ISMAvatar, for her excellent Game Maker editable file format documentations and GMK encryption documentation and to xot for his invaluable help with image obfuscation algorithms. Thanks to YellowAfterLife for concieving an interesting obfuscation strategy and piluke for being helpful with testing.

X. Bugs & Suggestions
This program has been thoroughly tested on my own and others' GMD's, GM6's, GMK's and GM81's, including a lot of variety such as Drag and Drop, code styling variations and so on. Earlier, this program was slightly prone to some styles of coding, but should be much less so now. Despite this, I still disclaim myself from the possibility that your coding style may cause problems. The program was written in mind with the default Java coding & indentation standard. If it still fails, it will report with an error of the script/code/object in question, Even if it is successful, there is no guarantee that your game will be syntax-error free. Please, PLEASE contact me if your code causes an error.
If you want to report a bug, send me a PM or e-mail me at axiomates@gmail.com with the ORIGINAL file and the script/code the obfuscator couldn't obfuscate. If you have any suggestions, please let me know.

XI. Licencing and terms of use
This program utilizes the .gmd, .gm6, .gmk and .gm81 file formats, jointly created and designed by Mark Overmars and YoYoGames, respectively. I claim no ownership over these file formats whatsoever. This program only uses these relatively open formats and does not interact with Game Maker executables or the Game Maker runner. I hold no responsibility or accountability if the program is not able to read your particular file, and neither does Mark Overmars or YoYoGames. This project is not officially supported by either YoYoGames or Mark Overmars. No illegal use of proprietary technology owned by any party is intended. Please contact me about such issues.
Copyright © 2011 Schreib (axiomates@gmail.com). All rights reserved.

Redistribution and use of this software are permitted
provided that the following conditions are met:

- No modifications whatsoever must have been made to the original package.
This includes modifications to the above copyright notice, this list of
conditions and the following disclaimers, which must all be retained at
all times in the software.

- No commercial profit, whether abstract or concrete, must be made when
redistributing the original package.

In addition, this software must never be reverse engineered, decompiled or
disassembled in any way.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; DAMAGES INFERRED FROM POTENTIAL LICENSE INFRINGEMENTS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


XII. Final words
Well, this is it, again, after many months of work. I am truly happy that I have been able to contribute to helping the community create, and more specifically, secure their games.

© Copyright 2011 Schreib

Edited by Schreib, 25 November 2012 - 04:26 PM.

  • 9

#2 enterstations

enterstations

    GMC Member

  • New Member
  • 191 posts

Posted 01 May 2008 - 04:12 PM

pretty cool FIRST POST!

edit: it works like a charm!

is it only for gm6?

Edited by enterstations, 01 May 2008 - 04:13 PM.

  • 0

#3 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 7198 posts
  • Version:GM:Studio

Posted 01 May 2008 - 05:24 PM

Unlike the previous non-solutions to the decompiler. This project has a tremendous amount of potential. As Shreib describes, this does not prevent decompiling, but renders the decompiled output almost useless.

This is the type of solution that Java, and other decompilable languages uses.

I hope this project is well received, and expanded to include GM 7.

Excellent work Shreib!
  • 0

#4 skinnyeddy

skinnyeddy

    GMC Member

  • GMC Member
  • 307 posts
  • Version:GM8

Posted 01 May 2008 - 05:32 PM

this seems pretty cool! I would use it but, alas, i use GM7. Still, keep up the good work
  • 0

#5 Samscam

Samscam

    Retired GMC Reviewer

  • GMC Member
  • 648 posts

Posted 01 May 2008 - 06:30 PM

I like the fact that you can only delete the comments. This will decrease the game file size if you don't check the other options.

Grtz,
Samscam
  • 0

#6 anonymouss

anonymouss

    Wanna Play?

  • New Member
  • 1018 posts

Posted 01 May 2008 - 06:47 PM

Before I use this, I have a question: Does it raise or lower the filesize?
  • 0

#7 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1455 posts

Posted 01 May 2008 - 06:58 PM

The initial file will be about a meg higher, from a lazy me. It's actually about a meg of null bytes in the end of the file, but GM ignores those anyway. When you've processed the file, open the processed one and resave it to yet another file. That rids the null bytes, and the final file will be... i'd say 5 kb larger than the original, since it renames variables and names to larger ones.
  • 0

#8 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

Posted 01 May 2008 - 07:03 PM

What does "Insert crap" do?

Edited by Revel, 01 May 2008 - 07:04 PM.

  • 0

#9 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

  • GMC Member
  • 7198 posts
  • Version:GM:Studio

Posted 01 May 2008 - 07:08 PM

What does "Insert crap" do?

It emulates a typical GMC post.
  • 5

#10 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1455 posts

Posted 01 May 2008 - 07:09 PM

If you wonder what a certain setting does, hover your cursor over it and a tooltip will appear explaining what it does.


  • 0

#11 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4873 posts
  • Version:GM8

Posted 01 May 2008 - 07:12 PM

Oh, sorry. I missed that part. :D



Nice software! It would be great if you released a GMK version.

Edited by Revel, 01 May 2008 - 07:15 PM.

  • 0

#12 X-tra Fear

X-tra Fear

    Behemoth Creator

  • GMC Member
  • 430 posts
  • Version:GM8

Posted 01 May 2008 - 07:19 PM

Good work.

[Edited my noob post.] :D

Edited by X-tra Fear, 24 February 2009 - 09:06 PM.

  • 0

#13 Somelauw

Somelauw

    GMC Member

  • GMC Member
  • 1096 posts
  • Version:Unknown

Posted 01 May 2008 - 07:25 PM

Good job. Legal, simple and effective.
I didn't noticed much of the inserted crap btw. But the name sounds funny.

Edited by Somelauw, 01 May 2008 - 07:35 PM.

  • 0

#14 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1455 posts

Posted 01 May 2008 - 07:25 PM

Do I have to repeat I did not make this to stop the decompilation project?

I haven't tried it yet, but I suggest you also remove all indentation and remove all linefeeds.

I also suggest you put an example of obfuscated code in your first post.


It's noticable that you haven't tried it yet. :D It DOES remove all indentation and linefeed defaultly.

Edited by Schreib, 01 May 2008 - 07:26 PM.

  • 0

#15 Maxi06

Maxi06

    GMC Member

  • New Member
  • 276 posts

Posted 01 May 2008 - 07:33 PM

Nice, simple awesome idea works great! Although its not gonna stop the "uber noobs" that just decompile a game and change the sprites.
  • 0

#16 jontyl

jontyl

    JJTGames

  • New Member
  • 514 posts

Posted 01 May 2008 - 07:36 PM

Awesome!
But, when i checked the 'insert crap' button, there was a compile error
  • 0

#17 paul23

paul23

    GMC Member

  • Global Moderators
  • 3355 posts
  • Version:GM8

Posted 01 May 2008 - 07:37 PM

uhm aren't there a mega number of bugs with such a tool? - Renaming resource names would potentially remove a lot of functionality (things like "if (object_get_name(OBJECT) = BLALBLA)" don't work.. Neither does the function "Variable_exists()" work anymore! Or does it look inside strings too?
  • 0

#18 t3mp3st

t3mp3st

    Damaged's Tool

  • Retired Staff
  • 2026 posts
  • Version:Unknown

Posted 01 May 2008 - 07:39 PM

and i dont see why everyone is making these things

Really? First I've seen.

no games are worth decompiling anyway

Few, maybe, I wouldn't say none though.

and u WONT be making it for GMKs
as usual, useless stuff flooding the GMC.

That doesn't make it less useful to users of GM6.


Perhaps the next project might be a de-obfuscator, that could correct grammar and capitalization in posts. I know I'd find that useful. :D
  • 0

#19 Dmaster270

Dmaster270

    GMC Member

  • New Member
  • 1736 posts

Posted 01 May 2008 - 07:44 PM

uhm aren't there a mega number of bugs with such a tool? - Renaming resource names would potentially remove a lot of functionality (things like "if (object_get_name(OBJECT) = BLALBLA)" don't work.. Neither does the function "Variable_exists()" work anymore! Or does it look inside strings too?

Nope. It doesn't mess with functions, and when it changes a name it changes everything about the name. if's aren't messed with.
  • 0

#20 SunnyKatt

SunnyKatt

    Code Drama

  • Sandbox Moderators
  • 690 posts
  • Version:GM:Studio

Posted 01 May 2008 - 07:45 PM

Sweet idea! I'll look forward to the final version!
(I hope it's gm7 compatable...)

EDIT: ...crap.

Edited by SunnyKatt, 02 May 2008 - 08:16 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users