Jump to content

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


Recommended Posts

M2 Download Center

Download Here ( 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/

VirusTotal: https://www.virustotal.com/gui/file/ed62ee15ecf2927cde4fa47f85204aa4aa1648bf4343386b358ed2cff245fc7a/detection

 

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::Initialize();

DistraughtProtector::SetFileBlockedCallback(&HackerDetected);

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:

image_howto.jpg

 

 

After that just add

DistraughtProtector::Destroy();

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! :)

  • Love 5

AxgtRfG.png
C++ programmer at Gameloft

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • 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.