[Dev/Help] ExpelMember & StageCreation Fix

Results 1 to 4 of 4
  1. #1
    GunZ Developer dacharles is offline
    MemberRank
    Oct 2006 Join Date
    476Posts

    [Dev/Help] ExpelMember & StageCreation Fix

    I've been coding this stuff but it crash a lot and it also works...so if anybody see an error please let me know!
    Code:
    CDetour MBMatchServer__WriteInfoLogDet;
    void MBMatchServer__WriteInfoLogHook()
    {
        MCommandCommunicator__LOG(MMatchServer__GetInstance(),7,"DLL Loaded");
    }
    
    CDetour OnCommandDet;
    bool __stdcall OnCommandHook(class MCommand* pCommand)
    {
        MUID* m_Sender = new MUID();
        int* nID=0;
        __asm
        {
            pushad
    
            mov eax,pCommand
            mov eax,dword ptr ds:[eax+0x18]
            add eax,4
            mov nID,eax
    
            popad
        }
        
        if(*nID==1301)
        {
            __asm{
                popad
    
                mov eax,pCommand
                add eax,8
                mov m_Sender,eax
    
                pushad
            }
            MUID* uidChar = new MUID();
            GetParameter(pCommand, uidChar, 0, MPT_UID, 8);
            if(uidChar->HighID!=m_Sender->HighID || uidChar->LowID!=m_Sender->LowID)
            {
                MCommandCommunicator__LOG(MMatchServer__GetInstance(),7,"El MUID: (%X,%X) a tratado de crear una sala con el MUID de: (%X,%X)",m_Sender->LowID, m_Sender->HighID,(unsigned long)uidChar->LowID ,(unsigned long)uidChar->HighID);
                MMatchServer__DisconnectObject(*m_Sender);
                OnCommandDet.Ret(0);
            }
            delete [] uidChar;
        }
        
        else if(*nID==2019)
        {
            __asm{
                popad
    
                mov eax,pCommand
                 add eax,8
                 mov m_Sender,eax
    
                pushad
            }
            MUID* uidClanAdmin = new MUID();
            GetParameter(pCommand, uidClanAdmin, 0, MPT_UID,8);
            if(uidClanAdmin->HighID!=m_Sender->HighID || uidClanAdmin->LowID!=m_Sender->LowID)
            {
                MCommandCommunicator__LOG(MMatchServer__GetInstance(),7,"El MUID: (%X,%X) a enviado un expel con el MUID de: (%X,%X)",m_Sender->LowID, m_Sender->HighID,(unsigned long)uidClanAdmin->LowID ,(unsigned long)uidClanAdmin->HighID);
                MMatchServer__DisconnectObject(*m_Sender);
                OnCommandDet.Ret(0);
            }
            delete [] uidClanAdmin;
        }
        delete [] m_Sender;
        return 1;
    }
    
    
    
    bool WINAPI DllMain(HMODULE hModule, DWORD dwReason, PVOID pvReserved) {
        if(dwReason == DLL_PROCESS_ATTACH) {
            MBMatchServer__WriteInfoLogDet.Detour((PBYTE)MBMATCHSERVER__WRITESERVERINFOLOG,(PBYTE)MBMatchServer__WriteInfoLogHook,true);
            MBMatchServer__WriteInfoLogDet.Apply();
    
            OnCommandDet.Detour((BYTE*)MMATCHSERVER__ONCOMMAND, (BYTE*)OnCommandHook, true);
            OnCommandDet.Apply();
        }
        return true;
    }


  2. #2
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [Dev/Help] ExpelMember & StageCreation Fix

    Awesome, but wasnt this released before?
    or were they seperate and u combined them together?

  3. #3
    GunZ Developer dacharles is offline
    MemberRank
    Oct 2006 Join Date
    476Posts

    Re: [Dev/Help] ExpelMember & StageCreation Fix

    I don't know :S I coded this from some advices of Lambda

    Edit: Can anyone say something?
    Last edited by dacharles; 05-09-10 at 10:14 PM.

  4. #4
    Just Me iceman4154 is offline
    MemberRank
    Oct 2007 Join Date
    Columbus, OhioLocation
    217Posts

    Re: [Dev/Help] ExpelMember & StageCreation Fix

    Hey dacharles, I might be able to help you.
    PM or contact me on Hotmail.
    I haven't done many function hooking lately but I could try to help you to the best of my ability.



Advertisement