Page 1 of 4

Game Obfuscation

Posted: Thu Jun 13, 2013 3:20 pm
by Davidobot
Is there any way to obfuscate an exe, so that it can't be accessed via a programm like 7-Zip?

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 3:31 pm
by micha
There is not technical way to do that with LÖVE. But a legal one: In your license you can forbid people to read your code.

And here is the standard question that comes up in this kind of discussion: Why would you want to do that?

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 3:44 pm
by Davidobot
Well if you were to develop a multiplayer game, hacking into the source code and using the modified game might ruin the experience for other people.

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 4:00 pm
by Przemator
Davidobot wrote:Well if you were to develop a multiplayer game, hacking into the source code and using the modified game might ruin the experience for other people.
Yes, I was thinking about it. Who cares about licensing in such situation. You are not going to chase people who edit the souce code in order to cheat online. Is there a way to prevent trivial online cheating in LOVE?

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 4:12 pm
by Inny
To save some time: you basically can't. Once you've given software to someone, they have a very wide arsenal of ways to inspect and manipulate the code. If you want to make a multi-player game where players can't cheat, you need to write server-software that incorporates verification of actions to make sure they conform to the rules.

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 4:23 pm
by Robin
See my post in a related thread. Making your game hidden sourced does nothing to prevent cheating. Your players might as well have written your game themselves, in a way. Moving as much of your code as possible to the server is the first thing you can do that will at least moderately slow down cheaters. After that, all you can do is inspect packets and try to find out cheaters that way.

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 6:52 pm
by Davidobot
Robin wrote:See my post in a related thread. Making your game hidden sourced does nothing to prevent cheating. Your players might as well have written your game themselves, in a way. Moving as much of your code as possible to the server is the first thing you can do that will at least moderately slow down cheaters. After that, all you can do is inspect packets and try to find out cheaters that way.
Moving everything to the server will put a lot of stress on it and delay the response time if you validate everything.

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 8:56 pm
by Plu
If you desperately want to block cheaters and validate every command, but don't want to get the loss of responsiveness that constant server communication gets you, the easiest fix is to run the code on both sides. You let the player run his own program, but you validate all his inputs on the server as well. You don't send anything back by default, but if you notice a cheat happening on the player side, you just disconnect his session and he won't be able to update his score at the end.

Re: Game Obfuscation

Posted: Thu Jun 13, 2013 11:46 pm
by Deltise
You could run through your code, make 2 copies of the game, and then make all your variables and function names miscallaneous numbers and letters, and in a second copy use comments to annotate which function is which so that you may edit your 'encrypted' code with a bit more ease.

Changing your variable names into less generic ones like: player.health to zXcVb26.4al567
where zXcVb26 would mean player and 4al567 would mean health.

Making your code a bit obscure could discourage hacking from mediocre exploiters

Re: Game Obfuscation

Posted: Fri Jun 14, 2013 1:57 am
by Inny
Deltise wrote:You could run through your code, make 2 copies of the game, and then make all your variables and function names miscallaneous numbers and letters, and in a second copy use comments to annotate which function is which so that you may edit your 'encrypted' code with a bit more ease.

Changing your variable names into less generic ones like: player.health to zXcVb26.4al567
where zXcVb26 would mean player and 4al567 would mean health.

Making your code a bit obscure could discourage hacking from mediocre exploiters
I would not recommend anyone try doing that by hand.

Doing it automatically, however, is called Obfuscation, which there has been a lot of talk of it on this forum (like here which is the first thing I found).