Site Tools


Monkey Script Compiler Licensing Information

Summary: License protection for Monkey-made plug-ins.

How does licensing work?

The licensing implementation in Monkey plug-ins may look the same as other Robert McNeel & Associates products, but the security is not as good as with official McNeel license codes. (Please read the disclaimer below before you use this feature.)

The licensing system has to cater for the following needs:

  • Multiple valid licenses must be available for every *.rhp the compiler generates.
  • Licenses can only be generated by the person making the plug-in.
  • At any time, it must be possible to generate additional licenses that work with an existing *.rhp.
  • A license protected plug-in will not run without a valid license.
  • A license may not be transferred to another computer.

When you compile a new Monkey-made plug-in, you can check the Licensed plugin box on the Compilation page in the Wizard to unlock the license options:

If you do not check the Licensed plugin box there will be no licensing code. If you do not intend to sell your plug-in this is probably what you want.

If you do check the box, you'll have to set the license settings before you can complete the Wizard and compile your plug-in. Press the License options… button to change the settings. The first time you enable the licensing option, this dialog will open automatically.


You have to do two things when making a license protected plug-in:

  • Set a product password
  • Set a product code


The product password you choose has to be unique and hard to guess. It is the only thing that stops other people from generating valid licenses for your product. You can specify any text, as long as it is safe (your dog's name, your high school sweetheart's dog's name, your aunt's dog's name and so on and so forth). You also need to remember this text if you intend to generate more licenses later. (When you save a license table, the product password is saved for you, so you don't actually have to remember it. Also, if you save your plug-in project as an *.mcp file the license password is stored.) When you change the product password a new example key is generated and displayed on the form. You can copy this key to the windows clipboard (in case you need one quickly) with the Copy key button. This example license is only one of many valid license keys that will unlock a plug-in protected by your current password.


The product code is merely a decorative item. It helps to determine which product a certain license key is for. For example, if you see a license key like this:

RH30-PWKO-P30S-4UX0

You immediately know it will unlock a copy of Rhinoceros 3.0. As you can see the product code uses two letters and two digits to identify the product name and product version. You can pick any combination of letters and digits. The product code has no effect on the license validity and it will be visible on the registration dialog which users have to fill out (see below).


When you are happy with the current product password and code, you can save a text file with any number (one thousand by default) of unique, valid license keys. (Actually, there is no guarantee they are all unique. That would be impossible since there is only a finite number of valid licenses per password. Still, the chances of duplicate keys are very small.) If you plan to do the bookkeeping yourself, you'll want to have a text file, which can be easily opened and edited in Notepad. If you plan to make an automated frontend for license distribution, you're probably better off with the XML file, which can be parsed using available tools. Below you see a portion of a Text license table file. (For a description of the License XML format see this page):



When you give a license protected plug-in to a customer, you also have to supply a valid key. Your customers will have to enter this key when your plug-in loads for the first time. They will see a registration box with a blank field. The user can enter four invalid keys before the plug-in fails to load:


1.
2.
3.
4.


The registration dialog is smart enough to extract the license from a garbled string. It will ignore casing, white space, non-alphanumeric characters and the product code. Hence, the following strings will all work:

  • MP10 - 6MC4 - B3P1 - 6B3T - 1073
  • 6MC4 - B3P1 - 6B3T - 1073
  • 6mc4 b3p1 6b3t 1073
  • 6MC4B3P16B3T1073


The instruction message on the registration dialog uses the name and version of the plug-in that you specified in the plug-in attributes. If you have supplied a valid URL for the website (not the update URL) field in the attributes, a link to your website appears on the registration dialog. The name of the link will be the Organization you entered in the attributes.


Once the user has entered a correct key and pressed the Register button, the plug-in will create a new registry key under HKEY_CURRENT_USER\Software\<YourPluginName>\License. This is used to determine whether the plug-in has already been registered whenever it is loaded again. If you want to disable the registration you have to delete or change this registry key. Notice the key is stored under Current User, meaning your plug-in must be registered with every user before they can use it on the same machine. This registry key contains a value field with a string containing the date and time of registration and value field with a hash code which makes it impossible to transfer this particular registration flag to another PC.



Disclaimer

We put a fair amount of effort into making the Monkey compiler licensing system secure and untransferable, but there are no guarantees whatsoever regarding the uncrackability of compiled *.rhp files. A motivated, experienced cracker will have little problems circumventing the license check. If you desire better security you'll have to use third party obfuscators, installers, or encrypters.


This software is provided on an as is basis without warranty of any kind, expressed or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. The person using the software bears all risk as to the quality and performance of the software. The author will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason.


Copyright © 2007 Robert McNeel & Associates.

developer/monkeycompilerlicensing.txt · Last modified: 2016/01/29 by sandy