This commit is contained in:
Oscar
2025-07-17 13:52:06 +03:00
commit 2f50c8a911
206 changed files with 246874 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
#include "../../../cs2/datatypes/schema/ISchemaClass/ISchemaClass.h"
#include "../players.h"
#include "playerHook.h"
#include <iostream>
/*
// @READ ME: This should be storing Handles and not address pointers
// it s hould store C_BaseEntity Handle
// which can later globally be used to grab its right instance
void onAddEntityHook(__int64 CGameEntitySystem, void* entityPointer, int entityHandle) {
if (!entityPointer || !CGameEntitySystem || !entityHandle) {
oOnAddEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
uintptr_t uEntityPointer = reinterpret_cast<uintptr_t>(entityPointer);
SchemaClassInfoData_t* entityInfo = nullptr;
GetSchemaClassInfo(uEntityPointer, &entityInfo);
if (entityInfo == nullptr) {
oOnAddEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
if (strcmp(entityInfo->szName, "C_CSPlayerPawn") == 0) {
Players::pawns.emplace_back(uEntityPointer);
std::cout << "Added pawn " << Players::pawns.size() << "\n";
oOnAddEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
if (strcmp(entityInfo->szName, "CCSPlayerController") == 0) {
Players::controllers.emplace_back(uEntityPointer);
oOnAddEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
oOnAddEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
void onRemoveEntityHook(__int64 CGameEntitySystem, void* entityPointer, int entityHandle) {
if (!entityPointer || !CGameEntitySystem || !entityHandle) {
oOnRemoveEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
uintptr_t uEntityPointer = reinterpret_cast<uintptr_t>(entityPointer);
SchemaClassInfoData_t* entityInfo = nullptr;
GetSchemaClassInfo(uEntityPointer, &entityInfo);
if (strcmp(entityInfo->szName, "C_CSPlayerPawn") == 0) {
for (auto it = Players::pawns.begin(); it != Players::pawns.end(); ++it) {
if (it->getAddress() == uEntityPointer) {
Players::pawns.erase(it);
std::cout << "Removed pawn " << Players::pawns.size();
break;
}
}
}
if (strcmp(entityInfo->szName, "CCSPlayerController") == 0) {
for (auto it = Players::controllers.begin(); it != Players::controllers.end(); ++it) {
if (it->getAddress() == uEntityPointer) {
Players::controllers.erase(it);
break;
}
}
}
oOnRemoveEntity(CGameEntitySystem, entityPointer, entityHandle);
return;
}
onAddEntity oOnAddEntity = nullptr;
onRemoveEntity oOnRemoveEntity = nullptr;*/

View File

@@ -0,0 +1,21 @@
#pragma once
#include "../../hooks/includeHooks.h"
typedef void(__fastcall* onAddEntity)(__int64 CGameEntitySystem, void* entityPointer, int entityHandle);
extern onAddEntity oOnAddEntity;
// @Author: basmannetjeeee
// @IDA:
// Signature: 48 89 74 24 ? 57 48 83 EC ? 48 8B F9 41 8B C0 B9
// __int64 __fastcall sub_651290(__int64 a1, __int64 a2, int a3)
void onAddEntityHook(__int64 CGameEntitySystem, void* entityPointer, int entityHandle);
typedef void(__fastcall* onRemoveEntity)(__int64 CGameEntitySystem, void* entityPointer, int entityHandle);
extern onRemoveEntity oOnRemoveEntity;
// @Author: basmannetjeeee
// @IDA:
// Signature: 48 89 74 24 ? 57 48 83 EC ? 48 8B F9 41 8B C0 25
// __int64 __fastcall sub_651890(__int64 a1, _QWORD *a2, int a3)
void onRemoveEntityHook(__int64 CGameEntitySystem, void* entityPointer, int entityHandle);

View File

@@ -0,0 +1,5 @@
#include "players.h"
#include "../offsets/offsets.h"
//@not used anymore
//std::vector<CCSPlayerController> Players::controllers;
//std::vector<C_CSPlayerPawn> Players::pawns;

View File

@@ -0,0 +1,8 @@
#pragma once
#include "../../cs2/entity/CCSPlayerController/CCSPlayerController.h"
#include "../../cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h"
#include <cstdint>
#include <vector>
//@not used anymore