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

.mix file opens partially then stops #152

Closed Killerwatts closed 4 years ago

Killerwatts commented 5 years ago

Hi, I was able to open this .mix file http://www.mediafire.com/file/abwt7k62t2ru7uo/acgpatch.mix/file. However, despite the size, it only contained one file; a loadingscreen.mdx. The MPQ editor appears to open the file partially before stopping. Are the files somehow hidden?

ghost commented 5 years ago

It has Themida applied on it, you will need either to unpack Themida or well, hope that Ladik will add support to reading of files from Themida.

In that file it is a "true" file being masked and the other part is simply an additional MPQ that serves as the primary loaded data, etc.

In short, right now there is no way to open it correctly.

ladislav-zezula commented 5 years ago

If a mix file (a DLL file, in fact) unpacks itself and then feeds Warcraft III with an inside MPQ, then there's not much I can do. The problem is that I don't understand the mechanism of how the MIX files give data to the game.

ghost commented 5 years ago

TCHAR DllPath[2048]; HANDLE Handle;

BOOL APIENTRY DllMain( HINSTANCE hinstDLL, DWORD DwReason, LPVOID lpReserved ) { Storm::Init(); if ( DwReason == DLL_THREAD_ATTACH ) { DisableThreadLibraryCalls( hinstDLL ); GetModuleFileName( hinstDLL, DllPath, 2048 ); Storm::OpenArchive( DllPath, 0, 0, &Handle ); } else if ( DwReason == DLL_THREAD_DETACH ) { Storm::CloseArchive( Handle ); } return TRUE; }

Forgot to add the code, this is how .mix is loaded into the game, the dll's code is above, the MPQ data is added at the bottom via hex.

ladislav-zezula commented 4 years ago

I am not going to load 3dparty MIX files. Besides danger of running untrusted code, it won't work in 64-bit builds of Warcraft III.