Jump to content

Disable Loading MIX, ASI, M3D... Files From Client Directory

Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

Hey again :D


Yesterday I was looking into mss32.dll and just found out this is the library being responsible for loading asi, mix, m3d, etc.. files. So I made a library that will hook the Miles Sound System so that it won't load unwanted files, only what is needed.


Download: https://distraught.hu/DistraughtProtector/


This is the hidden content, please


There are 3 files in the zip:

  • .lib -> put it in your extern/lib folder
  • .h -> put it in your extern/include folder
  • .dll -> put it in your client


Open UserInterface/UserInterface.cpp and find the WinMain function.

Add this to the beginning of the function:



DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssmp3.asi", 125952);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssvoice.asi", 197120);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssa3d.m3d", 83456);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssds3d.m3d", 70656);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssdx7.m3d", 80896);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\msseax.m3d", 103424);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssrsx.m3d", 354816);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\msssoft.m3d", 67072);
DistraughtProtector::AddAllowedMilesProviderLibrary("miles\\mssdsp.flt", 93696);

You have to specify the files that are enabled to load by the Miles Sound System (path, file size in bytes).



And add this before that function:

static void _stdcall HackerDetected(const char* blockedFile)
	MessageBox(NULL, blockedFile, ApplicationStringTable_GetStringz(IDS_APP_NAME, "APP_NAME"), MB_ICONSTOP);

This is a callback where you get notified if the user would load a file that he/she shouldn't :D

You don't have to specify a callback, in that case remove DistraughtProtector::SetFileBlockedCallback(&HackerDetected); from WinMain and the client just simply won't load the dangerous files. 


Here's an image what it should look like:




After that just add


to the end of WinMain (surely before the return!).


Hope you like it! If you have ideas what new features should I add to the library, let me know in the comments! :)

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 35
  • Dislove 1
  • Good 6
  • Love 2
  • Love 21
Link to comment
Share on other sites

  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.