THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/10/2011 at 03:25, xxxxxxxx wrote:
This would be very unsafe.
Someone would just need to replace the executable with one that does always end with the result needed for activation.
The best way to protect COFFEE Plugins IMHO is to use an algorithm that is unknown to others which determines if a License Key fits to a specific Cinema 4D Key.
See this example:
createLicense() {
var c4dLicense = SysGetUserInfo(0);
c4dLicense = evaluate(strmid(ser,6,5));
var licenses = new (array, 3);
licenses[0] = int(Modulo(ser*(pow(ser/1242,3)),979975));
licenses[1] = int(Modulo(ser*(pow(ser/8951,3)),457382));
// ...
return licenses;
}
Which might evaluate to a serial like this: 8616 - 121 - 8913
Use this function to create the license, and also to check it.
var userL = getLicenseEnteredByUser();
var correctL = createLicense();
var i = 0;
for(i = 0; i < sizeof(licenses); i++) {
if (userL[0] != correctL) {
// license is wrong !
}
}
Cheers,
Niklas