literature

[MMD] How to FIX pmx files corrupted by PMX Locker

Deviation Actions

Riveda1972's avatar
By
Published:
43.5K Views

Literature Text

Edit: Guess what? The author himself of PMX Locker retired his program.
It seems that newer version of PMX Editor have corrected the BUG (you know what does "bug" mean, do you?) that caused the malfunction when opening PMX files invalidated/corrupted by PMX Locker changing the fourth character in the file header definition. It seems I was right calling this supposed "locking" as "corrupting".


About PMX Model Locker: fav.me/db6nizr


What is PMX Model Locker?


It's a simple tool useful to "lock" a PMX file in order to prevent other users opening it and modifying it in PMX Editor. It preserves the original PMX model and makes a "locked" copy of it. The goal of this program is to allow MMD authors to redistribute only the "locked" version (and of course all its textures, spa/sph files, fx and so on), so final users still can use the model in MMD animations but they cannot edit it.
A "minor" issue of the "locked" model is that it won't work if used in MMM (MikuMikuMoving) instead of in MMD.
If you try to open a "locked" model in PMX Editor you simply get a blank, useless file: no shape, no bones, no textures, no materials or physics shown. In a few words nothing to edit. If you check the formal integrity of the PMX info files, you get a lot of warnings and errors, like PMX Editor cannot recognize properly all of its features.

Trouble: a weapon against improper edits or a help to dishonest MMDers?


As often occurs, this tool is just a tool. Bad or good is not in the tool's nature but in the way and for what it is used for.
Let's say this tool doesn't really provide any secure lock to your PMX. Fortunately, because with this tool you could "lock" anything, regardless you are in right to lock or not, and redistribute a "locked" version of it. Mayhaps passing it as yours. Mayhaps asking people to PAY (in any way, not only in real money) in change of the unlocked version. Mayhaps locking a model that is itself an edit of previous works where original authors have not been credited nor mentioned, but where you have added a lock to deny other editors to modify for they needs, and asking others to "not edit/not redistribute/etc" while you have no right to do that.
Experienced editors still can easely remove the "lock", while more inexperienced users could be forced to ask dishonest people to unlock models in change of any kind of payment.

Who should (or could be interested in using) it?


Well, I figure out just one kind of people who could use PMX Modelo Locker "legally". Please, note the quotes. Saying "legally" I mean "with any licit reason to do that way", nothing concerning laws, copyrights and so on. The only people who should consider to "lock" their model are the real AUTHORS of a model, owners and creator of ALL of their contents. This includes the 3d shape, textures, rigging, physics settings and so on. ALL of the model features.
This obviously excludes most of MMD editors who don't own ANY right to block contents they are editing themselves.
It's quite obvious that when you take parts from other free and "unlocked" models you have no right, nor any explainable reason to "lock" your edited model.
Worse, if you are converting third party models from non native MMD formats (for example: game ripped models. Is this familiar to you?) even more so you have NO right to deny other users to further edit what you have edited yourself, probably in illicit (no quotes, this time) way, or at least without any explicit authorization to rip, edit and redistribute any of the game assets you are using.
In general I cannot understand a reason why one (a full rightful author too) should "lock" a model preventing MMD users to edit it, but in case to prevent parts being reused in edited models. This is really the one case I could understand. But no way I can approve that other MMD editors, who theirselves use third party parts, lock their edits.

How does it works?


I tried to figure out how it worked, keeping the "locked" model useable in MMD but just unopenable in PMX Editor (and, damn it, also in MMM!). Of couse the "locked" model still must have inner references to bones, materials, textures and so on, or MMD itself could not open and use it.
I wondered first if some hack had been made on some file checksum, causing this way a brutal PMX Editor malfunction, a malfunction not affecting MMD (but affecting MMM). This appeared to me a risky way to "lock" a model, without any grant that a future version of MMD would in the future check for that checksums and prevent the use of a "corrupted" model.
Nevermind. The solution was very simpler.
The locker program simply modifies a field in the hexadecimal description of the file, adding a special character (ꁘ, hex code A0, ASCII value 160) where PMX Editor expects to find a blank space (yes the spacebar character: " ", hex code 20, ASCII value 32). I can only presume that this marks the PMX file as "not editable", and also I figure that for some reason MMM simply refuses to use models marked this way.
Knowing this, is simple to guess the way to UNLOCK the "locked" model, isn't it?

Added Note: is this a valid locking? No: it's a file corruption


As explained later here what PMX Locker does is to CORRUPT a valid PMX file, and provide an invalidated on, which causes a MALFUNCTION when loaded in PMX Editor or, worst, doesn't allow you at all to load it in MMM if you prefer MMM instead of MMD. When a program really supports any kind of locking/encryption (like in Adobe PDF or password protected ZIP/RAR files, for example) the program's behavior is radically different. Absolutely different of what occurs when you try to open a "locked" PMX file.

How to unlock (or better: HOW TO FIX/RESTORE A CORRUPTED FILE)?


You have two ways to do this. First of all, make a backup of the model, just for your security. All you need to do is to edit that "blocking" character and replacing it with a blank space. You can do this using any hexadecimal editor or using any advanced text editor. It's full of free and/or opensource editors of both types, but in case you are not familiar with theese programs I suggest to you:
- Text editor: Notepad++ notepad-plus-plus.org/
- Hex editor: HxD mh-nexus.de/en/hxd/
I suggested this two but you're free to choose any other editor. Just consider if you prefer a text editor that you could manage large files, so basic tiny editors like windows Notepad won't work fine for you. Also, NEVER try to use editors like MS Word and similar. You must use PLAIN text editors with NO automatic grammar or ortography correction.
For this reason I mostly recommend to use an hexadecimal editor, instead of a plain text one.

Unlocking with a HEX editor:


Search for the first 4 couplets at the beginning of the "locked" file. They should look something like "50 4D 58 A0" (whthout quotes). Almost all of hex editors should show aside the "translation" of the searched text. What you should see aside is: 䵐ꁘ.
Do you recognize that special character, ""? This is what you need to change to unlock the model. In particular what you are interested in is the couplet "A0" (A + zero). Select it and replace with the number 20. 20 in hexadecimal is the number 32 of decimal system and represents the blank space character in ASCII text.
Just save and you'll get a now editable, unlocked model.

Unlocking with a TEXT editor:


By a certain point of view the operation is simplier in a text editor, but if you are not familiar with "special characters", charsets and so on, you could get confused. Anyway, no matters how your text editor represents the special character you have to replace, just check the first 4 characters. In an "unlocked" model, the first 4 characters must be:
"PMX " (I've left the quotes to emphasize the space after PMX).
Opening the "locked", model, instead, you'll get something like "PMXꁘ", where the character after PMX could be anything, depending on the text editor and the charset you are using. Simply put your cursor after the X, between PMX and the special character: simply delete the next character on the right then add a blank space after the X. Save the file and also this way you get an "unlocked" model.


"You bst4rd! This way you are supporting thieves!"


What?!? Me? Nevermind.
First of all, this kind of "lock" is a very very low security protection. It's similar to protect you home placing a label on your door that says "Thieves cannot enter here". If you have something to complain, please address your rants to who passed this kind of "protection" as the good, supreme and definitive solution to block part stealers.
This program is a nice try to protect who really had the right to decide the destiny of a model of his own FULL property, but I'm still persuaded that people worried about what use other MMDers do of their models, simply should not work in MMD for animation purposes, or at least they should not distribute their models over the net.
Also, I'm a bit frustrated and disgusted, when I see other MMDers who (evidently) discovered this same trick, playacting as they were genious hackers, asking to be contacted privately to provide The Secret Solution to other ingenuous MMDers, or offering to "unlock" locked models for cash (any kind of cash: model exchanges, DA points, bitcoins and so on). This is really disturbing.
Thirs it's simply ridiculous to see MMD users who are editors theirselves, who theirselves use unauthorized edits/ports/rips, "locking" their models and saying "do not edit!".

Ethical issues


If you are wondering if to unlock on not unlock a model (now that you know HOW to do it), you don't really need this kind of denies. You probably know yet when an edit is licit and when not, how to properly credit authors and how to respect their conditions and wills. A simple hexadecimal "lock" added on a model is not necessary to you. Your very real "lock" is your intellectual honesty.
If you use, instead, models and parts without any respect about authorships, about author's recommendations, wills and conditions, a simple "lock" like this won't stop you at all and none of this kind o "protections" are worth of being considered as contermeasures against your dishonety.

I was in strong doubt about publishing this simple trick to remove the lock, but finally I just considered the way PMX Model Locker can (and IS by now!) used by most of MMD editors to "lock" something the no way have right to lock.
"Abuse" of this tool is not an effective word to describe it.
Ancient latins said "Abusus non tollit usum", i.e. "abuse does not cancel use". This means a tool can be abused but this won't negate the licit use of that tool. Right. But also try to apply this same way of thinking on your distributed models and edits: The fact many MMDers ignore your wills and conditions it's not a valid reason to deny most of honest MMDers to licitly edit a distributed model for their needs. In my opinion of course.
Also consider what technically and materially happens when the original author or editor simply disappears: beacuse he/she changes job, stops interesting in MMD, go away to leave in another country or planet or galaxy, or simply looses his original models due to a hardware damage. What does it happens if anyone has the need to edit a "locked" model to improve it, to correct an issue, and there is no more a way to contact the author?
Really. You don't need to use this (or any other similar) kind of tool to "lock" anything and locking a model (event in case there were a better way to do it than this one) could cause severe diseases and trouble to any honest MMD users instead of contrasting the dishonest ones.


I won't say "my two cents". A llama or a :+fav: will work fine.

Any costructive criticism is also welcome. Uncivil raging rants and trolling will be ignored and/or deleted.


---
Mentions and credits:
:iconvadim07:
:iconrune3691:

Edit: Guess what? The author himself of PMX Locker retired his program.
It seems that newer version of PMX Editor have corrected the BUG (you know what does "bug" mean, do you?) that caused the malfunction when opening PMX files invalidated/corrupted by PMX Locker changing the fourth character in the file header definition. It seems I was right calling this supposed "locking" as "corrupting"




About PMX Model Locker: fav.me/db6nizr


What is PMX Model Locker?


It's a simple tool useful to "lock" a PMX file in order to prevent other users opening it and modifying it in PMX Editor. It preserves the original PMX model and makes a "locked" copy of it. The goal of this program is to allow MMD authors to redistribute only the "locked" version (and of course all its textures, spa/sph files, fx and so on), so final users still can use the model in MMD animations but they cannot edit it.
A "minor" issue of the "locked" model is that it won't work if used in MMM (MikuMikuMoving) instead of in MMD.
If you try to open a "locked" model in PMX Editor you simply get a blank, useless file: no shape, no bones, no textures, no materials or physics shown. In a few words nothing to edit. If you check the formal integrity of the PMX info files, you get a lot of warnings and errors, like PMX Editor cannot recognize properly all of its features.

Trouble: a weapon against improper edits or a help to dishonest MMDers?


As often occurs, this tool is just a tool. Bad or good is not in the tool's nature but in the way and for what it is used for.
Let's say this tool doesn't really provide any secure lock to your PMX. Fortunately, because with this tool you could "lock" anything, regardless you are in right to lock or not, and redistribute a "locked" version of it. Mayhaps passing it as yours. Mayhaps asking people to PAY (in any way, not only in real money) in change of the unlocked version. Mayhaps locking a model that is itself an edit of previous works where original authors have not been credited nor mentioned, but where you have added a lock to deny other editors to modify for they needs, and asking others to "not edit/not redistribute/etc" while you have no right to do that.
Experienced editors still can easely remove the "lock", while more inexperienced users could be forced to ask dishonest people to unlock models in change of any kind of payment.

Who should (or could be interested in using) it?


Well, I figure out just one kind of people who could use PMX Modelo Locker "legally". Please, note the quotes. Saying "legally" I mean "with any licit reason to do that way", nothing concerning laws, copyrights and so on. The only people who should consider to "lock" their model are the real AUTHORS of a model, owners and creator of ALL of their contents. This includes the 3d shape, textures, rigging, physics settings and so on. ALL of the model features.
This obviously excludes most of MMD editors who don't own ANY right to block contents they are editing themselves.
It's quite obvious that when you take parts from other free and "unlocked" models you have no right, nor any explainable reason to "lock" your edited model.
Worse, if you are converting third party models from non native MMD formats (for example: game ripped models. Is this familiar to you?) even more so you have NO right to deny other users to further edit what you have edited yourself, probably in illicit (no quotes, this time) way, or at least without any explicit authorization to rip, edit and redistribute any of the game assets you are using.
In general I cannot understand a reason why one (a full rightful author too) should "lock" a model preventing MMD users to edit it, but in case to prevent parts being reused in edited models. This is really the one case I could understand. But no way I can approve that other MMD editors, who theirselves use third party parts, lock their edits.

How does it works?


I tried to figure out how it worked, keeping the "locked" model useable in MMD but just unopenable in PMX Editor (and, damn it, also in MMM!). Of couse the "locked" model still must have inner references to bones, materials, textures and so on, or MMD itself could not open and use it.
I wondered first if some hack had been made on some file checksum, causing this way a brutal PMX Editor malfunction, a malfunction not affecting MMD (but affecting MMM). This appeared to me a risky way to "lock" a model, without any grant that a future version of MMD would in the future check for that checksums and prevent the use of a "corrupted" model.
Nevermind. The solution was very simpler.
The locker program simply modifies a field in the hexadecimal description of the file, adding a special character (ꁘ, hex code A0, ASCII value 160) where PMX Editor expects to find a blank space (yes the spacebar character: " ", hex code 20, ASCII value 32). I can only presume that this marks the PMX file as "not editable", and also I figure that for some reason MMM simply refuses to use models marked this way.
Knowing this, is simple to guess the way to UNLOCK the "locked" model, isn't it?

How to unlock?


You have two ways to do this. First of all, make a backup of the model, just for your security. All you need to do is to edit that "blocking" character and replacing it with a blank space. You can do this using any hexadecimal editor or using any advanced text editor. It's full of free and/or opensource editors of both types, but in case you are not familiar with theese programs I suggest to you:
- Text editor: Notepad++ notepad-plus-plus.org/
- Hex editor: HxD mh-nexus.de/en/hxd/
I suggested this two but you're free to choose any other editor. Just consider if you prefer a text editor that you could manage large files, so basic tiny editors like windows Notepad won't work fine for you. Also, NEVER try to use editors like MS Word and similar. You must use PLAIN text editors with NO automatic grammar or ortography correction.
For this reason I mostly recommend to use an hexadecimal editor, instead of a plain text one.

Unlocking with a HEX editor:


Search for the first 4 couplets at the beginning of the "locked" file. They should look something like "50 4D 58 A0" (whthout quotes). Almost all of hex editors should show aside the "translation" of the searched text. What you should see aside is: 䵐ꁘ.
Do you recognize that special character, ""? This is what you need to change to unlock the model. In particular what you are interested in is the couplet "A0" (A + zero). Select it and replace with the number 20. 20 in hexadecimal is the number 32 of decimal system and represents the blank space character in ASCII text.
Just save and you'll get a now editable, unlocked model.

Unlocking with a TEXT editor:


By a certain point of view the operation is simplier in a text editor, but if you are not familiar with "special characters", charsets and so on, you could get confused. Anyway, no matters how your text editor represents the special character you have to replace, just check the first 4 characters. In an "unlocked" model, the first 4 characters must be:
"PMX " (I've left the quotes to emphasize the space after PMX).
Opening the "locked", model, instead, you'll get something like "PMXꁘ", where the character after PMX could be anything, depending on the text editor and the charset you are using. Simply put your cursor after the X, between PMX and the special character: simply delete the next character on the right then add a blank space after the X. Save the file and also this way you get an "unlocked" model.


"You b@st4rd! This way you are supporting thieves!"


What?!? Me? Nevermind.
First of all, this kind of "lock" is a very very low security protection. It's similar to protect you home placing a label on your door that says "Thieves cannot enter here". If you have something to complain, please address your rants to who passed this kind of "protection" as the good, supreme and definitive solution to block part stealers.
This program is a nice try to protect who really had the right to decide the destiny of a model of his own FULL property, but I'm still persuaded that people worried about what use other MMDers do of their models, simply should not work in MMD for animation purposes, or at least they should not distribute their models over the net.
Also, I'm a bit frustrated and disgusted, when I see other MMDers who (evidently) discovered this same trick, playacting as they were genious hackers, asking to be contacted privately to provide The Secret Solution to other ingenuous MMDers, or offering to "unlock" locked models for cash (any kind of cash: model exchanges, DA points, bitcoins and so on). This is really disturbing.
Thirs it's simply ridiculous to see MMD users who are editors theirselves, who theirselves use unauthorized edits/ports/rips, "locking" their models and saying "do not edit!".

Ethical issues


If you are wondering if to unlock on not unlock a model (now that you know HOW to do it), you don't really need this kind of denies. You probably know yet when an edit is licit and when not, how to properly credit authors and how to respect their conditions and wills. A simple hexadecimal "lock" added on a model is not necessary to you. Your very real "lock" is your intellectual honesty.
If you use, instead, models and parts without any respect about authorships, about author's recommendations, wills and conditions, a simple "lock" like this won't stop you at all and none of this kind o "protections" are worth of being considered as contermeasures against your dishonety.

I was in strong doubt about publishing this simple trick to remove the lock, but finally I just considered the way PMX Model Locker can (and IS by now!) used by most of MMD editors to "lock" something the no way have right to lock.
"Abuse" of this tool is not an effective word to describe it.
Ancient latins said "Abusus non tollit usum", i.e. "abuse does not cancel use". This means a tool can be abused but this won't negate the licit use of that tool. Right. But also try to apply this same way of thinking on your distributed models and edits: The fact many MMDers ignore your wills and conditions it's not a valid reason to deny most of honest MMDers to licitly edit a distributed model for their needs. In my opinion of course.
Also consider what technically and materially happens when the original author or editor simply disappears: beacuse he/she changes job, stops interesting in MMD, go away to leave in another country or planet or galaxy, or simply looses his original models due to a hardware damage. What does it happens if anyone has the need to edit a "locked" model to improve it, to correct an issue, and there is no more a way to contact the author?
Really. You don't need to use this (or any other similar) kind of tool to "lock" anything and locking a model (event in case there were a better way to do it than this one) could cause severe diseases and trouble to any honest MMD users instead of contrasting the dishonest ones.


I won't say "my two cents". A llama or a :+fav: will work fine :D (Big Grin) 

Any constructive criticism is also welcome. Uncivil raging rants and trolling will be ignored and/or deleted.


---
Mentions and credits:
:iconvadim07:
:iconrune3691:

© 2017 - 2024 Riveda1972
Comments373
Join the community to add your comment. Already a deviant? Log In
BenSherman228's avatar