ladislav-zezula / StormLib

Official GitHub repository of the StormLib library created by Ladislav Zezula (author)
http://www.zezula.net/mpq.html
MIT License
559 stars 213 forks source link

Incorrect File Name #365

Open kizl01 opened 1 day ago

kizl01 commented 1 day ago

Original map file: https://drive.google.com/file/d/1Uzzu4jVZpdCVbAXeJcnZDHQmaMdJuqzP/view?usp=sharing

Hi, I encountered an issue while trying to open this china map with MPQ Editor. It's resulted to open successfully but there're many of .mdx files that has the same file's name.

When I export these files, their names change to "%7C..." which does not match the original. image_2024-10-26_213426041

If I make any changes to war3map.j, the model files become invisible (see image above).

There's a Chinese tool that encrypts models in this way, but it's old, and I’m not sure if it's related to this kind of protection. Here is the tool: https://github.com/sumneko/Model_Encrypt

Can you take a look at this? Much appreciate

ladislav-zezula commented 23 hours ago

The map doesn't have multiple MDX files with the same name. Those File00000091.mdx are generic file names that allow to open those files without knowing their names.

If you want to modify them, you will have to find out the names, then add them to the listfile and then reopen the map again.

kizl01 commented 22 hours ago

Sorry I didn't make it clear, there're many files with chinese character and they are having the same name, here a picture about it image

ladislav-zezula commented 9 hours ago

I can see the first MDX file (the one with 888 664 bytes) as File00000577.mdx. Given that the map doesn't have a listfile, it must have been the specific listfile that you use. Can you send me your listfile?

image

kizl01 commented 9 hours ago

I use W3x Name Scanner from MPQ Editor, here is the listfile list.txt

Thank you

ladislav-zezula commented 9 hours ago

Looking at the listfile in UTF-8, I can see some Chinese file names. Can you confirm they are correct?

image

kizl01 commented 8 hours ago

Yes, they're correct. There're 1206 files in total, if I extract these files, MPQ will report that the file already exists and only extract 4 files. image

image

ladislav-zezula commented 1 hour ago

Ok. I now have enough information to investigate. I'll play with the MPQ and listfile a bit, will also add that map (with the listfile) to StormLib regression tests. Give me some time :-)