Add Steam Exploit Support? (solved)

Coding Help/Re-API Supported
Post Reply
User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

Add Steam Exploit Support? (solved)

#1

Post by ArminC » 1 Year Ago

Hey, this is the 100th request :D So: I got a plugin that make a message on background at loading.. but.. it's declined by the shield of client.. can you add an exploit or something like that? (This plugin store that message in a cvar to the client I think.. and the client block that cvar/info/message)

Code: Select all

#include <amxmodx>

#define VERSION "0.7.0"

#define MAXPLAYERS 32 + 1

//Cells for user info storage
#define TEMP_CELLS 33

//Time after player reconnect to remove player info. Used to remove it if player disconnects after reconnect
#define RECONNECT_TASK_TIME 3.0

//User info store methods
enum
{
	STORE_STEAM = 1,
	STORE_IP
}

//Connect Messages are stored here
new g_Messages[3][192]

//Cells currently occupied by user info's
new g_CurCells

//A multi-dimensional array that holds player info
new g_PlayerReconnectInfo[TEMP_CELLS][33]

//Cvars
new c_OnOff,c_Message,c_Token,c_StoreType

public plugin_init() {
	
	register_plugin("Loading Messages",VERSION,"Sneaky.amxx")
	
	register_cvar("servconmsg",VERSION,FCVAR_SERVER|FCVAR_SPONLY)
	
	//Cvars
	c_OnOff = register_cvar("css_connect_msg_on","1")
	c_Token = register_cvar("css_connect_msg_token","$")
	c_Message = register_cvar("css_conmsg"," | |_    (_)           (_)    \ \ $ | '   \  | |            _       | |$ |_||_| |_|           (_)     | |$                          /_/ ")
	c_StoreType = register_cvar("css_connect_store_type","2")	//1 - steamid, 2 - ip
	
	new tStr[192],Token[2]
	
	//Get Connect Messages from cvars
	get_pcvar_string(c_Message,tStr,191)
	get_pcvar_string(c_Token,Token,1)
	
	//Write them to a global array
	for(new i=0;i < 3;i++) strtok(tStr,g_Messages[i],191,tStr,191,Token[0])
}

public client_connect(id) {
	
	//Check if user hasn't already been forced to reconnect and check if he isn't a bot
	if(!CheckReconnect(id) && get_pcvar_num(c_OnOff) && !is_user_bot(id)) {
		
		//Set player cvars
		static i
		
		for(i = 1; i < 3; i++) client_cmd(id,"scr_connectmsg%d ^"%s^"",i,g_Messages[i])
		
		client_cmd(id,"scr_connectmsg ^"%s^"",g_Messages[0])
		
		//Store player Info
		switch(get_pcvar_num(c_StoreType)) {
			
			case STORE_STEAM : {
				
				get_user_authid(id,g_PlayerReconnectInfo[g_CurCells],32)
			}
			
			case STORE_IP : {
				
				get_user_ip(id,g_PlayerReconnectInfo[g_CurCells],32)
			}
		}
		
		//Set the time the user info will be automatically removed if user doesn't reconnect
		set_task(RECONNECT_TASK_TIME,"RemoveCell",_,g_PlayerReconnectInfo[g_CurCells],32)
		
		g_CurCells++
		
		//Force user to reconnect
		client_cmd(id,"reconnect")
	}
}

public RemoveCell(Data[]) {
	
	new i
	
	for(i = 0; i < g_CurCells; i++) {
		
		if(equal(Data,g_PlayerReconnectInfo[i])) {
			
			MoveCellsUp(i)
		}
	}
}
	

public client_disconnect(id) remove_task(id)

//Make a 1 second delay after user has joined the game to remove those connect messages
public client_putinserver(id) if(get_pcvar_num(c_OnOff) && !is_user_bot(id)) set_task(1.0,"ClearPlayerMessages",id)

public ClearPlayerMessages(id) {
	
	//Reset player cvars
	new i
	
	for(i = 1; i < 3; i++) client_cmd(id,"scr_connectmsg%d ^"^"",i)
	
	client_cmd(id,"scr_connectmsg ^"^"")
}

public CheckReconnect(id) {
	
	new SteamID_IP[33],i
	
	switch(get_pcvar_num(c_StoreType)) {
		
		case STORE_STEAM : {
			
			get_user_authid(id,SteamID_IP,32)
		}
		
		case STORE_IP : {
			
			get_user_ip(id,SteamID_IP,32)
		}
	}
	
	//Compare every info cell to player info. If it matches then return true and clean his info cell.
	for(i = 0; i < g_CurCells; i++) {
		
		if(equal(SteamID_IP,g_PlayerReconnectInfo[i])) {
			
			MoveCellsUp(i)
			
			return true
		}
	}
	
	//If no matching info was found - return false
	return false
}

public MoveCellsUp(Line) {

	new i
	
	for(i = Line; i < g_CurCells - 1; i++) {
		
		copy(g_PlayerReconnectInfo[i],191,g_PlayerReconnectInfo[i+1])
	}
	
	g_CurCells--
}
Last edited by ArminC on 07 Feb 2018, 13:19, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#2

Post by Raheem » 1 Year Ago

I don't understand what this do but if you need it to work with steam clients you will replace client_cmd() with this stock:
  • Code: Select all

    stock Send_Cmd(id, szText[])
    {
    	message_begin(MSG_ONE, SVC_DIRECTOR, {0, 0, 0}, id)
    	write_byte(strlen(szText) + 2)
    	write_byte(10)
    	write_string(szText)
    	message_end()
    }
You don't know? Learn and you will know.

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#3

Post by ArminC » 1 Year Ago

My client shield is blocking command: scr_connectmsg .. wich set the message of Loading... background.

// C:\Users\armin\Desktop\Compiler\loading_messages.sma(58) : error 088: number of arguments does not match definition
// C:\Users\armin\Desktop\Compiler\loading_messages.sma(60) : error 088: number of arguments does not match definition
// C:\Users\armin\Desktop\Compiler\loading_messages.sma(110) : error 088: number of arguments does not match definition

Can you edit the plugin for me?

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#4

Post by Raheem » 1 Year Ago

This stock not support formatting so use formatex() function like:
  • Code: Select all

    #include <amxmodx>
    
    #define VERSION "0.7.0"
    
    #define MAXPLAYERS 32 + 1
    
    //Cells for user info storage
    #define TEMP_CELLS 33
    
    //Time after player reconnect to remove player info. Used to remove it if player disconnects after reconnect
    #define RECONNECT_TASK_TIME 3.0
    
    //User info store methods
    enum
    {
    	STORE_STEAM = 1,
    	STORE_IP
    }
    
    //Connect Messages are stored here
    new g_Messages[3][192]
    
    //Cells currently occupied by user info's
    new g_CurCells
    
    //A multi-dimensional array that holds player info
    new g_PlayerReconnectInfo[TEMP_CELLS][33]
    
    //Cvars
    new c_OnOff,c_Message,c_Token,c_StoreType
    
    public plugin_init() {
    	
    	register_plugin("Loading Messages",VERSION,"Sneaky.amxx")
    	
    	register_cvar("servconmsg",VERSION,FCVAR_SERVER|FCVAR_SPONLY)
    	
    	//Cvars
    	c_OnOff = register_cvar("css_connect_msg_on","1")
    	c_Token = register_cvar("css_connect_msg_token","$")
    	c_Message = register_cvar("css_conmsg"," | |_    (_)           (_)    \ \ $ | '   \  | |            _       | |$ |_||_| |_|           (_)     | |$                          /_/ ")
    	c_StoreType = register_cvar("css_connect_store_type","2")	//1 - steamid, 2 - ip
    	
    	new tStr[192],Token[2]
    	
    	//Get Connect Messages from cvars
    	get_pcvar_string(c_Message,tStr,191)
    	get_pcvar_string(c_Token,Token,1)
    	
    	//Write them to a global array
    	for(new i=0;i < 3;i++) strtok(tStr,g_Messages[i],191,tStr,191,Token[0])
    }
    
    public client_connect(id) {
    	
    	//Check if user hasn't already been forced to reconnect and check if he isn't a bot
    	if(!CheckReconnect(id) && get_pcvar_num(c_OnOff) && !is_user_bot(id)) {
    		
    		//Set player cvars
    		static i
    		new szCommand1[100]
    		formatex(szCommand1, charsmax(szCommand1), "scr_connectmsg %d ^"%s^"", i, g_Messages[i])
    		
    		new szCommand2[100]
    		formatex(szCommand2, charsmax(szCommand2), "scr_connectmsg ^"%s^"", g_Messages[i])
    		
    		for(i = 1; i < 3; i++) Send_Cmd(id,szCommand1)
    		
    		Send_Cmd(id,szCommand2)
    		
    		//Store player Info
    		switch(get_pcvar_num(c_StoreType)) {
    			
    			case STORE_STEAM : {
    				
    				get_user_authid(id,g_PlayerReconnectInfo[g_CurCells],32)
    			}
    			
    			case STORE_IP : {
    				
    				get_user_ip(id,g_PlayerReconnectInfo[g_CurCells],32)
    			}
    		}
    		
    		//Set the time the user info will be automatically removed if user doesn't reconnect
    		set_task(RECONNECT_TASK_TIME,"RemoveCell",_,g_PlayerReconnectInfo[g_CurCells],32)
    		
    		g_CurCells++
    		
    		//Force user to reconnect
    		Send_Cmd(id,"reconnect")
    	}
    }
    
    public RemoveCell(Data[]) {
    	
    	new i
    	
    	for(i = 0; i < g_CurCells; i++) {
    		
    		if(equal(Data,g_PlayerReconnectInfo[i])) {
    			
    			MoveCellsUp(i)
    		}
    	}
    }
    	
    
    public client_disconnect(id) remove_task(id)
    
    //Make a 1 second delay after user has joined the game to remove those connect messages
    public client_putinserver(id) if(get_pcvar_num(c_OnOff) && !is_user_bot(id)) set_task(1.0,"ClearPlayerMessages",id)
    
    public ClearPlayerMessages(id) {
    	
    	//Reset player cvars
    	new i, szCommand[60]
    	formatex(szCommand, charsmax(szCommand), "scr_connectmsg %d ^"^"", i)
    	
    	for(i = 1; i < 3; i++) Send_Cmd(id, szCommand)
    
    	Send_Cmd(id, "scr_connectmsg ^"^"")
    }
    
    public CheckReconnect(id) {
    	
    	new SteamID_IP[33],i
    	
    	switch(get_pcvar_num(c_StoreType)) {
    		
    		case STORE_STEAM : {
    			
    			get_user_authid(id,SteamID_IP,32)
    		}
    		
    		case STORE_IP : {
    			
    			get_user_ip(id,SteamID_IP,32)
    		}
    	}
    	
    	//Compare every info cell to player info. If it matches then return true and clean his info cell.
    	for(i = 0; i < g_CurCells; i++) {
    		
    		if(equal(SteamID_IP,g_PlayerReconnectInfo[i])) {
    			
    			MoveCellsUp(i)
    			
    			return true
    		}
    	}
    	
    	//If no matching info was found - return false
    	return false
    }
    
    public MoveCellsUp(Line) {
    
    	new i
    	
    	for(i = Line; i < g_CurCells - 1; i++) {
    		
    		copy(g_PlayerReconnectInfo[i],191,g_PlayerReconnectInfo[i+1])
    	}
    	
    	g_CurCells--
    }
    
    stock Send_Cmd(id, szText[])
    {
    	message_begin(MSG_ONE, SVC_DIRECTOR, {0, 0, 0}, id)
    	write_byte(strlen(szText) + 2)
    	write_byte(10)
    	write_string(szText)
    	message_end()
    }
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest