Overriding DLL imports in FlashpointServer.exe

The documentation for my ofpsounds program describes design flaws in Bohemia Interactive's dedicated Flashpoint: Resistance server.

In a nutshell, players connecting to the server can upload custom graphic and sound files which are subsequently pushed out to everyone on the server. Whilst this certainly enhances gameplay, by allowing players to personalise their characters with custom avatars and play cool chats, it has the unfortunate side-effect of causing heavy lag while players download custom content.

The solution used by ofpsounds was to use a file creation notification handler to wake a monitoring process whenever custom sounds were saved to the server's cache directory. The monitor then checked the total file size of user's custom sounds and applied a DENY access control list to limit subsequent uploads if an administrator defined limit was exceeded.

This article presents a more efficient method. By editing the server's PE header, we override its import list, redirecting CreateFileA() calls to a function in a DLL we force the server to load. This function performs the same checks as ofpsounds and returns INVALID_HANDLE_VALUE if the file size limit is exceeded, thus preventing any files from being written at all.

Jump to a section

intro | part 1: Creating the DLL | part 2: Editing the PE header

Download soundsfix 1.91 code and source.