Protecting Source?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Protecting Source?

Post by Sparx » Thu Apr 02, 2009 12:38 pm

Hi there,

is there a possibility of protecting the source of a game made with LÖVE?

User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Protecting Source?

Post by bartbes » Thu Apr 02, 2009 12:41 pm

You can compile them to some bytecode (using luac from the lua package), but the question is how safe that is.., but generally speaking there is no effective way.

osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Protecting Source?

Post by osuf oboys » Thu Apr 02, 2009 12:54 pm

Could also make a program that takes the source and produces something horribly obscure.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.

User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Protecting Source?

Post by bartbes » Thu Apr 02, 2009 12:56 pm

Or you can download the source everytime you start, but I don't think that's practical.

User avatar
Gerrit
Prole
Posts: 46
Joined: Wed Mar 25, 2009 7:40 pm

Re: Protecting Source?

Post by Gerrit » Thu Apr 02, 2009 1:13 pm

bartbes wrote:You can compile them to some bytecode (using luac from the lua package), but the question is how safe that is.., but generally speaking there is no effective way.
That would be the best way and 95% of the people who would be interested won't try to do anything about it. The last 5% may try do decompile it. But you can decompile almost anything. There's no 100% safe thing.
bartbes wrote:Or you can download the source everytime you start, but I don't think that's practical.
That would be a bad idea because the source has to be saved somewhere. At least in RAM which you can read out with a program. If you do it encrypted there's the point where you have to encrypt it (to use it yourself) to RAM and you can read it out there again.

Short: Use LUAC to make it safer. There's no 100% protection and there won't be (ever). If you protect it better there will be more people attracted to it (to crack it). So keep it simple ;)

osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Protecting Source?

Post by osuf oboys » Thu Apr 02, 2009 1:32 pm

That would be a bad idea because the source has to be saved somewhere. At least in RAM which you can read out with a program. If you do it encrypted there's the point where you have to encrypt it (to use it yourself) to RAM and you can read it out there again.

Short: Use LUAC to make it safer. There's no 100% protection and there won't be (ever). If you protect it better there will be more people attracted to it (to crack it). So keep it simple ;)
Obfuscating does not mean during run-time or encryption. The obfuscated code should work as it is, just doing plenty of unnecessarily complicated and nonsensical things. The code could certainly be worked out but it would take plenty of time, sort of like working out what a program does where from reading the assembly code.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.

User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: Protecting Source?

Post by Sparx » Fri Apr 03, 2009 10:44 am

Perhaps i could just encrypt the zip-file with a password and then loading it into LÖVE via a CLOSED-SOURCE library integrated in the compiled LÖVE binary?

User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Protecting Source?

Post by appleide » Fri Apr 03, 2009 10:54 am

If you open binaries as plain text you can see their strings. Then look for the password. ;)

Could also decode the binary file to assembler. Since all your program does is feed the password to the zip file to open it, it shouldn't be too complicated. You'd need to deliberately obfuscate it.

On some systems you can keep malloc(...) and see the contents of used memory. So after shutting down the closed source lib you could repeatedly run malloc and reading contents until you find string likely to be password.

I learnt all this in uni lectures. ^^ Fun turning up to class.
Last edited by appleide on Fri Apr 03, 2009 10:58 am, edited 1 time in total.

User avatar
Gerrit
Prole
Posts: 46
Joined: Wed Mar 25, 2009 7:40 pm

Re: Protecting Source?

Post by Gerrit » Fri Apr 03, 2009 10:56 am

Sparx wrote:Perhaps i could just encrypt the zip-file with a password and then loading it into LÖVE via a CLOSED-SOURCE library integrated in the compiled LÖVE binary?
That would be possible. Although you have to save the key in the binary then which means that I could just decompile the orginal Löve binary, then yours and look at the differences. And in a couple of minutes I should find the key :) As I said: there's NO solution to protect your source 100%. You can only make it harder for those that are interested. Since you need to know assembler after compiling to LUAC there shouldn't be many people left ;)

PS: appleide was a bit faster then me..

User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: Protecting Source?

Post by osgeld » Fri Apr 03, 2009 3:33 pm

i thought luac would leave the source script in the comments

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests