Game Development Community

TGB Executable and DRM

by Steve D · in Torque Game Builder · 08/09/2010 (5:48 pm) · 6 replies

Hi all, I'm going to use Software Passport to wrap a simple key based DRM system on my game using the latest version of TGB. It occurred to me when someone downloads the timed demo all they have to do is replace the TGB exe with a "generic" version (let's say from the TGB demo) and they will have the full version of the game available. My game is written entirely in script so I'm guessing I would need a way in script to make sure a particular exe is being used as opposed to a generic one. Any ideas?

#1
08/09/2010 (6:21 pm)
I'm not sure I understand, why would someone be able to replace your TGB.exe with a generic TGB.exe to access the full game?

If your game is entirely in script and you haven't made any changes to the engine then changing exe's shouldn't matter at all.
#2
08/09/2010 (7:04 pm)
I would add something minor to the executable to make it "yours". Here's a couple of easy example I can think of:

In console/consoleFunctions.cc, change the exec() ConsoleFunction. Make is so that if the filename is "foffy.cs", it instead looks for "player.cs". This is a simple 2 line change:
Where is says
Con::expandScriptFilename(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);
replace it with
if( dStricmp( argv[1], "foffy.cs" ) == 0 )
  Con::expandScriptFilename(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), "player.cs" );
else
  Con::expandScriptFilename(scriptFilenameBuffer, sizeof(scriptFilenameBuffer), argv[1]);

The other idea is to take a simple function and simply add it to the engine. Let's say you have a function that negates the X-value
function t2dVectorFlipX( %vec )
{
  %x = getWord( %vec, 0 );
  %y = getWord( %vec, 1 );
  return (-%x) SPC %y;
}

Just add a function (in this example) to T2D/t2dVector.cc that does the same:
ConsoleFunction( t2dVectorFlipX, const char *, 2, 2, "(t2dVector v1$) - Returns <-x, y>" )
{
  F32 x, y;
  dSscanf( argv[1], "%f %f", &x, &y );
  char *pBuffer = Con::getReturnBuffer( 64 );
  dSprintf( pBuffer, 64, "%f %f", -x, y );
  return pBuffer;
}

All it really takes is a tiny change to the engine to make it "yours" and thereby by-pass this specific issue.

One word of advice... if your game is crack-worthy, it will be cracked. Even DRM which runs code on a centralized server has been hacked. At least by making a small change to the engine, you'll discourage the casual hacker.

Let me know if you need help with a specific example. Good luck!
#3
08/09/2010 (7:14 pm)
Thanks William, I will take a look and try those things. And yes I totally hear you on the "it will be cracked" part but I'm not going to spend $300 for DRM software when someone can simply copy the executable from the TGB demo to negate it.
#4
08/09/2010 (11:04 pm)
Steve,

Just another thought on the matter... the 'casual pirate' will not even think to replace it with the TGB demo exe... they'll just google "Yourgame Torrent" or "Yourgame Crack" and be pointed to the 1000's of sites that have it.

The only people who would think to swap exe's would be torque developers. Given once the full version is uploaded with the new .exe, the work is done -- but it won't take a cracker much more time to break Software Passport than it would take a dev. to swap the .exe's.

That all said, William's suggestion is certainly an awesome easy way around this issue. I hadn't even considered it (since we're not doing our own DRM) but we've changed little things (like .zip to .dta in the resource loader) that would render this issue harmless. Good times.
#5
08/10/2010 (2:20 am)
Tim, I totally hear ya but to be honest I would feel quite dumb for purchasing DRM software only to have someone swap out an exe to defeat it. I'm sure my game will be cracked, copied and pirated but I still feel better if I close an obvious "loop hole".
#6
08/10/2010 (4:02 am)
Ooh! I like changing .zip to .dta. It's a perfect way to hide the fact the files are really just ".zip"s to the casual user.