License system for a package lazarus / 21-General ---------------------------------------------------------------------- aydın · 2023-07-18 18:42 I am working on a package and I want to protect it with licensing system. But how can I do this to a package? I thought about putting the licensing system in the Regisrty method of the package but it can be bypassed very easily. I need help with this, thanks in advance for your help. ---------------------------------------------------------------------- lainz · 2023-07-18 22:15 Pirates are pirates and will pirate your package anyway. Better try to make a good website to sell your package. Just my opinion. ---------------------------------------------------------------------- wp · 2023-07-18 22:30 TurboPower OnGuard contains some components simplifying creation of license numbers, test periods etc. It is available via OPM or Lazarus CCR (https://sourceforge.net/p/lazarus- ccr/svn/HEAD/tree/components/onguard/, use svn or get the zipped snapshot). Documentation at http://download.sourceforge.net/tponguard/tponguard_docs.zip But lainz is right: it probably does not protect you from being pirated. ---------------------------------------------------------------------- loaded · 2023-07-19 10:53 Years ago I saw a different implementation in VB6. Converting vb6 typed code( I don't know how !!!) Gets text that looks like BASE64 (binary data I guess). While writing a program elsewhere, the text above is loaded into memory either through a variable or directly. Now the functions inside can be called (only the coder can know this, or you can know as much as he tells you.) (I'll look at my archive and if I can find it, I'll post it here.) I don't know if such a thing can be done in Lazarus, but if it did, I think the process you want could be done easily. ---------------------------------------------------------------------- aydın · 2023-07-19 18:20 I will research what you have written. Thank you lainz, wp and loaded. ---------------------------------------------------------------------- CharlyTango · 2023-07-21 08:05 Quote from: aydın on July 18, 2023, 08:42:35 pmI am working on a package and I want to protect it with licensing system. Since Lazarus currently does not support dynamic packages I see no way to effectively protect a package. To include packages the sourcecode is needed which is compiled and linked directly into the IDE. If a package is really valuable for me then I always want to have the sourcecode. This is what I did when I used Delphi and of course I paid for it. A useful package will always find donors or customers. I have experimented with OnGuard in Delphi times. It works, but the real sticking point is the effort for the (clean automatic) licensing which was then out of proportion. ---------------------------------------------------------------------- KodeZwerg · 2023-07-21 08:18 Agree above, better spend time to create a nice website to offer your work instead wasting time to create something that next black sheep hack or crack. There are a lot of people out there that support free available source by donating, patreon buymeacoffee paypal etc... ---------------------------------------------------------------------- Warfley · 2023-07-21 10:03 The only way you can protect your code is by not delivering it to anyone, e.g. by hosting it on a server and only authenticated customers can access that functionality. This of course only works for end user programs easiely, where you just manage access of each user individually, but of course for a package, where the package customers are the distributers of the solution in the end, and with the architecture of Lazarus requiring the source, this will not work. All other solutions do not work. Even if you compile most of your package code into a dynamic library (dll, so, dylib, etc.), and the source you compile into lazarus just is a thin wrapper towards this library, anyone can just put it into Ghidra or Binary Ninja, etc. and "simply" patch your licensing checks away. There is no protection of local code. If I have code on my machine, I can get access to it. There never has been a successful mechanism and not for the lack of trying. Look at what the games industry is doing for the past 30 years, from requiring pyhsical CDs with clone protection to run the software to always online mechanisms, they spend millions on developing protection systems, yet there has never been a non online game that has not been cracked. It's just a problem where there is no solution that works ---------------------------------------------------------------------- 440bx · 2023-07-21 10:39 Quote from: aydın on July 18, 2023, 08:42:35 pmI am working on a package and I want to protect it with licensing system. But how can I do this to a package? The replies you've gotten so far are good and make very appropriate points. In addition to what others have pointed out above, I'd like to mention that, in the case of a package, maybe you don't even need a licensing system.  Instead simply obfuscate the code to make it unintelligible.   This is very close to not providing the code at all since, the obfuscation often makes it rather impractical to spend the time attempting to understand it which in turn means a user cannot modify it to suit his/her wishes. if you go that route, a decision you have to make is whether or not you will provide un-obfuscated source code (presumably for an additional "fee".)  Keep in mind that once you provide the un- obfuscated source code, it is close to inevitable for that source code to appear in some "less reputable" website. The real question is, what did you intend the licensing system to provide to _you_.  Obfuscating the code may come close to provide what you are/were looking for. Lastly, keep in mind that any protection, pretty much regardless of how sophisticated it may be, is only effective against non-technical users.  An experienced reverse engineer will defeat the protection, that result is invariant, the only variable is how much effort is needed to accomplish it.  This means that only a small effort  on your part is justified since a greater effort means a more interesting challenge to more talented individuals who like a good challenge thereby defeating the purpose of a greater effort on your part. HTH. ---------------------------------------------------------------------- Handoko · 2023-07-21 18:18 I would suggest you to have a website first. Some 'bad' guys like to steal others' hard work. Sometimes they add many new features before release it. But there were lazy people, they simply rebranded and sold it as they're the creator of the product. Blender 3D, is a feature-rich program that can be compare to the commercial software in the 3D graphics industry. Years ago, someone took Blender and rebranded it to new names and sold them. Not one but two names were released. There were no any new feature added. But they were good in marketing, it would be easy to find them if you did some searching on the web. The case has been reported in Blender community. But because Blender does not pursue in profit gain, there were no action taken. Lazarus has been improved/forked too. That isn't a bad thing but they changed the license and refused to give any credit back to Lazarus. Protecting your software/library/package license is important. But you also need to make it available to trace back to its original creator. Because the longer a website exists, the higher chances it will be archived by internet archive services, so you should have a website before you provide your software to the public especially if you want to make money from it. ---------------------------------------------------------------------- Thaddy · 2023-07-22 15:54 Quote from: Handoko on July 21, 2023, 08:18:16 pmSome 'bad' guys like to steal others' hard work.True. I have been a victim and by proxy the author of some original C code by Jezar as well ( a VST reverb plugin and ASIO host and client interface in Pascal). The culprit visits this forum and not adjusted his sources in 19 years, not even after multiple requests. And he KNOWS I wrote the code and he copied it ad verbatim - it is a literal copy with my licence and copyright removed, he forgot to remove my comments... -and I can prove that. Luckily he kept it open source, but still it is not nice to see that your copyright is removed from rather complex code. Christian, after all those years (2004) fix that! QuoteBlender 3D, is a feature-rich program that can be compare to the commercial software in the 3D graphics industry. Years ago, someone took Blender and rebranded it to new names and sold them. Not one but two names were released. There were no any new feature added. But they were good in marketing, it would be easy to find them if you did some searching on the web. The case has been reported in Blender community. But because Blender does not pursue in profit gain, there were no action taken. Blender has such a strong name - without any advertising - that those guys really soon disappeared. In fact some very big names in the industry support and partially fund Blender. E.g. the BBC or Activision. QuoteLazarus has been improved/forked too. That isn't a bad thing but they changed the license and refused to give any credit back to Lazarus. Indeed and to much chagrain on this forum. Although they gave back some code as can be found in fpcupdeluxe. They do not charge money but do not understand the licenses and probably will never comply, which is bloody irritating. QuoteProtecting your software/library/package license is important. But you also need to make it available to trace back to its original creator. Because the longer a website exists, the higher chances it will be archived by internet archive services, so you should have a website before you provide your software to the public especially if you want to make money from it. Yes, both a license and copyright protection are important. Note that fpc and lazarus licenses allow commercial software to be produced, with the provision that the tools are mentioned would br preferred, but not even necessary.