How to Protect a Resulting .Exe?

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
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: How to Protect a Resulting .Exe?

Post by Puzzlem00n »

How on earth did this get back on the top... This question was answered months ago.

Anyway, Omar has an interesting idea with the assets thing and custom binary. It would be cool if you could make that work!

I was reading a lot of stuff on DRM the other day, and apparently, many studies show that you're more likely to stop piracy if you don't prevent it. People are more likely to pay for something if it doesn't have any annoying security measures in the first place. I wonder if games would make more if the money paid is treated more like a donation for a free product.
I LÖVE, therefore I am.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: How to Protect a Resulting .Exe?

Post by Robin »

Hiding assets has exactly the same problems as hiding code:
OmarShehata wrote:One way to encrypt art assets off the top of my head would be to add some jumbled binary data in the middle of all your assets, that you would remove before using the images, and save it as your own extension, such that anyone trying to open the files won't know how to open them.
One line of code, 's all you need: after de-jumbling, save the image data to a file.

Besides, you can always capture the output of images and sounds.

A better way to prevent people from ripping you off might be to show yourself: make it clear you are a human, an individual just like your users and not a faceless company. People tend to have moral qualms about stealing from people they see as individuals just like them.
Help us help you: attach a .love.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: How to Protect a Resulting .Exe?

Post by Lafolie »

Robin speaks the truth. 's the old Robin Hood effect.

DIdn't realise the pun until after I read that. D'oh.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Noktai
Prole
Posts: 7
Joined: Tue Sep 11, 2012 2:25 am

Re: How to Protect a Resulting .Exe?

Post by Noktai »

I've seen some love games submitted to steam greenlight, did you try some sort of protection?
I wouldn't really feel comfortable with all my source code and assets exposed to such a large base of users.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: How to Protect a Resulting .Exe?

Post by qaisjp »

OMG seriously easy!
Firstly (optional), obfuscate your code (when you release it, keep clean-source version on your HDD). (This speeds the game up, if you do it correctly)
Secondly (important), in all your lua files, add this to your first line:

Code: Select all

iHateDecompilers = {{{{{{{{42423423,{34},{{{{{{{{}}}}}}}}},{}},{}},{}},{}},{}},{}} -- this is probably got some problem in syntax but you can fix it
Thirdly (important), compile your lua code using LUAC.exe (This speeds the game up). (The above code will prevent decompiling because it confuses the decompiler(luadec) )

Then test the Love game to see if it works (the code won't be readable)
Then you can make it into the exe normally.


For images you can edit the image using Notepad and to use it you just read from the file, remove the edit using the algorithm you used and then do love.graphics.newImageData

This has been done before, however I cannot show you we used to achieve this as I would be in very big trouble for releasing our images (people would keep stealing the assets, we prepared a recipe for them)
Lua is not an acronym.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: How to Protect a Resulting .Exe?

Post by coffee »

iHateDecompilers = {{{{{{{{42423423,{34},{{{{{{{{}}}}}}}}},{}},{}},{}},{}},{}},{}}
<shocked>wait, what?</shocked>

Are you joking right? There is some technical basis to this work? "sauce" please!
User avatar
verilog
Citizen
Posts: 97
Joined: Thu Nov 03, 2011 3:15 am
Contact:

Re: How to Protect a Resulting .Exe?

Post by verilog »

Code: Select all

iHateDecompilers = {{{{{{{{42423423,{34},{{{{{{{{}}}}}}}}},{}},{}},{}},{}},{}},{}} -- this is probably got some problem in syntax but you can fix it
I too, share coffee's surprise and kindly request the technical justification of this, if available.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: How to Protect a Resulting .Exe?

Post by kikito »

Noktai wrote:I've seen some love games submitted to steam greenlight, did you try some sort of protection?
I wouldn't really feel comfortable with all my source code and assets exposed to such a large base of users.
I would say that the most efficient solution to your problem is ... not technical, then. Make an effort not to feel that way.

The encryption path only brings pain and madness.
When I write def I mean function.
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: How to Protect a Resulting .Exe?

Post by qaisjp »

verilog wrote:

Code: Select all

iHateDecompilers = {{{{{{{{42423423,{34},{{{{{{{{}}}}}}}}},{}},{}},{}},{}},{}},{}} -- this is probably got some problem in syntax but you can fix it
I too, share coffee's surprise and kindly request the technical justification of this, if available.
Well, luadec decompiles Lua code compiled.
Creating one variable with a weird table structure (as above) confuses the decompiler, and crashes it...

I spent a good 10 minutes making this for you, drag clean-vulnerable.lua to test.bat and continue with the process. Then check decompiled.lua and compiled.lua
Do the same thing for clean-unvulnerable.lua to see it.

The bat file will explain to you what is happening, first it compiles the lua file, then attempts to decompile it, and then it runs the .lua file to show you that it gives the same output...
decompiler_example.zip
(788.7 KiB) Downloaded 117 times
Lua is not an acronym.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: How to Protect a Resulting .Exe?

Post by coffee »

qaisjp wrote:
verilog wrote:

Code: Select all

iHateDecompilers = {{{{{{{{42423423,{34},{{{{{{{{}}}}}}}}},{}},{}},{}},{}},{}},{}} -- this is probably got some problem in syntax but you can fix it
I too, share coffee's surprise and kindly request the technical justification of this, if available.
Well, luadec decompiles Lua code compiled.
Creating one variable with a weird table structure (as above) confuses the decompiler, and crashes it...

I spent a good 10 minutes making this for you, drag clean-vulnerable.lua to test.bat and continue with the process. Then check decompiled.lua and compiled.lua
Do the same thing for clean-unvulnerable.lua to see it.

The bat file will explain to you what is happening, first it compiles the lua file, then attempts to decompile it, and then it runs the .lua file to show you that it gives the same output...
decompiler_example.zip
Since I'm @ OSX didn't test it. I suppose you take advantage of some buffer flaw of luadec. But remember that luadec is not the only decompiler around.
http://lua-users.org/wiki/LuaTools
Post Reply

Who is online

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