Notifications
Clear all

[Closed] how to make a maxscript trial?

Hi,

how to make a maxscript ( macroscript ) trial?

Thank you!

50 Replies

Could you explain what exactly you mean by that?

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

Keep in mind no protection is perfect, if somebody really wants to break your protection, he will. MAXScript was designed for scripting, which by definition is something you share. If you want slightly better protection, you would write a plugin with the SDK (and some russian guy will crack it the next day regardless).

So prepare for a big PITA and barely any useful results.

Also keep in mind you cannot encrypt MCR files (MacroScripts). You can encrypt an .MS file and let the MCR file launch that using FileIn().

Well, i want, after period of time, a script to not be evailable to use without a password for exemple ( like a trial software ). That`s all. You understand?

That鈥檚 not nearly as easy as you might think, I think鈥?/p>

Do you want this to be after a certain time period, or after a certain number of actions?
If the former, you can use 鈥済etUniversalTime()鈥?in 3ds Max 2008+ (not available in earlier versions without installing a [free] 3rd party plugin). That will get you the time in an actually usable format for that purpose (localtime is nearly useless because it will depend on the user鈥檚 date/time format settings in Control Panel).
Edit: If it鈥檚 鈥渁 certain time period of use鈥? use 鈥済etLocalTime()鈥?instead. 鈥済etUniversalTime鈥?is more useful if you want it to stop working on a given date/time known to you (regardless of the timezone of the end-user).

If the latter, you鈥檒l have to write information away somewhere – to a file, to the registry (again, 3ds Max 2008+ only unless installing that [free] 3rd party plugin), whatever and read that back out.
Problem with that is that it is extremely easy to defeat unless you encrypt that value. See encryptFile for some built-in encryption functionality; this does require you write the plain value out first and then delete the original file, but that original file can be retrieved if somebody really wants to. So if going that route, try making your own encryption scheme in maxscript.

On the topic of encryption鈥?you鈥檒l want to encrypt you script file using encryptScript() in 3ds Max r9 or later so that the users can鈥檛 just change your source code and get around the limitation. You could do it for earlier versions (3ds Max 8 and before) but it鈥檚 trivial to get the source code when using the older 3ds Ma encryption methods – using maxscript itself.
EncryptScript makes sure that everybody can still run your script without needing a separate 鈥榢ey鈥?to decrypt the file (which would be bad anyway as it would end up living as an actual file on the drive).

To make sure that users can鈥檛 just exchange passwords, you also have to tie into some piece of information unique to their machine to base your passwords on. For example, hardwarelockID – although I think that鈥檚 been deprecated (no more hardware dongles, after all), and I鈥檓 not sure what that does in newer max versions.

 PEN

This is a real pain to set up. You will need to store information some where about when it was installed or when the end date is. This could just be in an encrypted lic file if you wanted with the expire date. If the file doesn鈥檛 exist it is locked and if it does but the date is past the date stored in the lic file then it is also locked.

 PEN

HardwareLockID still works unless the users are on a net work license with Max, in this case all the hardwareLockID鈥檚 will be the same. Darned if I know what to do about that at this point.

yeah, similarly – max in trial mode returns -1 or so鈥?/p>

I don鈥檛 think there鈥檚 an easy way to get at most other hardware-ish bits and pieces. Can certainly simply try a whole combination of things鈥?just expect users to write hatemail when changing something trivial breaks their license

most of my scripts stop working before 28 days anyway so it鈥檚 never been a problem for me.

laughing out loud
(yeah, 鈥榣ol鈥?left the message too short. shakes fist at draconianBB)

Edit: Just editing this in here鈥?Just spotted what the deal with HardwareLockID was; it鈥檚 broken on Max9x64.

After some frustrating experiences with the encryptFile function (wich seems to screw up the script if it used inside an encrypted script鈥od know why), I am now trying to use all the fancy .NET stuff to encrypt a license file. I鈥檒l post some code once I get the darned thing to work (waaaaay to many stuff in .net abut encrypting).

Page 1 / 5