Game Obfuscation

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Game Obfuscation

Post by Davidobot »

Is there any way to obfuscate an exe, so that it can't be accessed via a programm like 7-Zip?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Game Obfuscation

Post 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?
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Game Obfuscation

Post 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.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Przemator
Party member
Posts: 107
Joined: Fri Sep 28, 2012 6:59 pm

Re: Game Obfuscation

Post 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?
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Game Obfuscation

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Game Obfuscation

Post 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.
Help us help you: attach a .love.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: Game Obfuscation

Post 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.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Game Obfuscation

Post 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.
User avatar
Deltise
Prole
Posts: 26
Joined: Sat May 18, 2013 7:23 pm

Re: Game Obfuscation

Post 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
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Game Obfuscation

Post 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).
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests