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)); }






Reply With Quote


