diff options
author | davidebeatrici <davidebeatrici@gmail.com> | 2016-06-24 00:32:22 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-06-24 00:32:37 +0300 |
commit | ed8748dc07536c2ca67f2e803bf183c20826ee42 (patch) | |
tree | 5d75edf1cccafdd15b96a9b4bbc9ad358a2c295f /plugins/bf4_x86 | |
parent | 51af7852474d92a7d0514a0f57903551c3595f97 (diff) |
plugins: update memory addresses retrieval to use procptr32_t/procptr64_t.
Diffstat (limited to 'plugins/bf4_x86')
-rw-r--r-- | plugins/bf4_x86/bf4_x86.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/bf4_x86/bf4_x86.cpp b/plugins/bf4_x86/bf4_x86.cpp index 72777ac2e..362b6fd98 100644 --- a/plugins/bf4_x86/bf4_x86.cpp +++ b/plugins/bf4_x86/bf4_x86.cpp @@ -3,7 +3,7 @@ // that can be found in the LICENSE file at the root of the // Mumble source tree or at <https://www.mumble.info/LICENSE>. -#include "../mumble_plugin_win32.h" // Include standard plugin header. +#include "../mumble_plugin_win32_x86.h" // Include standard plugin header. #include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape". static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &identity) { @@ -16,35 +16,35 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa BYTE squad, squad_leader, squad_state; // Server ID pointers - BYTE *serverid_base = peekProc<BYTE *>(pModule + 0x01BEBC04); + procptr32_t serverid_base = peekProc<procptr32_t>(pModule + 0x01BEBC04); if (!serverid_base) return false; - BYTE *serverid_offset_0 = peekProc<BYTE *>(serverid_base + 0xC); + procptr32_t serverid_offset_0 = peekProc<procptr32_t>(serverid_base + 0xC); if (!serverid_offset_0) return false; - BYTE *serverid_offset_1 = peekProc<BYTE *>(serverid_offset_0 + 0x14); + procptr32_t serverid_offset_1 = peekProc<procptr32_t>(serverid_offset_0 + 0x14); if (!serverid_offset_1) return false; - BYTE *serverid_offset = peekProc<BYTE *>(serverid_offset_1 + 0x1D0); + procptr32_t serverid_offset = peekProc<procptr32_t>(serverid_offset_1 + 0x1D0); if (!serverid_offset) return false; // Squad pointers - BYTE *squad_base = peekProc<BYTE *>(pModule + 0x01BEBC90); + procptr32_t squad_base = peekProc<procptr32_t>(pModule + 0x01BEBC90); if (!squad_base) return false; - BYTE *squad_offset_0 = peekProc<BYTE *>(squad_base + 0x7C); + procptr32_t squad_offset_0 = peekProc<procptr32_t>(squad_base + 0x7C); if (!squad_offset_0) return false; - BYTE *squad_offset_1 = peekProc<BYTE *>(squad_offset_0 + 0x728); + procptr32_t squad_offset_1 = peekProc<procptr32_t>(squad_offset_0 + 0x728); if (!squad_offset_1) return false; // Peekproc and assign game addresses to our containers, so we can retrieve positional data - ok = peekProc((BYTE *) pModule + 0x1BB6AC2, &state, 1) && // Magical state value: 0 when in-game and 1 when in menu/dead. - peekProc((BYTE *) pModule + 0x1BB3C30, avatar_pos, 12) && // Avatar Position values (X, Y and Z). - peekProc((BYTE *) pModule + 0x1BB6A90, camera_pos, 12) && // Camera Position values (X, Y and Z). - peekProc((BYTE *) pModule + 0x1BB6A70, avatar_top, 12) && // Avatar Top Vector values (X, Y and Z). - peekProc((BYTE *) pModule + 0x1BB6A80, avatar_front, 12) && // Avatar Front Vector values (X, Y and Z). - peekProc((BYTE *) serverid_offset, serverid) && // Server ID (36 characters). - peekProc((BYTE *) pModule + 0x1BA8A10, host) && // Host value: "IP:Port" when in a server, "bot" when loading and empty when it's hidden. - peekProc((BYTE *) pModule + 0x1C814B5, team) && // Team value: US (United States); RU (Russia); CH (China). - peekProc((BYTE *) squad_offset_1 + 0x15C, squad) && // Squad value: 0 (not in a squad); 1 (Alpha); 2 (Bravo); 3 (Charlie)... 26 (Zulu). - peekProc((BYTE *) squad_offset_1 + 0x160, squad_leader) && // Squad leader value: 0 (False); 1 (True). - peekProc((BYTE *) squad_offset_1 + 0x161, squad_state); // Squad state value: 0 (Public); 1 (Private). + ok = peekProc(pModule + 0x1BB6AC2, &state, 1) && // Magical state value: 0 when in-game and 1 when in menu/dead. + peekProc(pModule + 0x1BB3C30, avatar_pos, 12) && // Avatar Position values (X, Y and Z). + peekProc(pModule + 0x1BB6A90, camera_pos, 12) && // Camera Position values (X, Y and Z). + peekProc(pModule + 0x1BB6A70, avatar_top, 12) && // Avatar Top Vector values (X, Y and Z). + peekProc(pModule + 0x1BB6A80, avatar_front, 12) && // Avatar Front Vector values (X, Y and Z). + peekProc(serverid_offset, serverid) && // Server ID (36 characters). + peekProc(pModule + 0x1BA8A10, host) && // Host value: "IP:Port" when in a server, "bot" when loading and empty when it's hidden. + peekProc(pModule + 0x1C814B5, team) && // Team value: US (United States); RU (Russia); CH (China). + peekProc(squad_offset_1 + 0x15C, squad) && // Squad value: 0 (not in a squad); 1 (Alpha); 2 (Bravo); 3 (Charlie)... 26 (Zulu). + peekProc(squad_offset_1 + 0x160, squad_leader) && // Squad leader value: 0 (False); 1 (True). + peekProc(squad_offset_1 + 0x161, squad_state); // Squad state value: 0 (Public); 1 (Private). // This prevents the plugin from linking to the game in case something goes wrong during values retrieval from memory addresses. if (! ok) { |