Jump to content


Photo

Game Maker Obfuscator - Protect your GM source


  • Please log in to reply
994 replies to this topic

#1 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1457 posts
  • Version:Unknown

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:



2ewps0g.png
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.
whatthehuh.th.png
242zb7c_th.jpg
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, 20 February 2014 - 06:15 PM.

  • 10

#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
  • 8217 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
  • 312 posts
  • Version:GM:Studio

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
  • 1457 posts
  • Version:Unknown

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
  • 4922 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
  • 8217 posts
  • Version:GM:Studio

Posted 01 May 2008 - 07:08 PM

What does "Insert crap" do?

It emulates a typical GMC post.
  • 7

#10 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1457 posts
  • Version:Unknown

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
  • 4922 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
  • 1457 posts
  • Version:Unknown

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
  • 3834 posts
  • Version:GM:Studio

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

  • GMC Member
  • 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
  • 1

#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
  • 704 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

#21 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1457 posts
  • Version:Unknown

Posted 01 May 2008 - 07:45 PM

paul23, you are right, it ignores such strings. As I explained in the "About" in the program, there are most likely numerous bugs with the program.

I could add special support for those functions, but I would need a list of all "critical" functions in that case.
  • 0

#22 IsmAvatar

IsmAvatar

    Good Samaritan

  • GMC Member
  • 2411 posts
  • Version:GM8

Posted 01 May 2008 - 08:02 PM

I will see if I can help provide a silver platter for your GMK support. I wasn't aware that a golden platter was not sufficient.

You can begin by reading this (GM7 file format):
http://ismavatar.pro...i...&thread=471

and this (Encryption/Obfuscation documentation):
http://ismavatar.pro...i...&thread=476

and this (LateralGM's GmStreamDecoder/Encoder, 2 classes which makes reading/writing little-endian files and GMKrypted files that much easier):
https://opensvn.csie...eamDecoder.java
https://opensvn.csie...tException.java

and this (LateralGM's GmFileReader/Writer, 2 classes which make use of the Decoder/Encoder, so you could use them for examples)
https://opensvn.csie...FileReader.java
https://opensvn.csie...FileWriter.java

Of course, LateralGM, whilst conveniently written in Java, is (as are the files within) covered under the GNU GPL 3+, which mandates open source, so it would be incompatible with your closed-source obfuscater, but one could write similar ones from scratch, once they have obtained the knowledge needed from the files.
  • 0

#23 Schreib

Schreib

    Valen Shadowbreath

  • GMC Member
  • 1457 posts
  • Version:Unknown

Posted 01 May 2008 - 08:04 PM

IsmAvatar, you'd be the first person anyway I'd be running to for support when it comes to the GM format.

Again, thanks for the GM6 file documentation.
  • 0

#24 erthgy

erthgy

    GMC Member

  • New Member
  • 1718 posts

Posted 01 May 2008 - 08:05 PM

nvm, perfectly legal.

Apparently, decompiling isn't :D

GM6.

Sadly, I don't think it's possible for him to make a GM7 version.

and i dont see why everyone is making these things

You mean, you don't care if x years of your blood, sweat, tears, (and passion) of making a commercial game gets hacked, and some one steals the idea?

no games are worth decompiling anyway.

Call our Game Maker Creations' worthless all you want, our work still continues.

and if u decompile a game ur not a noob.

Maybe not nooby, just illegal.

and u WONT be making it for GMKs.

I don't see you trying to help him, so, why complain?

as usual, useless stuff flooding the GMC.

I could tell from your horrible grammar, badly thought out post content, and of course, the order that it was all posted in..

You couldn't make anything better.

You proved that the saying still lives on...
Schreib, this is pretty cool, perhaps, you could contact YYG and maybe... Work, for them? I mean seriously, this could make you a lot of money (from them funding you somehow). Don't ever be "lazy". Just finish that lazy part you were talking about, and listen to the (constructive) feedback that people give you. Apparently you mentioned NPT not liking these types of programs, well, now he likes yours :GM6:.
P.S: Don't use curse words in the first post, they will generate flame! (try replacing the F-word, with the word "chicken" ^_^.) (Also, sorry this post was so long! :D)

Edited by erthgy, 01 May 2008 - 08:07 PM.

  • 0

#25 uuf6429

uuf6429

    Covac Software

  • New Member
  • 2522 posts

Posted 01 May 2008 - 08:08 PM

I was wondering when something like this would come out. The idea was to obfuscate the code, but you did a better job and added the finishing touches.

It keeps away the (at least lazy) noobs.

A suggestion to section V.: Just rename the file from zip to jar!! :D

Kind regards,
Christian
  • 0

#26 NakedPaulToast

NakedPaulToast

    GM Studio/Mac/Win

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

Posted 01 May 2008 - 08:33 PM

Apparently you mentioned NPT not liking these types of programs, well, now he likes yours .


Apparently, you misunderstood, what Schreib said. A program like this for GM has never been released publicly before. My dislike for previous "decompiler solutions" were not because they attempted to solve the problem, it was because they didn't solve anything. I also disliked how the promoters never disclosed the the shortcomings.

Schreib's obfuscator is a completely different type of solution, and his topic is candid and honest regarding it's capabilities.

I commented specifically on obfuscation and decompiling before I was aware that Schreib was working on one.

[link removed]

Some ideas for future versions of Game Maker.

  • Change the exe format, with some deliberate obfuscation designed to inhibit decompiling.
  • Allow variable and resource names to be obfuscated. Yes, this could possibly break execute_string() and execute_file().
  • Make obfuscation an option, conditional that execute_*() commands can’t be used. This will also help protect exes from techniques that force open the interactive debugger.
  • Assuming variable and resource obfuscation is implemented. Give every resource an obfuscate option, create a keyword volatile, for variables. During traditional compile and runs, no obfuscation occurs. This way the debugger still works. When a release exe is being generated, then the obfuscation option gets selected, all resources and variables are obfuscated except resources without the obfuscation option, and variables defined as volatile. This way execute_*() could still be used with those.


  • 0

#27 paul23

paul23

    GMC Member

  • Global Moderators
  • 3834 posts
  • Version:GM:Studio

Posted 01 May 2008 - 09:32 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.



So what happens if I have this variable named "team"..

now in the creation event I do:
if (!variable_local_exists("team"))
{
	team=0
}
If I put in the creation code of objects in the room event, which executed before the creation event, "team=1", what will happen? - Cause I mean, if a name got changed checking for the existance of "team" is pretty useless..
  • 0

#28 Loaf

Loaf

    Just loafing around

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

Posted 01 May 2008 - 09:34 PM

Good work. I'd love to feature this in GM Fetch, as the whole theme of issue 2 is decompilers, and ways to protect your games. Permission? :D
  • 0

#29 Chronic

Chronic

    Administrator

  • Global Moderators
  • 2729 posts
  • Version:GM:Studio

Posted 01 May 2008 - 10:00 PM

paul23, the easiest way to understand this is by thinking of it as a search and replace tool. It looks for a resource name and then changes that to a random string. Then goes and finds other locations of that resource name changing it to the same random string.

Thats why this tool won't work if for some reason you need to have your (eg, sprite and object) resources named the same (btw, the tool does warn you about this if it finds dupe resource names).


Gamma6, you might want to PM him about that. Your post could be over looked.
  • 0

#30 Loaf

Loaf

    Just loafing around

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

Posted 01 May 2008 - 10:28 PM

Yeah your right...
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users