Veteran Member
Join Date: Sep 2013
Location: United Kingdom
|
05-11-2015
, 09:48
[REQ] Wallhack / ESP Scrambler [CSGO]
|
#1
|
Hello everyone, I feel that Sourcemod Anticheat Wallhack Blocker just does not cut things, But I also believe that it has a feature to send fake position data which screws up wallhacks, the only problem is that it is using the old BitBuffer messages and CSGO uses ProtoBuf, I have no idea on how to convert them, could somebody maybe help me?
Heres the code which needs converting.
PHP Code:
/** * CS:S FarESP Blocking */ #define CS_TEAM_NONE 0 /**< No team yet. */ #define CS_TEAM_SPECTATOR 1 /**< Spectators. */ #define CS_TEAM_T 2 /**< Terrorists. */ #define CS_TEAM_CT 3 /**< Counter-Terrorists. */
#define MAX_RADAR_CLIENTS 36 // Max amount of client data we can include in one message.
new UserMsg:g_msgUpdateRadar = INVALID_MESSAGE_ID; new bool:g_bPlayerSpotted[MAXPLAYERS + 1];
new g_iSpottedCache[MAXPLAYERS + 1]; new g_iUpdateFrequency;
new g_iPlayerManager = -1; new g_iPlayerSpotted = -1;
new Handle:g_hCvarForceCamera = INVALID_HANDLE; new bool:g_bForceCamera;
FarESP_Enable() { if ((g_iPlayerManager = GetPlayerResourceEntity()) == -1) return; g_iPlayerSpotted = FindSendPropOffs("CCSPlayerResource", "m_bPlayerSpotted"); SDKHook(g_iPlayerManager, SDKHook_ThinkPost, PlayerManager_ThinkPost); g_msgUpdateRadar = GetUserMessageId("UpdateRadar"); HookUserMessage(g_msgUpdateRadar, Hook_UpdateRadar, true); HookEvent("player_death", FarESP_PlayerDeath, EventHookMode_Pre); g_hCvarForceCamera = FindConVar("mp_forcecamera"); OnForceCameraChanged(g_hCvarForceCamera, "", ""); HookConVarChange(g_hCvarForceCamera, OnForceCameraChanged); g_iUpdateFrequency = TIME_TO_TICK(2.0); g_bFarEspEnabled = true; }
FarESP_Disable() { SDKUnhook(g_iPlayerManager, SDKHook_ThinkPost, PlayerManager_ThinkPost); for (new i = 0; i < sizeof(g_bPlayerSpotted); i++) { g_bPlayerSpotted[i] = false; } UnhookUserMessage(g_msgUpdateRadar, Hook_UpdateRadar, true); UnhookEvent("player_death", FarESP_PlayerDeath, EventHookMode_Pre); UnhookConVarChange(g_hCvarForceCamera, OnForceCameraChanged); g_bFarEspEnabled = false; }
public Action:FarESP_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if (IS_CLIENT(client) && IsClientInGame(client)) { SendRadarClient(client, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS); } return Plugin_Continue; }
public OnForceCameraChanged(Handle:convar, const String:oldValue[], const String:newValue[]) { g_bForceCamera = (GetConVarInt(convar) == 1); }
public OnMapStart() { if (g_bEnabled && !g_bFarEspEnabled && g_Game == Game_CSS) { FarESP_Enable(); } }
public OnMapEnd() { if (g_bFarEspEnabled) { FarESP_Disable(); } }
public Action:Hook_UpdateRadar(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init) { // We will send custom messages only. return Plugin_Handled; }
public PlayerManager_ThinkPost(entity) { if (!g_bFarEspEnabled) return; // Keep track of which players have been spotted. for (new i = 1; i <= MaxClients; i++) { if (g_bProcess[i] && GetEntData(entity, g_iPlayerSpotted + i, 1)) { // Immediately update this client's data. if (!g_bPlayerSpotted[i]) { g_bPlayerSpotted[i] = true; SendRadarClient(i, USERMSG_BLOCKHOOKS); } g_iSpottedCache[i] = g_iTickCount + g_iUpdateFrequency; } else { g_bPlayerSpotted[i] = false; } } }
FarESP_OnGameFrame() { // Send the messages once per second and on different ticks. switch (g_iTickCount%g_iTickRate) { case 0: { SendRadarSpotted(); } case 1: { SendRadarTeam(CS_TEAM_T); } case 2: { SendRadarTeam(CS_TEAM_CT); } case 3: { SendRadarObservers(); } case 4: { SendRadarFakeTeam(CS_TEAM_T); } case 5: { SendRadarFakeTeam(CS_TEAM_CT); } } }
SendRadarSpotted() { // Send scrambled spotted data to all clients. decl iClients[MaxClients]; new numClients, count; for (new i = 1; i <= MaxClients; i++) { if (g_bProcess[i]) { iClients[numClients++] = i; } } if (!numClients) return; decl Float:vOrigin[3], Float:vAngles[3]; new Handle:bf = StartMessageEx(g_msgUpdateRadar, iClients, numClients, USERMSG_BLOCKHOOKS); for (new i = 1; i <= MaxClients && count < MAX_RADAR_CLIENTS; i++) { if (g_bPlayerSpotted[i] && g_bProcess[i]) { GetClientAbsOrigin(i, vOrigin); GetClientAbsAngles(i, vAngles); BfWriteByte(bf, i); BfWriteSBitLong(bf, RoundToNearest(vOrigin[0] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[1] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest((vOrigin[2] - MT_GetRandomFloat(500.0, 1000.0)) / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vAngles[1]), 9); count++; } } BfWriteByte(bf, 0); EndMessage(); }
SendRadarTeam(team) { // Send proper team data to all teammates. decl iClients[MaxClients]; new numClients; for (new i = 1; i <= MaxClients; i++) { // Include dead players observering their teammates. if ((g_bProcess[i] || (g_bForceCamera && g_bIsObserver[i])) && g_iTeam[i] == team) { iClients[numClients++] = i; } } if (!numClients) return; decl Float:vOrigin[3], Float:vAngles[3], client; new Handle:bf = StartMessageEx(g_msgUpdateRadar, iClients, numClients, USERMSG_BLOCKHOOKS); // Limit payload early. if (numClients >= MAX_RADAR_CLIENTS) numClients = MAX_RADAR_CLIENTS - 1; for (new i = 0; i < numClients; i++) { client = iClients[i]; GetClientAbsOrigin(client, vOrigin); GetClientAbsAngles(client, vAngles); BfWriteByte(bf, client); BfWriteSBitLong(bf, RoundToNearest(vOrigin[0] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[1] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[2] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vAngles[1]), 9); } BfWriteByte(bf, 0); EndMessage(); }
SendRadarFakeTeam(team) { // Send fake data to team. decl iReceivers[MaxClients], iSenders[MaxClients]; new numReceivers, numSenders, iReceiver; for (new i = 1; i <= MaxClients; i++) { if (g_bProcess[i]) { if (g_iTeam[i] == team) { iReceivers[numReceivers++] = i; } else if (g_iSpottedCache[i] < g_iTickCount) { iSenders[numSenders++] = i; } } } if (!numReceivers || !numSenders) return; decl Float:vOrigin[3]; new Handle:bf = StartMessageEx(g_msgUpdateRadar, iReceivers, numReceivers, USERMSG_BLOCKHOOKS); // Randomize so that every client is ensured fake data. SortIntegers(iReceivers, numReceivers, Sort_Random); // Randomize the payload before limiting. if (numSenders >= MAX_RADAR_CLIENTS) { SortIntegers(iSenders, numSenders, Sort_Random); numSenders = MAX_RADAR_CLIENTS - 1; } for (new i = 0; i < numSenders; i++) { GetClientAbsOrigin(iReceivers[iReceiver++], vOrigin); BfWriteByte(bf, iSenders[i]); BfWriteSBitLong(bf, RoundToNearest((vOrigin[0] + MT_GetRandomFloat(-1000.0, 1000.0)) / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest((vOrigin[1] + MT_GetRandomFloat(-1000.0, 1000.0)) / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest((vOrigin[2] + MT_GetRandomFloat(-1000.0, 1000.0)) / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(MT_GetRandomFloat(-180.0, 180.0)), 9); if (iReceiver >= numReceivers) iReceiver = 0; } BfWriteByte(bf, 0); EndMessage(); }
SendRadarClient(client, flags) { // A player was spotted and needs to be sent out to all clients. decl iClients[MaxClients]; new numClients, iTeam = g_iTeam[client]; for (new i = 1; i <= MaxClients; i++) { if (g_bProcess[i] && g_iTeam[i] != iTeam) { iClients[numClients++] = i; } } if (!numClients) return; decl Float:vOrigin[3], Float:vAngles[3]; new Handle:bf = StartMessageEx(g_msgUpdateRadar, iClients, numClients, flags); GetClientAbsOrigin(client, vOrigin); GetClientAbsAngles(client, vAngles); BfWriteByte(bf, client); BfWriteSBitLong(bf, RoundToNearest(vOrigin[0] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[1] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest((vOrigin[2] - MT_GetRandomFloat(500.0, 1000.0)) / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vAngles[1]), 9); BfWriteByte(bf, 0); EndMessage(); }
SendRadarObservers() { // Send all player data to all observers. decl iClients[MaxClients]; new numClients, count; for (new i = 1; i <= MaxClients; i++) { // Include teammate-observers if forcecamera is disabled. if (g_bIsObserver[i] && (!g_bForceCamera || g_iTeam[i] <= CS_TEAM_SPECTATOR)) { iClients[numClients++] = i; } } if (!numClients) return; decl Float:vOrigin[3], Float:vAngles[3]; new Handle:bf = StartMessageEx(g_msgUpdateRadar, iClients, numClients, USERMSG_BLOCKHOOKS); for (new i = 1; i <= MaxClients && count < MAX_RADAR_CLIENTS; i++) { if (g_bProcess[i]) { GetClientAbsOrigin(i, vOrigin); GetClientAbsAngles(i, vAngles); BfWriteByte(bf, i); BfWriteSBitLong(bf, RoundToNearest(vOrigin[0] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[1] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vOrigin[2] / 4.0), 13); BfWriteSBitLong(bf, RoundToNearest(vAngles[1]), 9); count++; } } BfWriteByte(bf, 0); EndMessage(); }
I would highly appreciate it, as it would help put an end to wallhackers.
Many Thanks.
|
|