SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 03/04/2014, 01:15 PM   #11
shittt
Gangsta
 
shittt's Avatar
 
Join Date: Apr 2013
Location: I came back
Posts: 797
Reputation: 78
Post Re: Southclaw's & Pottus's Anti-cheat patches

Nice , protects against rapid fire?

if so I'm not seeing is blurred, Linux does not help :/

OFF: 666 Posts o_O.
__________________
Hi
shittt is offline   Reply With Quote
Old 05/04/2014, 05:51 AM   #12
MugiwaraNoLuffy
Huge Clucker
 
MugiwaraNoLuffy's Avatar
 
Join Date: Oct 2013
Posts: 269
Reputation: 40
Default Respuesta: Southclaw's & Pottus's Anti-cheat patches

Good job, keep it up
__________________
MugiwaraNoLuffy is offline   Reply With Quote
Old 07/04/2014, 11:16 PM   #13
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,889
Reputation: 3126
Default Re: Southclaw's & Pottus's Anti-cheat patches

Could I make a request (partially a suggestion). You explicitly mention that this should be included before YSI, and I agree, but there are a few things to be aware of with that:

1) You say you can use y_iterate, but if you include these patches before YSI the "foreach" macro won't yet exist and that code will never be used even if it is included later.

2) y_hooks in YSI 4.0 is awkward to deal with in terms of orderings. Currently y_hooks hooks always come before ALS hooks, even if they appear later in source code, the ordering is changed (or, more accurately, set) at run-time, not compile-time. I have a solution to this that will be released shortly (I am now back home), but the solution requires some co-operation from other library developers that want their code to come before any y_hooks code. "Breaking" an ALS chain is tricky as you need to be able to detect the chain, but this can be done. I want to try and figure out an even better way of specifying ordering, but for now this is the best I have come up with. Instead of your current hooking method use:

Code:
// This function has two purposes - defines 3 states, and declares your ALS prefix.
// You seem to use different prefixes for each callback though, I'm not sure that's a
// good idea and will make detection MUCH harder.
forward @@@_AC();
// The function is never called, but can be found by the "@@@_" prefix.
public @@@_AC() <AC_state : AC_state1> {}
public @@@_AC() <AC_state : AC_state2> {}
public @@@_AC() <AC_state : AC_state3> {}

#define AC_FORWARD%0(%1) \
	forward%0(%1); \
	public%0(%1)<> return 0; \
	public%0(%1)<AC_state : AC_state1> return 0

// Now this is a normal callback.
public OnPlayerDisconnect(playerid, reason)
{
	// And this is the hook, no wrapping of any kind required.
	return AC_OnPlayerDisconnect(playerid, reason);
}

#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect(%0) AC_OnPlayerDisconnect(%0) <AC_state : AC_state2>

AC_FORWARD AC_OnPlayerDisconnect(playerid, reason);

Using that, the order hooks are done in becomes:

- State-based hooks.
- y_hooks.
- ALS hooks.
- Public function.

If you need me to explain the issues in more depth, or would like to discuss alternate solutions (I would), feel free to contact me here or on IRC. This is a VERY brief post on the issue, and I wish there was a better way. Note that you also need:

Code:
state AC_state : AC_state2;

Somewhere to make the whole thing work, but you could add that to every callback, I just prefer doing it in OnGameModeInit (etc).

Other than that, nice.
Y_Less is offline   Reply With Quote
Old 08/04/2014, 09:51 AM   #14
Kyle
High-roller
 
Kyle's Avatar
 
Join Date: Mar 2009
Location: United Kingdom
Posts: 2,390
Reputation: 314
Default Re: Southclaw's & Pottus's Anti-cheat patches

Quote:
Originally Posted by Y_Less View Post
Could I make a request (partially a suggestion). You explicitly mention that this should be included before YSI, and I agree, but there are a few things to be aware of with that:

1) You say you can use y_iterate, but if you include these patches before YSI the "foreach" macro won't yet exist and that code will never be used even if it is included later.

2) y_hooks in YSI 4.0 is awkward to deal with in terms of orderings. Currently y_hooks hooks always come before ALS hooks, even if they appear later in source code, the ordering is changed (or, more accurately, set) at run-time, not compile-time. I have a solution to this that will be released shortly (I am now back home), but the solution requires some co-operation from other library developers that want their code to come before any y_hooks code. "Breaking" an ALS chain is tricky as you need to be able to detect the chain, but this can be done. I want to try and figure out an even better way of specifying ordering, but for now this is the best I have come up with. Instead of your current hooking method use:

Code:
// This function has two purposes - defines 3 states, and declares your ALS prefix.
// You seem to use different prefixes for each callback though, I'm not sure that's a
// good idea and will make detection MUCH harder.
forward @@@_AC();
// The function is never called, but can be found by the "@@@_" prefix.
public @@@_AC() <AC_state : AC_state1> {}
public @@@_AC() <AC_state : AC_state2> {}
public @@@_AC() <AC_state : AC_state3> {}

#define AC_FORWARD%0(%1) \
	forward%0(%1); \
	public%0(%1)<> return 0; \
	public%0(%1)<AC_state : AC_state1> return 0

// Now this is a normal callback.
public OnPlayerDisconnect(playerid, reason)
{
	// And this is the hook, no wrapping of any kind required.
	return AC_OnPlayerDisconnect(playerid, reason);
}

#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect(%0) AC_OnPlayerDisconnect(%0) <AC_state : AC_state2>

AC_FORWARD AC_OnPlayerDisconnect(playerid, reason);

Using that, the order hooks are done in becomes:

- State-based hooks.
- y_hooks.
- ALS hooks.
- Public function.

If you need me to explain the issues in more depth, or would like to discuss alternate solutions (I would), feel free to contact me here or on IRC. This is a VERY brief post on the issue, and I wish there was a better way. Note that you also need:

Code:
state AC_state : AC_state2;

Somewhere to make the whole thing work, but you could add that to every callback, I just prefer doing it in OnGameModeInit (etc).

Other than that, nice.
They already did when they first posted: "- Patches are to be designed to be included BEFORE YSI"
Kyle is offline   Reply With Quote
Old 08/04/2014, 10:49 AM   #15
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,889
Reputation: 3126
Default Re: Southclaw's & Pottus's Anti-cheat patches

Quote:
Originally Posted by KyleSmith View Post
They already did when they first posted: "- Patches are to be designed to be included BEFORE YSI"
Yes I know:

Quote:
Originally Posted by Y_Less View Post
y_hooks hooks always come before ALS hooks, even if they appear later in source code, the ordering is changed (or, more accurately, set) at run-time, not compile-time.
Y_Less is offline   Reply With Quote
Old 08/04/2014, 02:08 PM   #16
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 2,045
Reputation: 297
Default Re: Southclaw's & Pottus's Anti-cheat patches

Very usefull. Good job
__________________
QUITED SA-MP
Follow me on Instagram @brandonvanommen
Admigo is offline   Reply With Quote
Old 08/04/2014, 08:12 PM   #17
Kyra
Big Clucker
 
Join Date: Jul 2012
Posts: 193
Reputation: 4
Default Re: Southclaw's & Pottus's Anti-cheat patches

Very usefull post if the community contribute on this post, i think it's important with the massive cheat created.

I don't understand the Autobullet, it's for detect shoot player on slide bug?
Kyra is offline   Reply With Quote
Old 08/04/2014, 09:02 PM   #18
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,943
Reputation: 1468
Default Re: Southclaw's & Pottus's Anti-cheat patches

Quote:
Originally Posted by Whitetiger View Post
you should make this a community driven solution on github, with changes encouraged by the community (see fixes.Inc). can make a quick include to patch a bunch of hacks
Quote:
Originally Posted by [uL]Pottus View Post
That is a good idea, but the issue with that is implementation, were not really releasing a full AC system rather patches to integrate into gamemodes. It will be up to the scripter to determine how they want to handle specific events. I still have a lot of patches to put up yet
We could do that, but put each patch in a separate file so it's still just a bunch of separated code rather than one big include. I store code like this on Gist at the moment but I was going to switch to a normal GitHub git repo just for commitlogs and diffs.

Quote:
Originally Posted by shittt View Post
Nice , protects against rapid fire?

if so I'm not seeing is blurred, Linux does not help :/

OFF: 666 Posts o_O.
I've just written and tested a rapid fire patch!
[HLF]Southclaw is offline   Reply With Quote
Old 09/04/2014, 12:31 AM   #19
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,424
Reputation: 1238
Default Re: Southclaw's & Pottus's Anti-cheat patches

I was reviewing the rapid fire cheat Southclaw and I think it needs to be revised because it doesn't take in account c-bugging at all.

@Edit - It's also probably a good idea to run ammo lock checking first since the rapid fire cheats seem to usually lock ammo it would be easier to bust someone this way as a first line of defense.

Last edited by Pottus; 09/04/2014 at 01:54 AM.
Pottus is offline   Reply With Quote
Old 09/04/2014, 03:41 AM   #20
MugiwaraNoLuffy
Huge Clucker
 
MugiwaraNoLuffy's Avatar
 
Join Date: Oct 2013
Posts: 269
Reputation: 40
Default Respuesta: Re: Southclaw's & Pottus's Anti-cheat patches

Quote:
Originally Posted by [uL]Pottus View Post
I was reviewing the rapid fire cheat Southclaw and I think it needs to be revised because it doesn't take in account c-bugging at all.

@Edit - It's also probably a good idea to run ammo lock checking first since the rapid fire cheats seem to usually lock ammo it would be easier to bust someone this way as a first line of defense.
Every weapon should have its own shooting max rate if you know what I mean.
__________________
MugiwaraNoLuffy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [Anti-Cheat]HP,Money Cheat and Armour Cheat Meow22 Filterscripts 23 03/03/2014 02:38 PM
[FilterScript] [K.A.S] Knight's Anti Cheat (Anti: Armas, Spam, DB, MaxPing, Palavrões, Money Hack) The Knight Lançamentos/Releases 5 05/05/2011 03:41 AM


All times are GMT. The time now is 01:09 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.