Skip to content
Permalink
Browse files

Merge PR #2999: plugins/bf4: update plugin to work with version 1.8.2…

….48475
  • Loading branch information...
mkrautz committed Apr 6, 2017
2 parents a69916b + f56074b commit e7e61970285f75853bcbef2604925f923eaa323a
Showing with 20 additions and 20 deletions.
  1. +10 −10 plugins/bf4/bf4.cpp
  2. +10 −10 plugins/bf4_x86/bf4_x86.cpp
@@ -16,7 +16,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
BYTE squad, squad_leader, squad_state;

// Server ID pointers
procptr64_t serverid_base = peekProc<procptr64_t>(pModule + 0x02210658);
procptr64_t serverid_base = peekProc<procptr64_t>(pModule + 0x23D5368);
if (!serverid_base) return false;
procptr64_t serverid_offset_0 = peekProc<procptr64_t>(serverid_base + 0x18);
if (!serverid_offset_0) return false;
@@ -26,7 +26,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (!serverid_offset) return false;

// Squad pointers
procptr64_t squad_base = peekProc<procptr64_t>(pModule + 0x02210718);
procptr64_t squad_base = peekProc<procptr64_t>(pModule + 0x23D5458);
if (!squad_base) return false;
procptr64_t squad_offset_0 = peekProc<procptr64_t>(squad_base + 0xD8);
if (!squad_offset_0) return false;
@@ -36,14 +36,14 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (!squad_offset_2) return false;

// Peekproc and assign game addresses to our containers, so we can retrieve positional data
ok = peekProc(pModule + 0x21CAFF0, &state, 1) && // Magical state value: 0 when in-game and 1 when in menu/dead.
peekProc(pModule + 0x21C6D40, avatar_pos, 12) && // Avatar Position values (X, Y and Z).
peekProc(pModule + 0x21CAF80, camera_pos, 12) && // Camera Position values (X, Y and Z).
peekProc(pModule + 0x21CAF60, avatar_top, 12) && // Avatar Top Vector values (X, Y and Z).
peekProc(pModule + 0x21CAF70, avatar_front, 12) && // Avatar Front Vector values (X, Y and Z).
ok = peekProc(pModule + 0x23B2D70, &state, 1) && // Magical state value: 0 when in-game and 1 when in menu/dead.
peekProc(pModule + 0x23862C0, avatar_pos, 12) && // Avatar Position values (X, Y and Z).
peekProc(pModule + 0x23B2F60, camera_pos, 12) && // Camera Position values (X, Y and Z).
peekProc(pModule + 0x23B2F40, avatar_top, 12) && // Avatar Top Vector values (X, Y and Z).
peekProc(pModule + 0x23B2F50, avatar_front, 12) && // Avatar Front Vector values (X, Y and Z).
peekProc(serverid_offset, serverid) && // Server ID (36 characters).
peekProc(pModule + 0x21B80C0, host) && // Host value: "IP:Port" when in a server, "bot" when loading and empty when it's hidden.
peekProc(pModule + 0x24AFAE5, team) && // Team value: US (United States); RU (Russia); CH (China).
peekProc(pModule + 0x2378B60, host) && // Host value: "IP:Port" when in a server, "bot" when loading and empty when it's hidden.
peekProc(pModule + 0x2674B35, team) && // Team value: US (United States); RU (Russia); CH (China).
peekProc(squad_offset_2 + 0x230, squad) && // Squad value: 0 (not in a squad); 1 (Alpha); 2 (Bravo); 3 (Charlie)... 26 (Zulu).
peekProc(squad_offset_2 + 0x234, squad_leader) && // Squad leader value: 0 (False); 1 (True).
peekProc(squad_offset_2 + 0x235, squad_state); // Squad state value: 0 (Public); 1 (Private).
@@ -205,7 +205,7 @@ static const std::wstring longdesc() {
return std::wstring(L"Supports Battlefield 4 with context and identity support."); // Plugin long description
}

static std::wstring description(L"Battlefield 4 (x64) version 1.7.2.45672"); // Plugin short description
static std::wstring description(L"Battlefield 4 (x64) version 1.8.2.48475"); // Plugin short description
static std::wstring shortname(L"Battlefield 4"); // Plugin short name

static int trylock1() {
@@ -16,7 +16,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
BYTE squad, squad_leader, squad_state;

// Server ID pointers
procptr32_t serverid_base = peekProc<procptr32_t>(pModule + 0x01BEBC04);
procptr32_t serverid_base = peekProc<procptr32_t>(pModule + 0x1D39C64);
if (!serverid_base) return false;
procptr32_t serverid_offset_0 = peekProc<procptr32_t>(serverid_base + 0xC);
if (!serverid_offset_0) return false;
@@ -26,22 +26,22 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (!serverid_offset) return false;

// Squad pointers
procptr32_t squad_base = peekProc<procptr32_t>(pModule + 0x01BEBC90);
procptr32_t squad_base = peekProc<procptr32_t>(pModule + 0x1D39D0C);
if (!squad_base) return false;
procptr32_t squad_offset_0 = peekProc<procptr32_t>(squad_base + 0x7C);
if (!squad_offset_0) return false;
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(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).
ok = peekProc(pModule + 0x1D23B0E, &state, 1) && // Magical state value: 0 when in-game and 1 when in menu/dead.
peekProc(pModule + 0x1CFD3C0, avatar_pos, 12) && // Avatar Position values (X, Y and Z).
peekProc(pModule + 0x1D23CB0, camera_pos, 12) && // Camera Position values (X, Y and Z).
peekProc(pModule + 0x1D23C90, avatar_top, 12) && // Avatar Top Vector values (X, Y and Z).
peekProc(pModule + 0x1D23CA0, 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(pModule + 0x1CF3A68, host) && // Host value: "IP:Port" when in a server, "bot" when loading and empty when it's hidden.
peekProc(pModule + 0x1DCF695, 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).
@@ -203,7 +203,7 @@ static const std::wstring longdesc() {
return std::wstring(L"Supports Battlefield 4 with context and identity support."); // Plugin long description
}

static std::wstring description(L"Battlefield 4 (x86) version 1.7.2.45672"); // Plugin short description
static std::wstring description(L"Battlefield 4 (x86) version 1.8.2.48475"); // Plugin short description
static std::wstring shortname(L"Battlefield 4"); // Plugin short name

static int trylock1() {

0 comments on commit e7e6197

Please sign in to comment.
You can’t perform that action at this time.