Windows PROTECT MY GML CODE ! NO DECOMPILATION !

Discussion in 'Game Design, Development And Publishing' started by SSSSS, May 27, 2019.

  1. SSSSS

    SSSSS Member

    Joined:
    Mar 9, 2019
    Posts:
    6
    Hello everyone,
    here I made a game by GMS like everyone else.
    But is there a way to protect my game against a possible decompilation. I'm not worried that my game is copying but what I do not want is for people to access the code. I saw for GM8 that there was a decompiler and that on GMS there are other programs that can extract the data.win file.
    What can be done so that the code is impossible to decompile or read (or encrypted)! Help !!!
     
  2. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    388
    It is not "traditionally" possible anymore with Game Maker Studio. You can further boost it with YYC builds.

    If it concerns you; any app, including Youtube, Facebook, Instagram etc. can be decompiled in professional hands.
     
  3. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,632
    It is not possible to protect anything fully. That lies in the nature of software.

    You can, however, compile your game to native code (using YYC instead of VM exports). This will make it more difficult and take longer to decompile.
     
    Gamebot, Kezarus, Cpaz and 2 others like this.
  4. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Although having your shaders in clear text for anyone to grab has always been a pet peeve of mine with GMS. YYC or not, it's there for the taking.
     
  5. SSSSS

    SSSSS Member

    Joined:
    Mar 9, 2019
    Posts:
    6
    for summary, is there a way before, during or after compilation to better preserve its code?
    What does the YYC build allow?
    Do not put shaders (?!?) in clear text ?
     
  6. SilentxxBunny

    SilentxxBunny Epsilon

    Joined:
    Jun 21, 2016
    Posts:
    86
    You can make it very, very difficult to decompile, though. I lost the source code to a 2012 project, and my team did such a good job of protecting it that I now consider it "gone forever."

    Ain't that a <expletive deleted>?
     
  7. nacho_chicken

    nacho_chicken Member

    Joined:
    Jun 21, 2016
    Posts:
    380
    Honestly, don't worry so much about people decompiling your game. YYC export is more than enough protection if you're truly worried about it.

    In case you're wondering what that does, it basically converts your game to C++ and compiles to native code. Your game will take just as much work to decompile as anything else compiled as native code.
     
    Kezarus, EvanSki and SilentxxBunny like this.
  8. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,405
    DBenji, Yal, EvanSki and 2 others like this.
  9. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    I read your section on shaders.

    There is no algorithm to 'crack' with complied shaders. They are compiled into assembly and (for HLSL anyway) are digitally signed internally. So if you are fluent in shader assembly and able to bypass the validation, go your hardest.

    I don't know that anyone has ever asked for 'encrypted shaders' in these forums. People are just asking for pre-complied shaders. YYG pre-create the texture pages, so why not? It's just a matter of running said shader through fxc.exe and add them into the data.win as a compiled shader object.

    You could even take it one step further and complie the shader and add it directly to the source code. You won't even be able to view the shader in utilities like 'reshacker' as it is not merely an added resource.
     
  10. Guest

    Guest Guest

    Dumb question, I'm not a real programmer or CS person: what do people do after they decompile something, except maybe cut out any DRM check?

    I totally get the principle of the matter, but I'm curious what the pragmatic upshot is.

    I'm pretty sure if most of the posters upstream from me saw my source code, they'd gag a little bit and then just recreate my game from scratch in two weeks.
     
    EvanSki likes this.
  11. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,632
    There are various reasons for decompiling things (none of which change anything about its legal status, regardless of the intention). Looking at the source code trying to learn from it, stealing parts of it for your own game, making modifications to the game, replacing all author data with your own and trying to sell it as your own (that has happened with (definitely open-source, not sure about closed-source) software before, I don't remember it specifically happening with games, though), removing DRM and uploading it to piracy sites, abusing knowledge of the networking code so you can attack, hack or cheat the game's servers, making troll videos on Youtube that try to pass something humorous that wasn't in the game before as authentic and enraging the comments, blackmailing the developer to pay you a fee because you'll otherwise release the source code publicly... and that's just a few things I came up with in a minute or two. The potential catastrophic effects scale in sort of a bell curve with the success of a game - useless for games that aren't generating much or any revenue, very harmful for mildly successful games which are selling a bit but not fully covering costs, and relatively harmless again when a game has become so popular that it would still generate substantial revenue even if a hefty portion of the players had pirated copies and the game might actually benefit from the popularity boost of resulting mods / videos / fan base increase (see Undertale).
     
    Kezarus, Yal, EvanSki and 4 others like this.
  12. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    JeffJ and nacho_chicken like this.
  13. Niels

    Niels Member

    Joined:
    Jun 22, 2016
    Posts:
    826
    Why would anyone worry about having their code decompiled?

    Unless you use your scripts as some sort of diary to store your darkest secrets;)
     
    Kezarus and EvanSki like this.
  14. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,632
    Probably mainly piracy. Also every other malicious thing I mentioned in my previous post.

    Ssssh, that was a secret! >.<
     
    Kezarus and Niels like this.
  15. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580

    I've waited all my life for this. Okay so

    Yes. people can decompile your game. but its [Unimaginable list of swears here] Pointless.
    all your code is useless encrypted unreadable garbage when its pulled from the .win
    your strings, GMS Functions, and the names of your objects and rooms are readable, but what are you gonna do with the names of them? start a boy band?
    now you can get textures and sprite sheets, but people who have your game even without decompiling it have those, so dont worry about it. there just .pngs
    I've done this my own games, 1. because I gave myself permission. 2. to solve people decompiling my games
    at the end of the day its pointless
    you can edit your code with a hex editer but no ordinary joe blow is gonna waste time figuring out what byte of data does what.
    and most importantly, why would anyone want to decompile your game? It gives them no benefits all your stuff is protected under copyright

    so in summery,

    dsmGaKWMeHXe9QuJtq_ys30PNfTGnMsRuHuo_MUzGCg.jpg
    Theres no point in doing so, and no one will want to unless they had a very (Hoover-Dam)-ned good reason too.

    I know community guidlines say dont talk about decompilers, but the topic is how to protect myself from them, so im answering the question by being useful and sharing my knowledge on the issue. (nobanplz)

    edit: also if you throw the .win in audacity as raw data you get all the sounds covered by static
    I did this once, cleaned the static sounded like the game was saying "bow down to me"
     
    Kezarus likes this.
  16. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Sure, that's stops pirates dead in their tracks. :p

    How about this? Johnny sells his awesome shader kit for $50 on the marketplace. Like any good lad, and confident in his product, he supplies an exe demo so people get full disclosure on what they are getting.

    Evil Steve and his mates come along and download his demo, open it in notepad, and get complete human readable access to his shaders. And being the naughty boys they are, aren't worried about copyright and use it in their own games.

    Better still, Steve's best mate decides he will take these shaders and rewrite them a bit, change the variable names, and layout a bit. He then puts it on the marketplace for $10, destroying Johnnys hard work and efforts.
     
    EvanSki likes this.
  17. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,405
    I mean, they can also just buy your thing and then write a replica to undercut you (ex).
    Or buy/download your thing and resell it as-is (ex).
    Or buy your thing and resell it at third-party stores that are slower to ban people while allowing quick payouts.
    Or even sell people access to a whole library of your assets (e.g. VK repeatedly declined to ban someone for doing so with my assets).

    Pre-compiling shaders isn't going to magically solve this problem with assets specifically.
    Also, this hypothetical shader is mining some sort of cryptocurrency, isn't it? For else it may be challenging to sell it without any competition.
     
    EvanSki likes this.
  18. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Yep, they could do all of that too. Although none of these scenarios are related to the OP are they? :)

    Pre compiling will 'magically solve' people taking your code as clear text.
     
  19. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    decompiling encrypted data doesnt
    give you readable usable code
     
    Lonewolff likes this.
  20. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Exactly.

    Funny how people really want to fight against protecting their own code.
     
  21. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    Thats still a good idea to do, just with this instance, you really dont need to, plus if your publishing on an online platform (like steam) they have DRM for it too, with anti-cracking
     
  22. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Won't GM games published on Steam still extract to the temp directory at runtime? Giving full clear text access again?
     
  23. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    you cant do anything with it though because "File is open in another program"
     
  24. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    I haven't got any Steam based GM games. But, usually you can copy files that are in use. Pretty sure that notepad wouldn't have any problems opening already in use files either. Either way, I am confident that I could gain access with out to much hassle.

    If you can point me in the direction of any free Steam GM games I am willing to give it a crack (no pun intended) to prove the point.
     
  25. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,713
    Write really smart code? If it's not human-readable, it's useless even if it's stolen :p

    From my experiences with buying marketplace code assets, investigating decompiler cases, and working as a professional maintainer of legacy code for 3 years... editing someone else's code usually is really difficult, even in the off chance it WAS written to be easily editable by someone else (like the marketplace assets allegedly were - some of the examples were definitely debatable on the "easy" part). If someone decompiles your stuff with a simple tool (rather than being a professional hacker that targets you specifically, which is unlikely and also means you've already lost), they're not likely able to make sense of how your code works... so they'll change assets and put stuff on top, but not be able to use any code that's not simple plug-and-play properly.

    So, what can you do to deal with that?
    • Don't make any of your code self-contained. Have it rely on other systems so that you always need to copy at least 2 scripts to do anything meaningful.
    • Don't document any of your code IN your code.
    • Use single-letter variable names wherever you can.
    • Generate all audio and graphics at runtime (e.g. use exclusively vector graphics and use an extension to play a custom music format from individual instrument samples)
    I mean, it's a lot of effort, but it's up to you to decide if it's gonna be worth it... (it probably isn't)


    Other things you can do is to put links to your official webpages and stuff in your game, so even IF your game is stolen, they just give you more exposure.
     
  26. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,632
    Is your intention to dissuade people from using a decompiled game's code or to torture anyone who's working on said game? :p

    I mean, sure, all of this is theoretically an effective way of making it as unbearable as possible to work with the source... but the complications resulting from this are more likely to make people abandon the project or - god forbid - post a help topic about it on the GMC. Don't do this to us. T_T
     
  27. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,713
    Well, since a decompilation potentially gives an assailant access to the same code you had in the source, the only failsafe way to make the code impossible for them to deal with is to also make it impossible for you to deal with... eggs and omelets and all that.
     
    IndianaBones likes this.
  28. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    388
    I want to put another comment here: Companies actually reveal part of their codes as "Open Source".

    To explain all of this, let's start with simple Universal physics rule : Under the very same conditions, if you push a ball 5 meters forward; you can put the ball back if you push the ball 5 meter backward. A hacker in this case would figure out the "very same conditions" to reverse engineer your game's code, eventually returns back to the point zero.

    In this century, the only known way to prevent any illegal interferences from users is to separate them from the "core mechanism". This is why pretty much all AAA companies implemented some sort of servers for In App purchases. Once a purchase is done, they check it in their servers and then they grant the prize. With that said, there are softwares that lets you access to RAM directly, meaning that you can alter variables outside of the programs. In 2010, I have used "Cheat Engine" and joined a Game Maker game and changed my speed from 10 to 100, which get caught from the Admin(Sorry man, had to try :))

    All in all, there is no 100% safe way. In the era where Playstation servers are hacked, iCloud(APPLE!) accounts are hacked and millions of photos are leaked and most secure servers are crashed within minutes; you have to adapt a way to survive amongst all the things.
     
  29. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    code your game in wingdings, problem solved
     
    Pizuar likes this.
  30. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,713
    You know, you can just change the font back to something legible...
    upload_2019-7-5_2-42-24.png
     
  31. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    Not if you dont kew how 2 spill
     
  32. NeutronCat

    NeutronCat Member

    Joined:
    Mar 9, 2017
    Posts:
    9
    Game streaming service is a way to actually keep people away from your code.
     
  33. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Or never release a game.

    Muwahaha! That will show them! :D
     
    EvanSki likes this.
  34. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    Decompile your own game so hackers wont be the first
     
    Pizuar and Lonewolff like this.
  35. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,442
    If you are worried about decompilation being an issue: I have a bunch of the GameMaker studio 2 source (obtained through illegal means but I'm not doing any harm please don't ban me I just wanted to know how to make plugins, perhaps if you would finally document it the world would be a better place).
    And yet YYG are still selling their software just fine.
    Having the source to something doesn't make you able to sell it. That's a whole other ordeal.
     
    EvanSki likes this.
  36. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Tell that to @YellowAfterlife, he has had heaps of fun with people re-selling his stuff, from what I understand.
     
  37. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,442
    Huh really?
     
  38. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,405
    Comically, people primarily attempt to re-sell my free assets - the stuff from the blog. Perhaps matter of quantity or accessibility
     
    Lonewolff likes this.
  39. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    3,442
    Oh right yeah. I had people sell my tutorial code on the market place. With the exact same comments from the video and all.
     
  40. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,713
    *facepalms* Geez, people of today. When I steal code, I always file off serial numbers before doing anyth- I mean, I'd never do something like that!!
     
    Lonewolff, EvanSki and GMWolf like this.
  41. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    580
    Fun fact there was a company i forget the name of that was hired by a company that i forget the name off to make like a spreadsheet program well a programmer hid a easteregg in it because his boss had a strict no easter egg policy but they sent a demo to the company and they replayed back that there demo was outdated and they had got a better version and no longer required them. The company was confused and asked to see it which the other company said sure. Well when they saw it it looks strangely similar to there demo. The programmer put in there cheat code for the easter egg and sure enough Sailor moon poped up with there company name and credit date.

    EDIT: my source for this story is from here ,so take that with what ever salt shaker you would like. Personally true or false its a cool story
     
    Last edited: Jul 6, 2019
    Lonewolff likes this.
  42. Gamebot

    Gamebot Member

    Joined:
    Jul 3, 2016
    Posts:
    182
    1. Make a game soooo incredible no one would never want to do such a thing to it. (OK it may help)
    2. Let them cheat. Create two files, encrypted to deter and a form of string files in which the player CAN get to. String files can be direct such as a .json or files that contain how to cheat. Of course if they do you can disable other options...until they figure that out.
     
  43. curato

    curato Member

    Joined:
    Jun 30, 2016
    Posts:
    415
    If I publish a game that people want to steal, I will consider that a victory.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice