Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
文字樣式
變更外觀
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
SBP Dhooks
建立於
7 年前
差異永不過期
清除
匯出
分享
解釋
48 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
141 行
全部複製
9 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
119 行
全部複製
#pragma semicolon 1
#pragma semicolon 1
#include <sourcemod>
#include <sourcemod>
#include <dhooks>
#include <dhooks>
#include <sdktools>
#include <sdktools>
#pragma newdecls required
#pragma newdecls required
Handle g_hClientPrintf = null;
Handle g_hClientPrintf = null;
char g_sLogs[PLATFORM_MAX_PATH + 1];
char g_sLogs[PLATFORM_MAX_PATH + 1];
public Plugin myinfo =
public Plugin myinfo =
{
{
name = "Hide Plugin List",
name = "Hide Plugin List",
複製
已複製
複製
已複製
description = "
",
description = "
Block People From stealing your Plugins
",
author = "
Bara
",
author = "
[PewDiePie]
",
version = "1.0.0",
version = "1.0.0",
複製
已複製
複製
已複製
url = "
https://github.com/Bara
"
url = "
"
};
};
public void OnPluginStart()
public void OnPluginStart()
{
{
Handle gameconf = LoadGameConfigFile("sbp.games");
Handle gameconf = LoadGameConfigFile("sbp.games");
if(gameconf == null)
if(gameconf == null)
{
{
SetFailState("Failed to find sbp.games.txt gamedata");
SetFailState("Failed to find sbp.games.txt gamedata");
delete gameconf;
delete gameconf;
}
}
int offset = GameConfGetOffset(gameconf, "ClientPrintf");
int offset = GameConfGetOffset(gameconf, "ClientPrintf");
if(offset == -1)
if(offset == -1)
{
{
SetFailState("Failed to find offset for ClientPrintf");
SetFailState("Failed to find offset for ClientPrintf");
delete gameconf;
delete gameconf;
}
}
StartPrepSDKCall(SDKCall_Static);
StartPrepSDKCall(SDKCall_Static);
if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface"))
{
{
SetFailState("Failed to get CreateInterface");
SetFailState("Failed to get CreateInterface");
delete gameconf;
delete gameconf;
}
}
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
char identifier[64];
char identifier[64];
if(!GameConfGetKeyValue(gameconf, "EngineInterface", identifier, sizeof(identifier)))
if(!GameConfGetKeyValue(gameconf, "EngineInterface", identifier, sizeof(identifier)))
{
{
SetFailState("Failed to get engine identifier name");
SetFailState("Failed to get engine identifier name");
delete gameconf;
delete gameconf;
}
}
Handle temp = EndPrepSDKCall();
Handle temp = EndPrepSDKCall();
Address addr = SDKCall(temp, identifier, 0);
Address addr = SDKCall(temp, identifier, 0);
delete gameconf;
delete gameconf;
delete temp;
delete temp;
if(!addr)
if(!addr)
{
{
SetFailState("Failed to get engine ptr");
SetFailState("Failed to get engine ptr");
}
}
g_hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
g_hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf);
DHookAddParam(g_hClientPrintf, HookParamType_Edict);
DHookAddParam(g_hClientPrintf, HookParamType_Edict);
DHookAddParam(g_hClientPrintf, HookParamType_CharPtr);
DHookAddParam(g_hClientPrintf, HookParamType_CharPtr);
DHookRaw(g_hClientPrintf, false, addr);
DHookRaw(g_hClientPrintf, false, addr);
char sDate[18];
char sDate[18];
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate);
BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate);
}
}
public MRESReturn Hook_ClientPrintf(Handle hParams)
public MRESReturn Hook_ClientPrintf(Handle hParams)
{
{
char sBuffer[1024];
char sBuffer[1024];
int client = DHookGetParam(hParams, 1);
int client = DHookGetParam(hParams, 1);
if (client == 0)
if (client == 0)
{
{
return MRES_Ignored;
return MRES_Ignored;
}
}
DHookGetParamString(hParams, 2, sBuffer, sizeof(sBuffer));
DHookGetParamString(hParams, 2, sBuffer, sizeof(sBuffer));
if(sBuffer[1] == '"' && (StrContains(sBuffer, "\" (") != -1 || (StrContains(sBuffer, ".smx\" ") != -1)))
if(sBuffer[1] == '"' && (StrContains(sBuffer, "\" (") != -1 || (StrContains(sBuffer, ".smx\" ") != -1)))
{
{
DHookSetParamString(hParams, 2, "");
DHookSetParamString(hParams, 2, "");
return MRES_ChangedHandled;
return MRES_ChangedHandled;
}
}
else if(StrContains(sBuffer, "To see more, type \"sm plugins") != -1)
else if(StrContains(sBuffer, "To see more, type \"sm plugins") != -1)
{
{
if (client > 0 && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client))
if (client > 0 && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client))
{
{
if (CheckCommandAccess(client, "sm_admin", ADMFLAG_ROOT, true))
if (CheckCommandAccess(client, "sm_admin", ADMFLAG_ROOT, true))
{
{
return MRES_Ignored;
return MRES_Ignored;
}
}
複製
已複製
複製
已複製
PrintToConsole(client, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
PrintToConsole(
iC
lient, "
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶GET LOST YOU STEALER¶¶¶¶¶¶¶¶¶
¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶
¶¶¶¶¶¶¶
¶¶¶¶¶¶¶DONT STEAL MY
¶¶¶¶
¶¶¶¶¶
¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶
¶¶¶
¶¶¶¶
¶¶¶
¶¶¶¶
PLUGINS
¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶");
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶CODED BY PEWDIEPIE¶¶¶¶¶¶¶¶¶¶¶");
PrintToConsole(
c
lient, "
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
______
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
______¶¶______¶¶______
¶¶¶¶¶¶¶¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶
¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶");
PrintToConsole(client, " ¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶
¶¶¶\n \
¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶
______
¶¶¶¶¶¶¶
_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶
______
¶¶¶¶¶
______¶¶______¶¶______¶¶______
¶¶¶¶¶\n \
¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶
_______
¶¶¶
_____¶¶______¶¶______
¶¶¶
___
¶¶¶¶
¶¶¶");
PrintToConsole(client, "
¶¶¶¶¶¶¶¶
______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶
________
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
________¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶
__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶
¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n ");
PrintToConsole(client, "\t\tNo chance\n");
PrintToConsole(client, "\t\tNo chance\n");
LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", client);
LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", client);
}
}
return MRES_ChangedHandled;
return MRES_ChangedHandled;
}
}
return MRES_Ignored;
return MRES_Ignored;
}
}
已保存差異
原始文本
開啟檔案
#pragma semicolon 1 #include <sourcemod> #include <dhooks> #include <sdktools> #pragma newdecls required Handle g_hClientPrintf = null; char g_sLogs[PLATFORM_MAX_PATH + 1]; public Plugin myinfo = { name = "Hide Plugin List", description = "", author = "Bara", version = "1.0.0", url = "https://github.com/Bara" }; public void OnPluginStart() { Handle gameconf = LoadGameConfigFile("sbp.games"); if(gameconf == null) { SetFailState("Failed to find sbp.games.txt gamedata"); delete gameconf; } int offset = GameConfGetOffset(gameconf, "ClientPrintf"); if(offset == -1) { SetFailState("Failed to find offset for ClientPrintf"); delete gameconf; } StartPrepSDKCall(SDKCall_Static); if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface")) { SetFailState("Failed to get CreateInterface"); delete gameconf; } PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL); PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain); char identifier[64]; if(!GameConfGetKeyValue(gameconf, "EngineInterface", identifier, sizeof(identifier))) { SetFailState("Failed to get engine identifier name"); delete gameconf; } Handle temp = EndPrepSDKCall(); Address addr = SDKCall(temp, identifier, 0); delete gameconf; delete temp; if(!addr) { SetFailState("Failed to get engine ptr"); } g_hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf); DHookAddParam(g_hClientPrintf, HookParamType_Edict); DHookAddParam(g_hClientPrintf, HookParamType_CharPtr); DHookRaw(g_hClientPrintf, false, addr); char sDate[18]; FormatTime(sDate, sizeof(sDate), "%y-%m-%d"); BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate); } public MRESReturn Hook_ClientPrintf(Handle hParams) { char sBuffer[1024]; int client = DHookGetParam(hParams, 1); if (client == 0) { return MRES_Ignored; } DHookGetParamString(hParams, 2, sBuffer, sizeof(sBuffer)); if(sBuffer[1] == '"' && (StrContains(sBuffer, "\" (") != -1 || (StrContains(sBuffer, ".smx\" ") != -1))) { DHookSetParamString(hParams, 2, ""); return MRES_ChangedHandled; } else if(StrContains(sBuffer, "To see more, type \"sm plugins") != -1) { if (client > 0 && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client)) { if (CheckCommandAccess(client, "sm_admin", ADMFLAG_ROOT, true)) { return MRES_Ignored; } PrintToConsole(client, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶"); PrintToConsole(client, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶"); PrintToConsole(client, " ¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶"); PrintToConsole(client, " ¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n "); PrintToConsole(client, "\t\tNo chance\n"); LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", client); } return MRES_ChangedHandled; } return MRES_Ignored; }
更改後文本
開啟檔案
#pragma semicolon 1 #include <sourcemod> #include <dhooks> #include <sdktools> #pragma newdecls required Handle g_hClientPrintf = null; char g_sLogs[PLATFORM_MAX_PATH + 1]; public Plugin myinfo = { name = "Hide Plugin List", description = "Block People From stealing your Plugins", author = "[PewDiePie]", version = "1.0.0", url = "" }; public void OnPluginStart() { Handle gameconf = LoadGameConfigFile("sbp.games"); if(gameconf == null) { SetFailState("Failed to find sbp.games.txt gamedata"); delete gameconf; } int offset = GameConfGetOffset(gameconf, "ClientPrintf"); if(offset == -1) { SetFailState("Failed to find offset for ClientPrintf"); delete gameconf; } StartPrepSDKCall(SDKCall_Static); if(!PrepSDKCall_SetFromConf(gameconf, SDKConf_Signature, "CreateInterface")) { SetFailState("Failed to get CreateInterface"); delete gameconf; } PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL); PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain); char identifier[64]; if(!GameConfGetKeyValue(gameconf, "EngineInterface", identifier, sizeof(identifier))) { SetFailState("Failed to get engine identifier name"); delete gameconf; } Handle temp = EndPrepSDKCall(); Address addr = SDKCall(temp, identifier, 0); delete gameconf; delete temp; if(!addr) { SetFailState("Failed to get engine ptr"); } g_hClientPrintf = DHookCreate(offset, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, Hook_ClientPrintf); DHookAddParam(g_hClientPrintf, HookParamType_Edict); DHookAddParam(g_hClientPrintf, HookParamType_CharPtr); DHookRaw(g_hClientPrintf, false, addr); char sDate[18]; FormatTime(sDate, sizeof(sDate), "%y-%m-%d"); BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate); } public MRESReturn Hook_ClientPrintf(Handle hParams) { char sBuffer[1024]; int client = DHookGetParam(hParams, 1); if (client == 0) { return MRES_Ignored; } DHookGetParamString(hParams, 2, sBuffer, sizeof(sBuffer)); if(sBuffer[1] == '"' && (StrContains(sBuffer, "\" (") != -1 || (StrContains(sBuffer, ".smx\" ") != -1))) { DHookSetParamString(hParams, 2, ""); return MRES_ChangedHandled; } else if(StrContains(sBuffer, "To see more, type \"sm plugins") != -1) { if (client > 0 && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client)) { if (CheckCommandAccess(client, "sm_admin", ADMFLAG_ROOT, true)) { return MRES_Ignored; } PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶GET LOST YOU STEALER¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶DONT STEAL MY¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶PLUGINS¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶CODED BY PEWDIEPIE¶¶¶¶¶¶¶¶¶¶¶"); PrintToConsole(client, "\t\tNo chance\n"); LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", client); } return MRES_ChangedHandled; } return MRES_Ignored; }
尋找差異