Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Game.exe detection script

Hi there,

i'm trying to protect my game.exe. Right now it gets simply replaced by a different exe. from others to access it. :sad:
I've heard that the best RPG Maker users are on these forum, i would be really happy if someone can help me a little bit.
 
Why do you not want people copying in their own Game.exe?

If you are worried about the debug features, you can manually disable them in the script.

Put this in the first line of the main script
Ruby:
$DEBUG = false


If you definitely want to check if they are using your own Game.exe, you will need to produce a custom Game.exe that does a signing check with your RGSS script;

script Main -> $SIGN = 123
Game.exe -> Does $SIGN exist? No: Quit, Yes: $SIGN = 321
script Scene_Title -> Does $SIGN equal 321? No: Quit, Yes: Signing completed
 
Because they are destroying the DRM by replacing the .exe file. It's not about the debug feature.
I need to make the game only playable through the official .exe file.

Edit:
Thank you for your answer. :)
I managed to get the check working inside RGSS but i've problems with the game.exe check
The interface of visual studio is new to me and i'm quite overwhelmed at the moment.
 
One thing you could do is check the CRC of game.exe. It won't be a foolproof check, but it will stop a good number of folks.

But in all honesty, your DRM will be broken. It always does, and always will be. All you can do is hope to prolong when that happens.
 
Yeyinde":38pz0yqx said:
One thing you could do is check the CRC of game.exe. It won't be a foolproof check, but it will stop a good number of folks.

But in all honesty, your DRM will be broken. It always does, and always will be. All you can do is hope to prolong when that happens.

I know. I've announced to make the game free when it hits v 1.0. It's just that i wanted to collect some money for art during the beta.

I've used http://steamcommunity.com/sharedfiles/filedetails/?id=211409091 to create a custom exe and got the $SIGN check working inside RGSS
but i have no idea where to place the check inside the custom exe and what to write. I would be endlessly happy if someone could help me with that.
 
Well this is embarrassing.

You can use the Eval function in the Game.exe code to run some Ruby, so before GameMain you can set the $SIGN variable using Eval.

C:
<div class="c" id="{CB}" style="font-family: monospace;"><ol>Eval( "$SIGN = 1234" )

Then in your Ruby code you just need to check that the $SIGN variable is set to the random number you gave it;

Ruby:
if ( !defined $SIGN || $SIGN != 1234 )

    # Quit the game, the sign variable does not exist or does not equal our random number

end

As Yeyinde said (He is an expert in these things!) people will still be able to break the signing if they are clever, they can either inspect the Game.exe to find the key and make their own with the same key or (Even easier) decompile the RGSS and go into your scripts and check what value the key is being checked against (And make their own Game.exe with that key).


With RPG Maker security isn't the focus at all, so you don't have many options in this.
 
My advice, if you have the abilities, would be to use a DLL for some major feature of your game - and there, in the DLL, which gets compiled to assembly (can become MUCH harder to crack than rubyside), do some checking, and don't tell anyone specifically what gets checked. Still not impregnable, but should rule out anyone without more advanced debugging skills. I would add multiple checks, things like Game.exe's checksum, or the like. Could also add a DLL feature to read a file from inside a password protected archive, to protect your content (select an archive format with a decent encryption).

The only sure-fire(ish) DRM would be an authentication server that has control over some part of the gameplay experience which can be denied to people who bypass it.

All of these things require more knowledge than a typical RM user, but your request is, as Xilef said, outside the scope of RM's featureset. You have a custom executable with DRM already - so I assume you are packing the tools to handle such things.
 
A DLL dependency would be an even easier option if you don't mind shipping around an extra file, if you're having difficulty do the DLL dependency, that way it doesn't matter what Game.exe they use (Which is how I think it should be), your DLL would always be required by RGSS so you can do all your DRM there.

If custom Game.exe with hacks is your concern, just remember that someone can make a custom DLL between any Game.exe and the RPG Maker RGSS runtime, if they wanted to hack it then they will find a way, just remember to not upset your customers with any obnoxious systems that have nothing to do with the game itself.
 
The biggest issue that I can see with this is the "extractor" replacement exes. You drop them in, and they dump all the content/scripts from the game. Thats why I was pointing out that instead of simply "DRMing" in a DLL, you'll want the DLL to be capable of withstanding a simple extractor swapin - that is, give it control of something that your scripts don't have, such as a feature that it can refuse to provide, rather than a simple callback which can be snipped out and leave you back where you started.

The "security" of the rgssad, or the Game.exe, is entirely compromised. The only way to secure your game is to move part of it out of both of those, into, say, a DLL as suggested above, or a Java archive (which I did recently; still compromisable but requires an additional skill set on top of familiarity with rpg maker products), or better yet: something else entirely.

Just don't forget that the best DRM of all is the alternative to DRM- making people WANT to, rather than HAVE to, support you.
 
brandos":29z4xb6e said:
When i try to add Eval( "$SIGN = 1234") at the start of the main.cpp i can't release the exe. A bunch of error appears.
That's because you know nothing about C/C++, it needs to be inside a method and it needs to be the correct function name, I don't know what you called your Eval function, if you copied my tutorial it might be something like Eval_f, however it needs to be called after the pointer is set, like I said the best place to do this is before the game start.

Find the gamestart call, it passes something like argv argc as it's parameters, the line before that is the last change to do your Eval() call.

Do reflect on what avarisc suggested with DLLs, it may be a much better, simpler, easier, quicker, safer option for you depending on your needs.
 
Thanks for the help. I'm not a programmer, i'm just doing this for more like a hobby. I don't even know how to create or access a DLL, yet to make one important.
Also i feel like i'm sooo close to the goal of getting the custom.exe run with the check. I've put the call here and it released with success but when i launch the game with it
the same happens as if i start it with a different exe.

sLwWQqN.png
 
Okay, to save you a headache I modified the source code so it's easier for you to do the eval, I even set up a variable called $KEY that is set to 123

Downloady: xiGame Key.zip

You can then do this in your main:
Ruby:
 

if $KEY == 123

  rgss_main { SceneManager.run }

end

 

So then it will only work if the exe has set the key variable at the start.

Please keep in mind what we said, anyone can decompile your game, look at the script, find the key and write a new hacked Game.exe, it's not fool-proof at all.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top