Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

Results 1 to 6 of 6
  1. #1
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

    happy Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    These features were tested several times for me, and don't generate any kind of bug or problem in the main. All offsets are here for: 1.03.11 (JPN)

    Screenshots:







    Main.cpp file:

    Code:
    #include "Utils.h"
    #include <windows.h>
    #include <stdio.h>
    #include <math.h>
    
    
    #define ItemId(x, y) ((x * 512) + y)
    
    
    // -----------------------------------
    
    
    WORD    gObjWordItem    = 0;
    DWORD    gObjDwordItem    = 0;
    
    
    // -----------------------------------
    
    
    DWORD    BladesWizardryDmg_Buffer;
    BOOL    BladesWizardryDmg_Switch;
    
    
    // -----------------------------------
    
    
    DWORD    BladesWizardryAdd_Buffer;
    BOOL    BladesWizardryAdd_Switch;
    
    
    // -----------------------------------
    
    
    DWORD    ScepterPetAttack_Buffer;
    BOOL    ScepterPetAttack_Switch;
    
    
    // -----------------------------------
    
    
    __declspec(naked) void BladesWizardryDmg()
    {
        BladesWizardryDmg_Switch = FALSE;
        // ----
        __asm
        {
            mov gObjWordItem, cx
        }
        // ----
        if(gObjWordItem == ItemId(0,21)) // Dark Reign Blade (Original)
        {
            BladesWizardryDmg_Switch = TRUE;
        }
        else if(gObjWordItem == ItemId(0,29)) // Rune Sacred Blade (Added)
        {
            BladesWizardryDmg_Switch = TRUE;
        }
        // ----
        if(BladesWizardryDmg_Switch == TRUE)
        {
            __asm
            {
                mov BladesWizardryDmg_Buffer,0x00596A06
                jmp BladesWizardryDmg_Buffer
            }
        }
        __asm
        {
            mov BladesWizardryDmg_Buffer,0x005969FC
            jmp BladesWizardryDmg_Buffer
        }
    }
    
    
    __declspec(naked) void BladesWizardryAdd()
    {
        BladesWizardryAdd_Switch = FALSE;
        // ----
        _asm
        {
            mov gObjWordItem, cx
        }
        // ----
        if(gObjWordItem == ItemId(0,21)) // Dark Reign Blade (Original)
        {
            BladesWizardryAdd_Switch = TRUE;
        }
        else if(gObjWordItem == ItemId(0,29)) // Rune Sacred Blade (Added)
        {
            BladesWizardryAdd_Switch = TRUE;
        }
        // ----
        if(BladesWizardryAdd_Switch == TRUE)
        {
            _asm
            {
                mov BladesWizardryAdd_Buffer,0x005970AE
                jmp BladesWizardryAdd_Buffer
            }
        }
        _asm
        {
            mov BladesWizardryAdd_Buffer,0x00597098
            jmp BladesWizardryAdd_Buffer
        }
    }
    
    
    __declspec(naked) void SceptersPetAttack()
    {
        ScepterPetAttack_Switch = FALSE;
        // ----
        _asm
        {
            mov eax, dword ptr ss:[ebp+0x8]
            mov gObjDwordItem, eax
        }
        // ----
        if(gObjDwordItem == ItemId(2,17))
        {
            ScepterPetAttack_Switch = TRUE;
        }
        else if(gObjDwordItem == ItemId(2,22))
        {
            ScepterPetAttack_Switch = TRUE;
        }
        // ----
        if(ScepterPetAttack_Switch == TRUE)
        {
            _asm
            {
                mov ScepterPetAttack_Buffer,0x0050A2CD
                jmp ScepterPetAttack_Buffer
            }
        }
        _asm
        {
            mov ScepterPetAttack_Buffer,0x0050A2C4
            jmp ScepterPetAttack_Buffer
        }
    }
    
    
    void InitProps()
    {
        Utils.SetRange((LPVOID)0x005969F6, 6, ASM::NOP);
        Utils.SetJmp((LPVOID)0x005969F6, BladesWizardryDmg);
        // --
        Utils.SetRange((LPVOID)0x00597092, 6, ASM::NOP);
            Utils.SetJmp((LPVOID)0x00597092, BladesWizardryAdd);
        // --
        Utils.SetRange((LPVOID)0x0050A2BB, 9, ASM::NOP);
            Utils.SetJmp((LPVOID)0x0050A2BB, SceptersPetAttack);
    }
    
    
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
        switch(dwReason)
        {    
            case DLL_PROCESS_ATTACH: 
            {
                // --
            }
            break;
            
            case DLL_PROCESS_DETACH:
            {
                // --
            }
            break;
        }
    
    
        return true;
    }
    
    
    extern "C" _declspec(dllexport) void Init()
    {
        DWORD OldProtect;
        VirtualProtect(LPVOID(0x401000),0x00888FFF,PAGE_EXECUTE_READWRITE,&OldProtect);
        {
            InitProps();
        }
    }



    Utils.cpp file:

    Code:
    DWORD ReadMemory(const LPVOID lpAddress, LPVOID lpBuf, const UINT uSize)
    Code:
    {
    
        DWORD dwErrorCode   = 0;
        DWORD dwOldProtect  = 0;
        // ----
        int iRes = VirtualProtect(lpAddress, uSize, PAGE_EXECUTE_READWRITE, & dwOldProtect);
        // ----
        if ( iRes == 0 )
        {
            dwErrorCode = GetLastError();
            return dwErrorCode;
        }
        // ----
        memcpy(lpBuf, lpAddress, uSize);
        // ----
        DWORD dwBytes   = 0;
        // ----
        iRes = VirtualProtect(lpAddress, uSize, dwOldProtect, & dwBytes);
        // ----
        if ( iRes == 0 )
        {
            dwErrorCode = GetLastError();
            return dwErrorCode;
        }
        // ----
        return 0x00;
    }
    
    
    DWORD WriteMemory(const LPVOID lpAddress, const LPVOID lpBuf, const UINT uSize)
    {
        DWORD dwErrorCode   = 0;
        DWORD dwOldProtect  = 0;
        // ----
        int iRes = VirtualProtect(lpAddress, uSize, PAGE_EXECUTE_READWRITE, & dwOldProtect);
        // ----
        if ( iRes == 0 )
        {
            dwErrorCode = GetLastError();
            return dwErrorCode;
        }
        // ----
        memcpy(lpAddress, lpBuf, uSize);
        // ----
        DWORD dwBytes   = 0;
        // ----
        iRes = VirtualProtect(lpAddress, uSize, dwOldProtect, & dwBytes);
        // ----
        if ( iRes == 0 )
        {
            dwErrorCode = GetLastError();
            return dwErrorCode;
        }
        // ----
        return 0x00;
    }
    
    
    DWORD SetRange(const LPVOID dwAddress, const USHORT wCount, const BYTE btValue)
    {
        BYTE * lpBuf    = new BYTE[wCount];
        // ----
        memset(lpBuf, btValue, wCount);
        // ----
        return WriteMemory( dwAddress, (LPVOID) lpBuf, wCount);
    }
    
    
    DWORD SetJmp(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress)
    {
        BYTE btBuf[5];
        DWORD dwShift    = (ULONG_PTR)dwJMPAddress - (ULONG_PTR)dwEnterFunction - 5;
        // ----
        btBuf[0]    = 0xE9;
        memcpy( (LPVOID) & btBuf[1], (LPVOID) & dwShift, sizeof(ULONG_PTR));
        // ----
        return WriteMemory(dwEnterFunction, (LPVOID) btBuf, sizeof(btBuf));
    }

    Last edited by Kiosani; 04-10-15 at 08:45 PM.


  2. #2
    Retired NanoGuy is offline
    MemberRank
    Jul 2012 Join Date
    IsraelLocation
    286Posts

    re: Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    that much asm:D

  3. #3
    Evolution Team Th3AnG3L is offline
    MemberRank
    Apr 2014 Join Date
    634Posts

    re: Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    one mistake : BladesWizardryAdd_Buff (uknown or BladesWizardryAdd_Buffer)

  4. #4
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

    re: Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    Quote Originally Posted by Th3AnG3L View Post
    one mistake : BladesWizardryAdd_Buff (uknown or BladesWizardryAdd_Buffer)
    Yes, my mistake.. sorry.. fixed this in first post code and added some screenshots from my old tests with this.

  5. #5
    Proficient Member Van_Bom is offline
    MemberRank
    May 2009 Join Date
    194Posts

    Re: Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    Quote Originally Posted by mauro07 View Post
    Yes, my mistake.. sorry.. fixed this in first post code and added some screenshots from my old tests with this.
    I love mauro07......

  6. #6
    iNewLegend , Leo123 zolamu is offline
    MemberRank
    Apr 2006 Join Date
    Холон, IsrLocation
    737Posts

    Re: Wizardry Dmg, Add & Increase Pet Attack Option Client Source (1.03K)

    nice coding style ;)



Advertisement