@@ -231,10 +231,12 @@ namespace updater {
|
|||||||
offsets::m_iHealth = data["m_iHealth"];
|
offsets::m_iHealth = data["m_iHealth"];
|
||||||
if (data["m_hPlayerPawn"].is_number())
|
if (data["m_hPlayerPawn"].is_number())
|
||||||
offsets::m_hPlayerPawn = data["m_hPlayerPawn"];
|
offsets::m_hPlayerPawn = data["m_hPlayerPawn"];
|
||||||
if (data["dwSanitizedName"].is_number())
|
|
||||||
offsets::m_sSanitizedPlayerName = data["m_sSanitizedPlayerName"];
|
|
||||||
if (data["m_iTeamNum"].is_number())
|
if (data["m_iTeamNum"].is_number())
|
||||||
offsets::m_iTeamNum = data["m_iTeamNum"];
|
offsets::m_iTeamNum = data["m_iTeamNum"];
|
||||||
|
if (data["m_hController"].is_number())
|
||||||
|
offsets::m_hController = data["m_hController"];
|
||||||
|
if (data["m_iszPlayerName"].is_number())
|
||||||
|
offsets::m_iszPlayerName = data["m_iszPlayerName"];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -266,8 +268,9 @@ namespace updater {
|
|||||||
data["m_ArmorValue"] = offsets::m_ArmorValue;
|
data["m_ArmorValue"] = offsets::m_ArmorValue;
|
||||||
data["m_iHealth"] = offsets::m_iHealth;
|
data["m_iHealth"] = offsets::m_iHealth;
|
||||||
data["m_hPlayerPawn"] = offsets::m_hPlayerPawn;
|
data["m_hPlayerPawn"] = offsets::m_hPlayerPawn;
|
||||||
data["m_sSanitizedPlayerName"] = offsets::m_sSanitizedPlayerName;
|
|
||||||
data["m_iTeamNum"] = offsets::m_iTeamNum;
|
data["m_iTeamNum"] = offsets::m_iTeamNum;
|
||||||
|
data["m_hController"] = offsets::m_hController;
|
||||||
|
data["m_iszPlayerName"] = offsets::m_iszPlayerName;
|
||||||
|
|
||||||
std::ofstream output(file_path);
|
std::ofstream output(file_path);
|
||||||
output << std::setw(4) << data << std::endl;
|
output << std::setw(4) << data << std::endl;
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ namespace updater {
|
|||||||
inline std::ptrdiff_t m_ArmorValue = 0x0;
|
inline std::ptrdiff_t m_ArmorValue = 0x0;
|
||||||
inline std::ptrdiff_t m_iHealth = 0x0;
|
inline std::ptrdiff_t m_iHealth = 0x0;
|
||||||
inline std::ptrdiff_t m_hPlayerPawn = 0x0;
|
inline std::ptrdiff_t m_hPlayerPawn = 0x0;
|
||||||
inline std::ptrdiff_t m_sSanitizedPlayerName = 0x0;
|
|
||||||
inline std::ptrdiff_t m_iTeamNum = 0x0;
|
inline std::ptrdiff_t m_iTeamNum = 0x0;
|
||||||
|
inline std::ptrdiff_t m_hController = 0x0;
|
||||||
|
inline std::ptrdiff_t m_iszPlayerName = 0x0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,11 +139,23 @@ void CGame::loop() {
|
|||||||
* player.is_spotted = process->read<bool>(player.spottedState + 0x8); // bSpotted
|
* player.is_spotted = process->read<bool>(player.spottedState + 0x8); // bSpotted
|
||||||
*/
|
*/
|
||||||
|
|
||||||
playerNameData = process->read<uintptr_t>(player.entity + updater::offsets::m_sSanitizedPlayerName);
|
// Read entity controller from the player pawn
|
||||||
char buffer[256];
|
uintptr_t handle = process->read<std::uintptr_t>(player.pCSPlayerPawn + updater::offsets::m_hController);
|
||||||
process->read_raw(playerNameData, buffer, sizeof(buffer));
|
int index = handle & 0x7FFF;
|
||||||
std::string name = std::string(buffer);
|
int segment = index >> 9;
|
||||||
player.name = name;
|
int entry = index & 0x1FF;
|
||||||
|
|
||||||
|
uintptr_t controllerListSegment = process->read<uintptr_t>(entity_list + 0x8 * segment + 0x10);
|
||||||
|
uintptr_t controller = process->read<uintptr_t>(controllerListSegment + 120 * entry);
|
||||||
|
|
||||||
|
if (!controller)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Read player name from the controller
|
||||||
|
char buffer[256] = {};
|
||||||
|
process->read_raw(controller + updater::offsets::m_iszPlayerName, buffer, sizeof(buffer) - 1);
|
||||||
|
buffer[sizeof(buffer) - 1] = '\0';
|
||||||
|
player.name = buffer;
|
||||||
|
|
||||||
player.gameSceneNode = process->read<uintptr_t>(player.pCSPlayerPawn + updater::offsets::m_pGameSceneNode);
|
player.gameSceneNode = process->read<uintptr_t>(player.pCSPlayerPawn + updater::offsets::m_pGameSceneNode);
|
||||||
player.origin = process->read<Vector3>(player.pCSPlayerPawn + updater::offsets::m_vOldOrigin);
|
player.origin = process->read<Vector3>(player.pCSPlayerPawn + updater::offsets::m_vOldOrigin);
|
||||||
|
|||||||
@@ -22,5 +22,7 @@
|
|||||||
"m_szName": 3360,
|
"m_szName": 3360,
|
||||||
"m_vOldOrigin": 4900,
|
"m_vOldOrigin": 4900,
|
||||||
"m_vecAbsOrigin": 208,
|
"m_vecAbsOrigin": 208,
|
||||||
"dwLocalPlayerController": 27602208
|
"dwLocalPlayerController": 27602208,
|
||||||
|
"m_hController": 3112,
|
||||||
|
"m_iszPlayerName": 1360
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,10 @@ offsets_json["m_flTimerLength"] = client_json_base["C_PlantedC4"]["fields"]["m_f
|
|||||||
offsets_json["m_hPlayerPawn"] = client_json_base["CCSPlayerController"]["fields"]["m_hPlayerPawn"]
|
offsets_json["m_hPlayerPawn"] = client_json_base["CCSPlayerController"]["fields"]["m_hPlayerPawn"]
|
||||||
offsets_json["m_iAccount"] = client_json_base["CCSPlayerController_InGameMoneyServices"]["fields"]["m_iAccount"]
|
offsets_json["m_iAccount"] = client_json_base["CCSPlayerController_InGameMoneyServices"]["fields"]["m_iAccount"]
|
||||||
offsets_json["m_pInGameMoneyServices"] = client_json_base["CCSPlayerController"]["fields"]["m_pInGameMoneyServices"]
|
offsets_json["m_pInGameMoneyServices"] = client_json_base["CCSPlayerController"]["fields"]["m_pInGameMoneyServices"]
|
||||||
offsets_json["m_sSanitizedPlayerName"] = client_json_base["CCSPlayerController"]["fields"]["m_sSanitizedPlayerName"]
|
|
||||||
|
offsets_json["m_sSanitizedPlayerName"] = client_json_base["CCSPlayerController"]["fields"]["m_sSanitizedPlayerName"] # Added for backwards compatibility, this is the same as m_iszPlayerName
|
||||||
|
offsets_json["m_hController"] = client_json_base["C_BasePlayerPawn"]["fields"]["m_hController"]
|
||||||
|
offsets_json["m_iszPlayerName"] = client_json_base["C_BasePlayerController"]["fields"]["m_iszPlayerName"]
|
||||||
|
|
||||||
offsets_json["m_iHealth"] = client_json_base["C_BaseEntity"]["fields"]["m_iHealth"]
|
offsets_json["m_iHealth"] = client_json_base["C_BaseEntity"]["fields"]["m_iHealth"]
|
||||||
offsets_json["m_iTeamNum"] = client_json_base["C_BaseEntity"]["fields"]["m_iTeamNum"]
|
offsets_json["m_iTeamNum"] = client_json_base["C_BaseEntity"]["fields"]["m_iTeamNum"]
|
||||||
|
|||||||
Reference in New Issue
Block a user