Page 1 of 2

[Utility] Love Compiler

Posted: Mon Feb 02, 2015 10:28 pm
by TheMayoMurderer
I have created a simple tool for turning a single Love source file into portable bytecode.
Details on how to use it are in lovecompiler_readme.txt.
This is not the compiler's final form, and will evolve based on your requests. So if you have any suggestions, fire away!
Enjoy!
- TheMayoMurderer

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 3:40 pm
by lost_RD
I compiled an asteroids demo I had lying around - no idea whose it is, sorry author - and it worked like a charm.

So is this the be-all-and-end-all of source code obfuscation? Can we commercialise our games now?
space.love
Original version
(3.82 KiB) Downloaded 634 times
space.love
Bytecode version
(1.63 KiB) Downloaded 658 times

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 3:45 pm
by TheMayoMurderer
lost_RD wrote:I compiled an asteroids demo I had lying around - no idea whose it is, sorry author - and it worked like a charm.

So is this the be-all-and-end-all of source code obfuscation? Can we commercialise our games now?
I'm glad it worked well for you :)
This isn't the compiler in its final form, and I have many more features planned - support for multiple source files, a GUI, etc.
If there's anything you'd like to see in Love Compiler, please either comment here or message me, and I'll see what I can do :)

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 3:56 pm
by lost_RD
TheMayoMurderer wrote:This isn't the compiler in its final form, and I have many more features planned - support for multiple source files, a GUI, etc.
Of course, I agree that all is good and worth doing, what I'm asking is whether the problem of obfuscating an interpreted game is solved as much as it can be? Will our source codes ever be more safe than the output in your compiler? Could somebody reverse your process?

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 5:04 pm
by TheMayoMurderer
Of course, I agree that all is good and worth doing, what I'm asking is whether the problem of obfuscating an interpreted game is solved as much as it can be? Will our source codes ever be more safe than the output in your compiler? Could somebody reverse your process?
My compiler uses LuaJIT's string.dump() extension, which converts a function's procedure (the code inside the function) to portable bytecode. The bytecode can then be run directly as a procedure, or loaded back into a function. My knowledge goes pretty much as far as that when it comes to compilation and bytecode.
I'm sure - as with any bytecode - there's a way to reverse-engineer it. It's not impossible that someone would be able to access it. Think of it this way; the license is a friendly sign saying "please don't enter my garden". It's more legal obligation than an active barrier. Compiling your code to bytecode is the razor wire fence; it's something that actively stands in the way of someone doing something you don't want them to do.
It's still possible to climb over the razor wire fence. I imagine anyone with a high enough ladder could do it. What it does is make it difficult to climb over, so that fewer people will try, and fewer yet will be successful.
TL;DR: bytecode can be reverse-engineered. However, whereas a license says "don't do this", compiling the source to bytecode actively stands in their way.

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 6:10 pm
by Duster
Very nice. As someone who gets very self conscious about his code, I'm looking forward to seeing more from this. :)

Re: [Utility] Love Compiler

Posted: Tue Feb 03, 2015 6:53 pm
by Robin
lost_RD wrote:Can we commercialise our games now?
You already could, and some already have.

Your source code is not the most important asset of the game.

Re: [Utility] Love Compiler

Posted: Wed Feb 04, 2015 3:19 am
by josefnpat

Re: [Utility] Love Compiler

Posted: Wed Feb 04, 2015 11:11 pm
by Rickton
I don't get why people are so scared of the source code being accessible. It's not like something being closed-source is any harder to pirate. What exactly do you think people are going to do with the code?

The one legitimate reason I could see to worry would be with a multiplayer game, you might not want the source code to be very accessible because it'd be easy for people to cheat. But if you're that worried about it, there should probably be other anti-cheating mechanisms in place, like many multiplayer open source (and closed source) games have.

As a side note, Minecraft is apparently pretty easy to decompile to source (it's how a lot of the more in-depth mods were/are made), and it doesn't seem to have prevented them from making millions of dollars.

Re: [Utility] Love Compiler

Posted: Fri Feb 06, 2015 10:22 pm
by NightKawata
Rickton wrote:I don't get why people are so scared of the source code being accessible. It's not like something being closed-source is any harder to pirate. What exactly do you think people are going to do with the code?

The one legitimate reason I could see to worry would be with a multiplayer game, you might not want the source code to be very accessible because it'd be easy for people to cheat. But if you're that worried about it, there should probably be other anti-cheating mechanisms in place, like many multiplayer open source (and closed source) games have.

As a side note, Minecraft is apparently pretty easy to decompile to source (it's how a lot of the more in-depth mods were/are made), and it doesn't seem to have prevented them from making millions of dollars.
Considering that helps Minecraft more than hurt it.
Personally, I think you're kind of beating a dead horse with bytecode compilation, but I can see why people would want to do it. If it makes you feel safer, feel free.

Moreover licensing is what protects your game.
Think of it this way. If someone wants to break your game, they will break your game. That's just how it is.

For multiplayer and the like, server-side protection is indeed a thing, so are anti-cheat detections.
On a more relevant note: Kudos for the author for creating this. Definitely a tool people could use if they wanna try bytecode compilation.