Is it that easy to reverse-engineer a love2d game?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
YoungNeer
Party member
Posts: 115
Joined: Wed May 15, 2019 7:49 am

Is it that easy to reverse-engineer a love2d game?

Post by YoungNeer » Sun Jul 28, 2019 2:42 pm

Okay I have'nt tried this cause I don't think this might work (and even if it does I don't think I'm that dedicated to carry out the operation) but given some special reverse-engineering tools this may be possible. And some might point out that theoretically every-game can be reverse-engineered but the question is not that - the question is How easy is it to reverse-engineer a game

Given that the way a love file is converted to an executable file is pretty lame (atleast for Windows it is lame) and that is where reverse engineering can be done I believe.

Just like one catted the love file out and merged it with love executable, if the next persion knows which version of Love was the game written in then he can possibly "decat" it. I mean to say he can ignore the first n number of bytes of the executable where n being the size of that love executable (of the exact same version the game was written in) and then start reading the file from that point to the end. And then save the overall buffer to a new file which would be a zip file which on extracting will give the end user access to the source-code and all the game-assets that were used to create the Game.

Infact I don't think some-one needs to know what is n? Since zip files must start from some special header so we can basically ignore all the binary data of the executable until we find the one referring to the actual zip.

Okay I haven't tried this method myself (I just don't have enough time :cool:). So I want some lover to either try this method (not because I'm saying but out of his own curiosity :nyu: ) or assure me for 100% that this method won't work even if you use some fairly complicated reverse engineering tool. Currently I'm 60% sure that this method won't work because I have a bad history with reverse engineering. :crazy:

Anyways do comment and let me know what your thoughts are about this. Even if you may not know the answer - just write something on the reply. Currently the love2d community is in-my-opinion very in-active. (Like whenever I browse - mostly I'm the only person who's online which sucks and even I may get over 1000 views on some post I rarely get more than 10 replies which sucks even more :cry: )
Last edited by YoungNeer on Mon Jul 29, 2019 3:56 am, edited 1 time in total.
My Github- your contribution is highly appreciated

Nelvin
Citizen
Posts: 94
Joined: Mon Sep 12, 2016 7:52 am
Location: Germany

Re: Is it that easy to reverse-engineer a love2d game?

Post by Nelvin » Sun Jul 28, 2019 3:16 pm

Don't make it harder than it is ... your typical tools like 7zip (or even the builtin Windows zip support) happily finds and extracts the zip compatible part of the file - with 7zip you don't even have to change the suffix.

So yeah, it's a simply container format and so it's easy to access it's contents. That's great, you can easily browse releases from other devs and learn from how they built/organized their games.

There's very rarely a real good reason to make this any harder by Löve itself.

Almost all games made with Löve are small, simple and free anyway. The few commercial releases are typically no extreme hits, selling a few thousand copies at best - so no reason for anyone to "reverse engineer" it besides personal interest and why make it harder for those 20 users who probably also bought the game?

As far as I know, the only commercial hit done using Löve is Move or Die - I don't own it, so I can't say if the devs did some more work to hide/encrypt their work. But once you made such a successful game, it's not a huge problem to spend some more time and add whatever encryption you want, by yourself.

User avatar
zorg
Party member
Posts: 2732
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Is it that easy to reverse-engineer a love2d game?

Post by zorg » Sun Jul 28, 2019 3:41 pm

Executables have headers, while zip archives have footers, which means that the important bits are respectively at the start, and at the end of a file. Because of this, on windows, you don't need to do *anything*, just open the exe with an archiver like 7zip, and lo and behold, there's the whole game's contents for you to unpack. There is no need for anything more complicated, as Nelvin said.

Also, this topic was already talked to death, you're not the first to bring it up; invariably the end result is people reminding others that it's copyright that protects your work, not the latest cutting-edge DRM techniques or obscure processes one might implement.

Also, your premise about the community being inactive is false; forums are slow by design, though young people growing up with the ever-accelerating social net around them may not understand such a fact inherently (and yes, that's an assumption on my end)
Not that you should care about how many replies your thread gets; why even do you care? If you're sharing a lib, then that should be enough to know that people can check it out, and maybe use it.


That said, you might find the Official Löve Discord Server more active, so more to your liking.

Now, if i had the time, which i don't either, i would have linked all the topics that were discussing this topic, but since i (and others) did that for the last person who asked, i don't feel like looking it up again; you can use the forum's search feature.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
pgimeno
Party member
Posts: 1907
Joined: Sun Oct 18, 2015 2:58 pm
Location: Valencia, ES

Re: Is it that easy to reverse-engineer a love2d game?

Post by pgimeno » Sun Jul 28, 2019 4:07 pm

Actually this raises a slightly different topic.

The only way to prevent reverse engineering is through built-in encryption, which normally doesn't apply to desktop computers but has been tried in other platforms (e.g. the Wii). Even then, most of the existing commercially available systems have been hacked. But the goal has never been prevention of reverse-engineering beyond copy protection.

The big question is, what is there to gain from reverse engineering a game, besides possibly disabling copy protection?

Perhaps cheats and mods for a game - so what? Minecraft would be nothing without mods, for example. Cheats can be detrimental to online playing, yeah, so there's that, but for users who want to enjoy a game but find it far too difficult for their ability, they're a bless.

One other benefit I can think of is to get access to the method for accomplishing a certain special feature, that is so novel that no one has any idea of how to accomplish it. That's very unlikely to happen. The algorithm behind almost every feature in every game is well known and can be consulted on the internet, and in a few cases, the algorithms are patented, therefore they can't be used without risking a lawsuit.

Finally, you may be concerned about someone ripping your libraries for their own purposes. Well, if they use them to build a successful game, you have copyright law on your side; if they use them for their own private purposes, I don't see any harm in that.

User avatar
YoungNeer
Party member
Posts: 115
Joined: Wed May 15, 2019 7:49 am

Re: Is it that easy to reverse-engineer a love2d game?

Post by YoungNeer » Sun Jul 28, 2019 4:36 pm

Nelvin wrote:
Sun Jul 28, 2019 3:16 pm
Don't make it harder than it is ... your typical tools like 7zip (or even the builtin Windows zip support) happily finds and extracts the zip compatible part of the file - with 7zip you don't even have to change the suffix.
Wow that's *awesome*! Glad I made this post cause I didn't know any compressing utility was capable of doing that!
My Github- your contribution is highly appreciated

User avatar
YoungNeer
Party member
Posts: 115
Joined: Wed May 15, 2019 7:49 am

Re: Is it that easy to reverse-engineer a love2d game?

Post by YoungNeer » Sun Jul 28, 2019 4:49 pm

pgimeno wrote:
Sun Jul 28, 2019 4:07 pm
The big question is, what is there to gain from reverse engineering a game, besides possibly disabling copy protection?

Perhaps cheats and mods for a game .....

One other benefit I can think of is to get access to the method for accomplishing a certain special feature, that is so novel that no one has any idea of how to accomplish it. ...

Finally, you may be concerned about someone ripping your libraries for their own purposes.
You didn't talk about ASSETS - music,fonts, images, and all that. Generally speaking- In any game most of the time is spent on assets and the companies don't care much if some gets away with their source-code but they would go all red if someone were to steal their assets. Example? idGames uploaded their source-code for a lot of games but didn't upload assets for ANY. The markdown file on Github simply says something like - "The end user can buy the game and get the assets from it" or in other words 'The soure-code is free but Assets are not'. Cause source-code form the back-end and it's difficult to say "You stole the source-code from this" just by looking at the game but ofcourse it's easy to notice in case of Assets (be it music or images,models, whatever)

So if you can reverse-engineer a game to get the assets in it then IT IS A BIG DEAL.
My Github- your contribution is highly appreciated

User avatar
zorg
Party member
Posts: 2732
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Is it that easy to reverse-engineer a love2d game?

Post by zorg » Sun Jul 28, 2019 5:06 pm

Actually, it's relatively easy to check for stolen source code; it's kind of akin to how there are automated systems to tell whether some university students plagiarized their works or not... (specific pattern detection, etc.)

That said, as pgimeno said, unless the code was patented, nothing is lost if someone learns from it; if they just steal and plop it into their codebase, chances are it won't work anyway :P

As for assets, again, copyright protects your stuff. And what do you want to protect against? Others re-releasing your complete game, the assets from it (if so, for what reason?) or maybe to do a fangame or adapt them into a form you're personally and or morally not comfortable with? (3D character models come to mind, but even in those cases, it's not necessary to "steal" those models, to be honest...)
Bottom line would be that no one should risk you taking them to court, or they should stop for a simple C&D if you even find out about such a thing.

To me, it's really silly to worry about such things, especially before releasing a game even worthy of someone to steal. :o:

Edit: I wasn't able to find the thread i wanted to link, but here are a few others that talk about source code obfuscation and related things:
https://love2d.org/forums/viewtopic.php?f=4&t=84765
https://love2d.org/forums/viewtopic.php?f=12&t=83095
Edit2: I found it!
https://love2d.org/forums/viewtopic.php?f=3&t=85955 <- tons of backlinks to other threads already answering this.
Last edited by zorg on Sun Jul 28, 2019 8:20 pm, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
pgimeno
Party member
Posts: 1907
Joined: Sun Oct 18, 2015 2:58 pm
Location: Valencia, ES

Re: Is it that easy to reverse-engineer a love2d game?

Post by pgimeno » Sun Jul 28, 2019 8:18 pm

YoungNeer wrote:
Sun Jul 28, 2019 4:49 pm
Example? idGames uploaded their source-code for a lot of games but didn't upload assets for ANY. The markdown file on Github simply says something like - "The end user can buy the game and get the assets from it" or in other words 'The soure-code is free but Assets are not'. Cause source-code form the back-end and it's difficult to say "You stole the source-code from this" just by looking at the game but ofcourse it's easy to notice in case of Assets (be it music or images,models, whatever)

So if you can reverse-engineer a game to get the assets in it then IT IS A BIG DEAL.
Not really. If a company allows using the assets when you buy the original game, it means they can be obtained from it, which in turn means the assets are not copy-protected and there's no need for any reverse-engineering in the first place. Protecting the assets is seldom a reason to make reverse-engineering difficult. The main reason why it's done is copy protection. The assets are actually well protected by copyright laws. Copying a game illegally just to avoid paying for it is far more common than stealing and reusing assets, which makes the latter easier to pursue.

User avatar
YoungNeer
Party member
Posts: 115
Joined: Wed May 15, 2019 7:49 am

Re: Is it that easy to reverse-engineer a love2d game?

Post by YoungNeer » Mon Jul 29, 2019 2:04 am

i guess i will end this conversation here - zorg gave me a link to an older thread which was really useful. So i have got the answer i expected - Don't make a commercial game in Love!! And ofcourse others like "be ignorant of piracy" etc.
My Github- your contribution is highly appreciated

Nelvin
Citizen
Posts: 94
Joined: Mon Sep 12, 2016 7:52 am
Location: Germany

Re: Is it that easy to reverse-engineer a love2d game?

Post by Nelvin » Mon Jul 29, 2019 7:18 am

YoungNeer wrote:
Mon Jul 29, 2019 2:04 am
So i have got the answer i expected - Don't make a commercial game in Love!!
Huh, on what answers is this based? There's no reason for that, you just should not fear the virtually non existing problem of reverse engineering of your code/data first and foremost because nobody who aims to do anything harmful to you will care if you don't have a highly successful game already.
And chances for a hit are just extremely small these days and as long as all you do is make generic, tiny games ... you're mental energy is way better spent on more productive topics.

Also to name Move or Die again, it's commercial, very successful (it's probably roughly at about 4-500k sales on Steam) and it's even ported to the PS4 (by actually porting Löve to the PS4).

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests