Skip to content

Latest commit

 

History

History
65 lines (55 loc) · 1.89 KB

File metadata and controls

65 lines (55 loc) · 1.89 KB

Chat.dll Proxy

Used this for few years as loader.

  • You can load any other module from here and prevent using external INJECTORS.
  • This is just for chat.dll, you can replace almost any module of the game by doing proxy.

Posts:

Code:

Rename og Chat.dll to OChat.dll

#include <map>

std::map<std::string, FARPROC> ogFuncs;
HMODULE hOGDLL = NULL;

//this was just one of the modules that i did proxied
FARPROC gOGFunc(const char* funcName) {
    if (!ogFuncs[funcName]) {
        ogFuncs[funcName] = GetProcAddress(hOGDLL, funcName);
    }
    return ogFuncs[funcName];
}

extern "C"
{
    typedef void* (*ChaterInfoMgrQueryFunc)();
    typedef int(__cdecl* ChatInfoManagerDestroyFunc)(int, int);

    __declspec(dllexport) void* ChaterInfoMgrQuery() {
        ChaterInfoMgrQueryFunc original = (ChaterInfoMgrQueryFunc)gOGFunc("ChaterInfoMgrQuery");
        return original ? original() : nullptr;
    }

    __declspec(dllexport) int __cdecl ChatInfoManagerDestroy(int a1, int a2) {
        ChatInfoManagerDestroyFunc original = (ChatInfoManagerDestroyFunc)gOGFunc("ChatInfoManagerDestroy");
        return original ? original(a1, a2) : 0;
    }
}

void Hook()
{
    //in my case i used this to load the Conquer-Loader
    //LoadLibrary("LoaderHook.dll");
}

BOOL APIENTRY DllMain(HMODULE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved
)
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        hOGDLL = LoadLibrary("OChat.dll");
        CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Hook, NULL, 0, NULL);
        break;
    case DLL_PROCESS_DETACH:
        if (hOGDLL) FreeLibrary(hOGDLL);
        break;
    }
    return TRUE;
}