From fcc7916f0ab165957b4a309bfd35e3d241896372 Mon Sep 17 00:00:00 2001 From: namreeb Date: Thu, 15 Mar 2018 08:40:29 -1000 Subject: [PATCH] Version 2.0! This version accomplishes the same end-goal with a more intelligent design. It is no longer necessary to create customized macros. Explanation: The client will not allow a cast while the cast bar is being displayed. Ordinarily, the cast bar will continue to be displayed until the server informs the client that the cast has completed. Version 2.0 alters that behavior, causing the cast bar to disappear automatically once a sufficient amount of time has passed. Though this solution requires a greater number of modifications to the game, it essentially eliminates potential for abuse or misuse, which should make it less ethically ambiguous by those who are concerned. --- .gitignore | 7 ++ LICENSE.txt | 2 +- README.md | 17 ++-- loader/loader.vcxproj | 2 +- loader/main.cpp | 4 +- nampower/CDataStore.cpp | 49 ------------ nampower/CDataStore.hpp | 69 ---------------- nampower/castspell.cpp | 105 ------------------------ nampower/lua.cpp | 81 ------------------- nampower/main.cpp | 127 ++++++++++++++++++++++++------ nampower/misc.hpp | 44 ----------- nampower/nampower.vcxproj | 9 +-- nampower/nampower.vcxproj.filters | 15 +--- nampower/offsets.hpp | 24 +++--- 14 files changed, 139 insertions(+), 416 deletions(-) delete mode 100644 nampower/CDataStore.cpp delete mode 100644 nampower/CDataStore.hpp delete mode 100644 nampower/castspell.cpp delete mode 100644 nampower/lua.cpp delete mode 100644 nampower/misc.hpp diff --git a/.gitignore b/.gitignore index dc5e8cc..eadf031 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,10 @@ /loader/Release /nampower/Debug /nampower/Release +/.vs/* +/loader/*.user +/*.suo +/nampower/*.user +/nampower.VC.db +/*.sdf +/loader/*.aps diff --git a/LICENSE.txt b/LICENSE.txt index 302eb25..c8d1c9e 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017, namreeb (legal@namreeb.org) +Copyright (c) 2017-2018, namreeb (legal@namreeb.org) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 3570546..5d1f6fb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**Please consider donating if you use this tool.** + [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QFWZUEMC5N3SW) nampower @@ -22,20 +24,16 @@ Consider the following timeline, assuming a latency of 200ms. 1400ms ago. In this scenario, a 1000ms spell takes 1400ms to cast. This tool will work around that -design flaw by bypassing the lock the client places on itself during a spell cast. - -To cast a spell at your current target using this tool, create a macro of the format -"/script CastSpellAtTarget(x)" where x is the numerical id of the spell you wish to cast. +design flaw by altering the client behavior to not wait for the server to acknowledge +anything. -To cast a spell at your current mouseover target using this tool, create a macro of the -format "/script CastSpellAtMouseover(x)" where x is the numerical id of the spell you -wish to cast. +Previous versions of this tool required custom macros. This version should "just work". To launch, run loader.exe -p c:\path\to\wow.exe (or just loader.exe with it inside the main wow folder) Note that while this makes no malicious changes to the WoW client, it could easily be -mistaken as malicious by the primitive anticheats in use on most vanilla private +mistaken as malicious by the primitive anticheats in use on some vanilla private servers. This program contains absolutely no protection against anticheat software. Having written the anticheat for Elysium and Light's Hope, I can say that they do not @@ -45,7 +43,4 @@ Kronos / Twinstar has said that while they do not support client modification, t will not specifically target this mod. Refer to this thread: http://forum.twinstar.cz/showthread.php/97154-Planning-to-release-a-wow-mod-Will-it-get-people-banned -Crestfall has said they have no issue with people using it unless it later is revealed to -enable abuse. Refer to this thread: http://forums.crestfall-gaming.com/index.php?/topic/1224-will-nampower-be-allowed/ - USE AT YOUR OWN RISK \ No newline at end of file diff --git a/loader/loader.vcxproj b/loader/loader.vcxproj index 128575d..8232f2e 100644 --- a/loader/loader.vcxproj +++ b/loader/loader.vcxproj @@ -13,7 +13,7 @@ {62045F05-596D-4DE1-BD19-60455A3B2A0A} loader - 10.0.14393.0 + 10.0.17134.0 diff --git a/loader/main.cpp b/loader/main.cpp index 140a701..aa5a4de 100644 --- a/loader/main.cpp +++ b/loader/main.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2017, namreeb (legal@namreeb.org) + Copyright (c) 2017-2018, namreeb (legal@namreeb.org) All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ */ #define NAME "nampower" -#define VERSION "v1.2" +#define VERSION "v2.0" #include #include diff --git a/nampower/CDataStore.cpp b/nampower/CDataStore.cpp deleted file mode 100644 index cf9bbdc..0000000 --- a/nampower/CDataStore.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (c) 2017, namreeb (legal@namreeb.org) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those - of the authors and should not be interpreted as representing official policies, - either expressed or implied, of the FreeBSD Project. -*/ - -#include -#include - -#include "CDataStore.hpp" -#include "offsets.hpp" - -void CDataStore::Write(const PVOID data, unsigned int length) -{ - assert(m_bytesWritten + length <= m_capacity); - - memcpy((char *)m_data + m_bytesWritten, data, length); - m_bytesWritten += length; -} - -void CDataStore::Send() const -{ - auto const sendPacket = hadesmem::detail::AliasCastUnchecked(Offsets::ClientConnection__SendPacket); - ClientConnection *clientConnection = *(reinterpret_cast(Offsets::gClientConnection)); - (clientConnection->*sendPacket)(this); -} \ No newline at end of file diff --git a/nampower/CDataStore.hpp b/nampower/CDataStore.hpp deleted file mode 100644 index 99f6873..0000000 --- a/nampower/CDataStore.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (c) 2017, namreeb (legal@namreeb.org) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those - of the authors and should not be interpreted as representing official policies, - either expressed or implied, of the FreeBSD Project. -*/ - -#pragma once - -#include -#include - -class CDataStore -{ - private: - const PVOID _vmt; // 0x00-0x04 - - public: - const PVOID m_data; // 0x04-0x08 - const unsigned int m_base; // 0x08-0x0C - const unsigned int m_capacity; // 0x0C-0x10 - unsigned int m_bytesWritten; // 0x10-0x14 - unsigned int m_bytesRead; // 0x14-0x18 - - CDataStore(unsigned int size) : _vmt(nullptr), m_data(malloc(size)), m_base(0), m_capacity(size), m_bytesWritten(0), m_bytesRead(0) {} - - ~CDataStore() - { - free(m_data); - } - - template void Write(T); - void Write(const PVOID, unsigned int); - - void Send() const; -}; - -template -void CDataStore::Write(T val) -{ - Write(&val, sizeof(T)); -} - -struct ClientConnection -{ - int SendPacket(const CDataStore *); -}; \ No newline at end of file diff --git a/nampower/castspell.cpp b/nampower/castspell.cpp deleted file mode 100644 index 7af0785..0000000 --- a/nampower/castspell.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (c) 2017, namreeb (legal@namreeb.org) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those - of the authors and should not be interpreted as representing official policies, - either expressed or implied, of the FreeBSD Project. -*/ - -#include -#include -#include - -#include "misc.hpp" -#include "CDataStore.hpp" -#include "offsets.hpp" - -void BuildPackedGuid(unsigned __int64 guid, std::vector &result) -{ - result.clear(); - result.reserve(sizeof(unsigned __int64)); - - if (!guid) - return; - - result.push_back(0); - - for (int i = 0; guid != 0; ++i) - { - if ((guid & 0xFF) != 0) - { - result[0] |= (BYTE)(1 << i); - result.push_back((BYTE)(guid & 0xFF)); - } - - guid >>= 8; - } -} - -int CastSpellAtTarget(void *luaState) -{ - if (const unsigned __int64 targetGuid = *(const unsigned __int64 *)Offsets::gTargetGuid) - { - auto param = (DWORD)LuaToNumber(luaState, 1); - - std::vector packedGuid; - BuildPackedGuid(targetGuid, packedGuid); - - CDataStore packet(10 + packedGuid.size()); - - packet.Write((DWORD)0x12E); // CMSG_CAST_SPELL - packet.Write((DWORD)param); // spell id - packet.Write((WORD)0x02); // TARGET_FLAG_UNIT - packet.Write(&packedGuid[0], packedGuid.size()); // packed target guid - - packet.Send(); - } - - return 1; -} - -int CastSpellAtMouseover(void *luaState) -{ - if (const unsigned __int64 mouseoverGuid = *(const unsigned __int64 *)Offsets::gMouseoverGuid) - { - auto param = (DWORD)LuaToNumber(luaState, 1); - - std::vector packedGuid; - BuildPackedGuid(mouseoverGuid, packedGuid); - - CDataStore packet(10 + packedGuid.size()); - - packet.Write((DWORD)0x12E); // CMSG_CAST_SPELL - packet.Write((DWORD)param); // spell id - packet.Write((WORD)0x02); // TARGET_FLAG_UNIT - packet.Write(&packedGuid[0], packedGuid.size()); // packed target guid - - packet.Send(); - } - //if mouseover guid is empty, use target instead - else - CastSpellAtTarget(luaState); - - return 1; -} \ No newline at end of file diff --git a/nampower/lua.cpp b/nampower/lua.cpp deleted file mode 100644 index 579cc0d..0000000 --- a/nampower/lua.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2017, namreeb (legal@namreeb.org) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those - of the authors and should not be interpreted as representing official policies, - either expressed or implied, of the FreeBSD Project. -*/ - -#include - -#include - -#include "misc.hpp" -#include "offsets.hpp" - -double(__fastcall *LuaToNumber)(PVOID, unsigned int); - -void RegisterLuaFunctions() -{ - // note: there are many suitable locations for these trampolines in the 1.12.1 client. - // these offsets are what you would change if you care to use different ones. - const hadesmem::Process process(::GetCurrentProcessId()); - FrameScriptRegisterT frameScriptRegister = hadesmem::detail::AliasCast(Offsets::FrameScript__Register); - - std::vector patch(5); - - patch[0] = 0xE9; // JMP - - // first trampoline - DWORD trampolineAddress = Offsets::gTrampoline1; - DWORD castSpellLocation = hadesmem::detail::AliasCast(&CastSpellAtTarget); - DWORD relativeJumpValue = castSpellLocation - trampolineAddress - 5; - - memcpy(&patch[1], &relativeJumpValue, sizeof(DWORD)); - - // write JMP to wow's .text section so it can be registered with lua - (new hadesmem::PatchRaw(process, (PVOID)trampolineAddress, patch))->Apply(); - - // register with lua - frameScriptRegister("CastSpellAtTarget", trampolineAddress); - - // second trampoline - trampolineAddress = Offsets::gTrampoline2; - castSpellLocation = hadesmem::detail::AliasCast(&CastSpellAtMouseover); - relativeJumpValue = castSpellLocation - trampolineAddress - 5; - - memcpy(&patch[1], &relativeJumpValue, sizeof(DWORD)); - - (new hadesmem::PatchRaw(process, (PVOID)trampolineAddress, patch))->Apply(); - - frameScriptRegister("CastSpellAtMouseover", trampolineAddress); -} - -void LuaLoadScripts(hadesmem::PatchDetourBase *detour) -{ - LuaLoadScriptsT originalRegister = detour->GetTrampolineT(); - (*originalRegister)(); - - RegisterLuaFunctions(); -} \ No newline at end of file diff --git a/nampower/main.cpp b/nampower/main.cpp index e526991..b5f0af2 100644 --- a/nampower/main.cpp +++ b/nampower/main.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2017, namreeb (legal@namreeb.org) + Copyright (c) 2017-2018, namreeb (legal@namreeb.org) All rights reserved. Redistribution and use in source and binary forms, with or without @@ -27,41 +27,122 @@ either expressed or implied, of the FreeBSD Project. */ -#include -#include - -#include +#include "offsets.hpp" +#include "game.hpp" #include #include -#include "misc.hpp" -#include "offsets.hpp" +#include + +#include +#include + +#ifdef _DEBUG +#include +#endif BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID); -// here we hook the wow script load function so we know when to register -// our function and initialize the lua ToNumber pointer for later. -// we also check to see if we are already in-game (in the case of injection -// into a running process). if we are, register the lua function immediately. +static DWORD gCooldown; + +#ifdef _DEBUG +static DWORD gLastCast; +#endif + +namespace +{ +using CastSpellT = bool(__fastcall *)(void *, int, void *, std::uint64_t); + +bool CastSpellHook(hadesmem::PatchDetourBase *detour, void *unit, int spellId, void *item, std::uint64_t guid) +{ + auto const currentTime = ::GetTickCount(); + + // is there a cooldown? + if (gCooldown) + { + // is it still active? + if (gCooldown > currentTime) + return false; + + gCooldown = 0; + } + + auto const castSpell = detour->GetTrampolineT(); + auto ret = castSpell(unit, spellId, item, guid); + + // haven't gotten spell result yet, but we should have? local cancel... + if (!ret) + { + int(__fastcall *cancelCast)(bool, bool, int) = reinterpret_cast(Offsets::CancelCast); + + cancelCast(false, false, 28); + + // try again... + ret = castSpell(unit, spellId, item, guid); + } + + if (ret) + { + constexpr std::uint32_t SPELLCAST_START = 337; + void(*signalEvent)(std::uint32_t, const char *, ...) = reinterpret_cast(Offsets::SignalEvent); + + auto const castTime = game::GetCastTime(unit, spellId); + auto const spell = game::GetSpellInfo(spellId); + + if (!!spell && castTime > 0 && !(spell->Attributes & game::SPELL_ATTR_RANGED)) + { + gCooldown = currentTime + castTime; + +#ifdef _DEBUG + std::stringstream str; + str << "Casting " << game::GetSpellName(spellId) << " with cast time " << castTime << " at time " << currentTime; + + if (gLastCast) + str << " elapsed: " << (currentTime - gLastCast); + + str << std::endl; + + ::OutputDebugStringA(str.str().c_str()); + + gLastCast = currentTime; +#endif + + signalEvent(SPELLCAST_START, "%s%d", game::GetSpellName(spellId), castTime); + } + } + + return ret; +} +} + +std::unique_ptr> gCastDetour; +std::unique_ptr gCastbarPatch; +std::unique_ptr gCastbarCancelPatch; + extern "C" __declspec(dllexport) DWORD Load() { - const hadesmem::Process process(::GetCurrentProcessId()); - - auto const luaLoadScriptsOrig = hadesmem::detail::AliasCast(Offsets::FrameScript__LoadWorldScripts); + gCooldown = 0; + +#ifdef _DEBUG + gLastCast = 0; +#endif - auto registerHook = new hadesmem::PatchDetour(process, luaLoadScriptsOrig, &LuaLoadScripts); - registerHook->Apply(); + const hadesmem::Process process(::GetCurrentProcessId()); - LuaToNumber = hadesmem::detail::AliasCast(Offsets::Lua__ToNumber); + // activate spellbar and our own internal cooldown on a successful cast attempt (result from server not available yet) + auto const castSpellOrig = hadesmem::detail::AliasCast(Offsets::CastSpell); + gCastDetour = std::make_unique>(process, castSpellOrig, &CastSpellHook); + gCastDetour->Apply(); - // are we in a game? - unsigned __int64(__stdcall *getPlayerGuid)() = (decltype(getPlayerGuid))(Offsets::GetPlayerGuid); + // prevent spellbar re-activation upon successful cast notification from server + const std::vector patch(5, 0x90); + gCastbarPatch = std::make_unique(process, reinterpret_cast(Offsets::CreateCastbar), patch); + gCastbarPatch->Apply(); - if ((*getPlayerGuid)()) - RegisterLuaFunctions(); + // prevent spell result from the last spell cancelling the cast bar for the next one + gCastbarCancelPatch = std::make_unique(process, reinterpret_cast(Offsets::CancelCastbar), patch); + gCastbarCancelPatch->Apply(); return EXIT_SUCCESS; } - -// note: unloading of the dll is not currently supported \ No newline at end of file diff --git a/nampower/misc.hpp b/nampower/misc.hpp deleted file mode 100644 index 8238e98..0000000 --- a/nampower/misc.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (c) 2017, namreeb (legal@namreeb.org) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those - of the authors and should not be interpreted as representing official policies, - either expressed or implied, of the FreeBSD Project. -*/ - -#pragma once - -#include - -#include - -using LuaLoadScriptsT = void(__cdecl *)(); -using FrameScriptRegisterT = void(__fastcall *)(const char *, DWORD); - -extern double(__fastcall *LuaToNumber)(PVOID, unsigned int); -extern void RegisterLuaFunctions(); -extern void LuaLoadScripts(hadesmem::PatchDetourBase *); - -extern int CastSpellAtTarget(void *); -extern int CastSpellAtMouseover(void *); diff --git a/nampower/nampower.vcxproj b/nampower/nampower.vcxproj index 48dc012..944fa3f 100644 --- a/nampower/nampower.vcxproj +++ b/nampower/nampower.vcxproj @@ -11,20 +11,17 @@ - - - + - - + {ADBF135C-6D72-4F02-98B9-17B5C9BC5B9E} nampower - 10.0.14393.0 + 10.0.17134.0 diff --git a/nampower/nampower.vcxproj.filters b/nampower/nampower.vcxproj.filters index 970ce23..785596a 100644 --- a/nampower/nampower.vcxproj.filters +++ b/nampower/nampower.vcxproj.filters @@ -14,24 +14,15 @@ Source Files - - Source Files - - - Source Files - - + Source Files - - Header Files - - + Header Files - + Header Files diff --git a/nampower/offsets.hpp b/nampower/offsets.hpp index 01b96c5..cfdec38 100644 --- a/nampower/offsets.hpp +++ b/nampower/offsets.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2017, namreeb (legal@namreeb.org) + Copyright (c) 2017-2018, namreeb (legal@namreeb.org) All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,16 +29,16 @@ #pragma once -enum Offsets : DWORD +#include + +enum class Offsets : std::uint32_t { - gTargetGuid = 0xB4E2D8, - gMouseoverGuid = 0xB4E2C8, - gClientConnection = 0xC28128, - gTrampoline1 = 0x7FDF52, // must have at least five bytes of alignment (INT3/0xCC) space and be between 0x401000 and 0x7FEDAC - gTrampoline2 = 0x7FA606, - ClientConnection__SendPacket = 0x5379A0, - FrameScript__LoadWorldScripts = 0x490250, - FrameScript__Register = 0x704120, - GetPlayerGuid = 0x468550, - Lua__ToNumber = 0x6F3620, + CastSpell = 0x6E4B60, + CancelCast = 0x6E4940, + CreateCastbar = 0x6E7A53, + CancelCastbar = 0x06E4A50, + GetCastingTimeIndex = 0x2D, + Language = 0xC0E080, + SignalEvent = 0x703F50, + SpellDb = 0xC0D788, };