Hi, I'm curious about what user Margin posted above in another thread.Marqin wrote: ↑Sat Oct 22, 2016 9:16 am
There is one half-good way for protecting game sources (but it won't protect strings, like text told by characters)
1. Write all your VN logic as python module
2. Import that and use in your VN (documentation)
3. Use Cython or Nuitka to compile that python module to C code
4. For each platform/operating system you release, compile that C into .so/.dll and package it with your game
That way it won't be easy(but still possible) to steal your scripts (eg. minigames/logic),
because for that someone will have to know assembly and python's C api calls.
I'm looking to protect source code from .rpa extractors on Github.
Nowadays, pretty much anyone without coding knowledge can just extract any Ren'Py game and see the source code.
I feel it's this type of individual who would be keen on stealing a game's source code, swapping assets, and releasing a clone.
A real hardcore hacker who knows "assembly and Python's C api calls," could easily make their own games.
So, I'm more concerned about the casuals who would be eager to steal.
Since the games I make are not Visual Novels, they are heavy in terms of mechanics.
I would like to protect the source from being stolen and reused in other games.
Note that it is much easier to protect images, and text, in terms of pursuing copyright infringement in a court of law.
They are easily recognizable even by gamers.
It's not so easy to prove that someone stole source code. Therefore it's up to us as developers to protect our source code. Unfortunately, Ren'Py doesn't provide tools for us to do this. We cannot easily choose a unique encryption key, for instance, that would render .rpa extractors on GitHub useless.
This is why Margin's post above caught my attention.
I have a few questions regarding Margin's proposed methodology:
1) For Windows: Is it as simple as using 'import (module_name)' in an init python block in a Ren'Py script, or do I need to do anything special like using 'ctypes' to load the DLL into memory once the code is in .dll format?
2) Mac OS X doesn't use DLLs. However, .so should work for both Linux and Mac. Same question as above: Do I need to do anything special in the code itself to load the protected functions into memory once the file is in .so format, or is it as simple as using 'import (module_name)' in an init python block in a Ren'Py script?
3) IF it's not as simple as using 'import (module_name)' in an init python block, then can you provide specific examples of how I can use the .so / .dll for Windows / Linux / Mac?
4) Android is packaged as a .apk. Is it as easy to unpackage a .apk file to view source code as it is to unpackage .rpa files using extractors on GitHub? If so, how do I protect a .apk using the .dll method (or equivalent of a .dll for Android, if such a thing exists)?
I'm not really interested in releasing for iPhones. However, I am interested in releasing for mac OS X, as per question #2.
Any help with this is really appreciated.
Edit: I already know that nothing is 100% hack-proof. My goal is to deter people who only know how to use Ren'Py extractors from GitHub to access the source code. I feel this would prevent at least 80% of potential casual assailants, while allowing me to protect my game through softer DRM measures, such as constant updates. If it takes a lot of work to crack it every time, this would ultimately deter someone from cracking every updated version of my product, and it would allow me to grow my playerbase before a cloned copy hits the market. I am not worried about cracked versions of my game. I am worried about someone easily stealing my source code and using it in their own game. At least if it is difficult enough that a versatile coder is needed, such a person could already make their own games and wouldn't have to steal code (wouldn't want to steal code, as generally such skilled people take pride in their skills). I hope this clarifies my intent.