PDA

View Full Version : how to protect a mb file


boraddd
08-07-2003, 11:24 PM
Hi all,
I saw this question "how to protect a mb file" recently while reading highend3d`s mel section.
I wrote a mel script to do this. Called `mbLock`.
After you lock a scene with mbLock, it is not possible to save or export anything
from the scene anymore. Exciting huh!?

you download these files,
http://homepagez.com/boraddd/mblock.zip
http://homepagez.com/boraddd/sampleLockedFile.zip
http://homepagez.com/boraddd/source_mblock.zip

How to use:
- Open the scene you wish to lock
- type `$bypassLock=1` in command line
- Open up expression editor
- Copy/paste the mblock.mel here
- Hit the Create button
- Now save your scene (make sure you don`t overwrite the orginal scene)
- done.
Everything will go back to normal after you restart Maya



I`ll tell a little more about how it works and what it does for people with strong mel skills.

mbLock works as an expression first of all. It simply replaces some global procedures defined
when Maya boots up with safe(!) ones. so you can not use `save`, `save as` or any `export` features
for the active maya session.(need to restart maya to clean everything up).
The main challange is to keep those dirty mel gru`s away from hacking mbLock so they can`t enable those
features back. To achieve this, mbLock also disables `script editor`, `command line` and
`expression editor`. If you try to open a scene locked with mblock while in prompt mode(maya -prompt)
it kills the Maya process in the memory. Lock will still be active if you try to import or even reference
the locked file in any other scene. So it is quite difficult (but not impossible) to unlock a scene once
it is locked.

Please send your comments and suggestions.
* Also let me know if you can find a way to hack it.I know one, but not going to tell you ;)

Bora,

mark_wilkins
08-08-2003, 01:08 AM
OK.

So, first of all, you can try using the -prompt flag on Linux or the Mac, where "taskkill" is not a command.

Alternatively, you can drag the following expression to the shelf before opening the file:

commandLine -e -vis 1 commandLine1;

then open the file and click your new shelf button. The command line comes back and you can do whatever you want, including file -es -type "mayaAscii" "name".

In any case, the exercise is pointless. Maya isn't built to give you this kind of security when you share your data files with people.

-- Mark

alexx
08-08-2003, 09:19 AM
btw...

you forgot that importing something with attached mel scripts is possible as well..

as mark mentioned.. i think this is a really pointless exercise.. but as long as you have fun ;)

cheers

alexx

boraddd
08-08-2003, 02:39 PM
Thanks a lot guys.. Stay tuned here..
A new version with improved security coming up really soon...
cheers,
bora.

mark_wilkins
08-08-2003, 03:45 PM
As long as you realize that nothing you try to protect this way will ever really be "secure." You'll never be able to plug all the hooks into MEL in Maya.

-- Mark

boraddd
08-08-2003, 05:02 PM
Ok, here is the new one...
Much more powerfull than before.
Just to keep challange going I`m not posting the mel source for now.

here is a new scene file locked with this new version;

http://homepagez.com/boraddd/NEWsampleLockedScene.zip

Regarding to OS issue with `taskkill`, that is quite easy to fix. I just don`t have those
OS`s handy to do this. If you`ld like to contribute to this script please let me know how
a similiar thing will work on MAC or Linux.

Please let me know if you can hack this new lock....

mark_wilkins
08-08-2003, 05:13 PM
I've spent all the time I can spare on this, so I'll pass on looking at version 2. Maybe someone else will be interested.

-- Mark

boraddd
08-08-2003, 08:05 PM
new one here

http://homepagez.com/boraddd/NEWsampleLockedSceneFIXED1.zip

I know the fact that you can`t make such a lock totaly unbreakable. As long as it`s realy hard and time consuming to break even with strong mel knowledge, i`ld say this lock is secure enough. There is no such unhackable app anyways...
So, these are my thoughts....

All comments and suggestions to make it even more secure is welcome..
Thanks a lot,
Bora.

alexx
08-11-2003, 01:25 PM
i wont try anymore but just one thing to show your vulnerability..

that is a screenshot of a text-editor...
this stuff can ALWAYS be changed:

cheers

alexx

CGTalk Moderation
01-15-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.