Coder Social home page Coder Social logo

roguedrifter / anti_cheat_pack Goto Github PK

View Code? Open in Web Editor NEW
36.0 5.0 7.0 373 KB

An anti cheat library improved over 3 years

Home Page: https://www.burgershot.gg/showthread.php?tid=873

License: Apache License 2.0

Pawn 100.00%
sampctl anticheat sa-mp pawn

anti_cheat_pack's People

Contributors

roguedrifter avatar seanny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

anti_cheat_pack's Issues

AirbreakTeleport.inc - Incorrect detection

Describe the bug
Sometimes (not always), AirbreakTeleport.inc is triggered when players leave our Duel arena, and get put back in world 0. The Duel arena world ID is 1000, and uses the Warehouse 1 interior.

[14:21:06] Duel: PlayerA(14) won a duel against PlayerB(6).
[14:21:07] [AC] Possible hacker PlayerA(14) using Airbrake/TP hacks!

To Reproduce
It cannot be reliably reproduced, it happens at random, my guess would be down due to client lag.

Expected behavior
I expected AirbreakTeleport.inc to not be triggered.

Screenshots
I would share screenshots or a video, but when it happens at random, it's one of those things that cannot really be recorded.

Samp details (please complete the following information):

  • Version: Linux 0.3.7-R2. The client who triggered the warning in the example above is running 0.3.7 (not R2, R3 or R4).
  • Using filterscripts? Yes
  • Using sampctl? No

Additional context
N/A

An oversight in rEac.inc

Describe the bug
The following code in function OnPlayerUpdate() (rEac.inc) looks suspicious:

Anti_cheat_pack/rEac.inc

Lines 169 to 173 in c835913

new Float:EacX, Float:EacY, Float:EacZ,
Float:EacvX, Float:EacvY, Float:EacvZ, EacTempSCar;
GetPlayerPos(playerid, EacX, EacY, EacZ);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && EacTempSCar != GetPlayerVehicleID(playerid))
EacTempSCar = GetPlayerVehicleID(playerid);

Variable EacTempSCar is used before being assigned a value (zero-initialized by default), so the condition

GetPlayerState(playerid) == PLAYER_STATE_DRIVER && EacTempSCar != GetPlayerVehicleID(playerid)

works as

GetPlayerState(playerid) == PLAYER_STATE_DRIVER && 0 != GetPlayerVehicleID(playerid)

which doesn't make a lot of sense because GetPlayerVehicleID() never returns 0 if the player is driving a vehicle (PLAYER_STATE_DRIVER).

You'll probably want to to assign some value to EacTempSCar before using the variable inside an if expression, or just remove it completely.

To Reproduce

Expected behavior

Screenshots

Samp details (please complete the following information):

  • Version: [e.g. 0.3.7/0.3.7-R2]
  • Using filterscripts? [Yes/No]
  • Using sampctl? [Yes/No]

Additional context

AIRBREAK NO DETECT

Describe the bug
AIRBREAK no detect

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
public OnPlayerViolate(playerid, severity, violationCode, const violationName[])
{
new acString[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);

switch(violationCode)
{
	case VIOLATION_CODE_CHATSPAM:
	{
		Info(playerid, "Lu olang spam");
		KickEx(playerid);
	}
	case VIOLATION_CODE_AIRBRAKE:
	{
		Info(playerid, "Lu olang airbrake");
		KickEx(playerid);
	}
}
return 1;

}

Samp details (please complete the following information):

  • Version: [e.g. 0.3.7/0.3.7-R2]
  • Using filterscripts? [Yes/No]
  • Using sampctl? [Yes/No]

Additional context
Add any other context about the problem here.

OPBA AntiCheat

Hello once again

In OPBA.inc you create a timer for every connected players with deley in 300 ms.
Don't you test whis ac with some more delay?
I think it is very hard load on servers with big online, doesn't it?

And what if we create one timer (with foreach) instead of many of them?

Thank you for answers

LaggersDetect

I have a shop system which allows players to purchase weapons via a ShowPlayerDialog. The dialog appears just fine, but when hitting "Select" to confirm the purchase, nothing happens, the dialog will close (as expected), but no weapon will be given to the player.

If I comment/disable #include "LaggersDetect.inc" in my gamemode, everything is fine, so it appears that somehow, this include is causing problems.

Any feedback would be greatly appreciated.

Array Out of Bounds causing mysql vehicles not to load

Hi, when my server is loading vehicles from the MySQL database, it stops spawning them after the first vehicle, causing there to be only 1 database vehicle loaded. It seems to be caused by OPBA_SetVehicleToRespawn

[14:51:22] [debug] Run time error 4: "Array index out of bounds"
[14:51:22] [debug] AMX backtrace:
[14:51:22] [debug] #0 0000ae48 in public OPBA_SetVehicleToRespawn (vehicleid=65535) at D:\Development\SAS-RP\SA-MP-Development\dependencies\Anti_cheat_pack\Opba.inc:771
[14:51:22] [debug] #1 0007c180 in UpdateVehiclePosition (i=1) at ./Source/Core/vehicle.pwn:1306
[14:51:22] [debug] #2 0006e228 in public Query_LoadVehicles () at ./Source/Core/vehicle.pwn:148

Here is my UpdateVehiclePosition code:

stock UpdateVehiclePosition(i)
{
    if(IsValidVehicle(VehicleInfo[i][vScriptID]))
    {
        DestroyVehicle(VehicleInfo[i][vScriptID]);
    }
    VehicleInfo[i][vScriptID] = CreateVehicle(VehicleInfo[i][vModel],VehicleInfo[i][vPos][0], VehicleInfo[i][vPos][1], VehicleInfo[i][vPos][2], VehicleInfo[i][vPos][3], VehicleInfo[i][vColour1], VehicleInfo[i][vColour2], -1, VehicleInfo[i][vSirens]);
    ChangeVehiclePaintjob(VehicleInfo[i][vScriptID], VehicleInfo[i][vPaintJob]);

    if(VehicleInfo[i][vInterior] != 0)
    {
        LinkVehicleToInterior(VehicleInfo[i][vScriptID], VehicleInfo[i][vInterior]); 
    }

    if(VehicleInfo[i][vVW] != 0)
    {
        SetVehicleVirtualWorld(VehicleInfo[i][vScriptID], VehicleInfo[i][vVW]);
    }
    
    if(!isnull(VehicleInfo[i][vPlates]))
    {
        SetVehicleNumberPlate(VehicleInfo[i][vScriptID], VehicleInfo[i][vPlates]);
    }
    else SetVehicleNumberPlate(VehicleInfo[i][vScriptID], " ");

    if(!VehicleInfo[i][vValue])
    {
        VehicleInfo[i][vValue] = 1;
    }

    SetVehicleToRespawn(VehicleInfo[i][vScriptID]); 
    
    if(VehicleInfo[i][vImpounded] == 1)
    {
        SetVehiclePos(VehicleInfo[i][vScriptID], VehicleInfo[i][vImpoundPos][0], VehicleInfo[i][vImpoundPos][1], VehicleInfo[i][vImpoundPos][2]);
        SetVehicleZAngle(VehicleInfo[i][vScriptID], VehicleInfo[i][vImpoundPos][3]); 
    }
}

Here is Query_LoadVehicles:

function Query_LoadVehicles()
{
	if(!cache_num_rows())
		return printf("* No vehicles were loaded from the database...");
	
	new rows = cache_num_rows();
	new endCount = 0; 
	
	for (new i = 0; i < rows && i < MAX_DYN_VEH; i ++)
	{
        VehicleInfo[i][vExists] = true; 
        cache_get_value_int(i, "ID", VehicleInfo[i][vID]);
        
        cache_get_value_int(i, "OwnerID", VehicleInfo[i][vOwnerID]);
        cache_get_value_int(i, "FactionID", VehicleInfo[i][vFactionID]);
        
        cache_get_value_int(i, "Model", VehicleInfo[i][vModel]);
        
        cache_get_value_int(i, "Colour1", VehicleInfo[i][vColour1]);
        cache_get_value_int(i, "Colour2", VehicleInfo[i][vColour2]);
        
        cache_get_value_float(i, "PosX", VehicleInfo[i][vPos][0]);
        cache_get_value_float(i, "PosY", VehicleInfo[i][vPos][1]);
        cache_get_value_float(i, "PosZ", VehicleInfo[i][vPos][2]);
        cache_get_value_float(i, "PosA", VehicleInfo[i][vPos][3]);
        
        cache_get_value_int(i, "Interior", VehicleInfo[i][vInterior]);
        cache_get_value_int(i, "VW", VehicleInfo[i][vVW]);
        
        cache_get_value(i, "Plates", VehicleInfo[i][vPlates], 32);
        cache_get_value_int(i, "Locked", VehicleInfo[i][vLocked]);
        
        cache_get_value_int(i, "Impounded", VehicleInfo[i][vImpounded]);
        
        cache_get_value_float(i, "ImpoundPosX", VehicleInfo[i][vImpoundPos][0]);
        cache_get_value_float(i, "ImpoundPosY", VehicleInfo[i][vImpoundPos][1]);
        cache_get_value_float(i, "ImpoundPosZ", VehicleInfo[i][vImpoundPos][2]);
        cache_get_value_float(i, "ImpoundPosA", VehicleInfo[i][vImpoundPos][3]);
        
        cache_get_value_float(i, "Fuel", VehicleInfo[i][vFuel]);
        cache_get_value_int(i, "Sirens", VehicleInfo[i][vSirens]);

        cache_get_value(i, "FineReason", VehicleInfo[i][vFineReason], 32);
        cache_get_value_int(i, "FineAmount", VehicleInfo[i][vFineAmount]);
        cache_get_value_int(i, "FineOfficerID", VehicleInfo[i][vFineOfficerID]);
        cache_get_value_int(i, "FineFactionID", VehicleInfo[i][vFineFactionID]);
        cache_get_value_int(i, "FineTime", VehicleInfo[i][vFineTime]);
        cache_get_value_int(i, "DMVVehicle", VehicleInfo[i][vDMVVehicle]);
        cache_get_value_int(i, "Value", VehicleInfo[i][vValue]);

        VehicleInfo[i][vScriptID] = CreateVehicle(VehicleInfo[i][vModel],
        VehicleInfo[i][vPos][0],
        VehicleInfo[i][vPos][1],
        VehicleInfo[i][vPos][2],
        VehicleInfo[i][vPos][3],
        VehicleInfo[i][vColour1],
        VehicleInfo[i][vColour2],
        -1,
        VehicleInfo[i][vSirens]);

        ToggleVehicleLocked(VehicleInfo[i][vScriptID], 0);
        
        UpdateVehiclePosition(i);
        
        endCount++;
	}
	printf("* %d vehicles were loaded from the database...", endCount);
	return 1;
}

AC Teleport

Hello all!
I have a question
Install your OPBA anticheat - airbreak is detected.
But not teleport

I began to debug a code and noticed than after SetTimerEx("OPBA_CheckRealTP"...) in the end of OPBA_AirbrakeTeleport coordinates are rewrited. So in OPBA_CheckRealTP we have cheated coordinates, not fair.

Don't we have to add any condition to GetPlayerPos(playerid, OPBA_Player[playerid][RacX], OPBA_Player[playerid][RacY], OPBA_Player[playerid][RacZ]); in the end of OPBA_AirbrakeTeleport which will prevent it in case if OPBA_Player[playerid][RacHoldCheck] == true?

Thanks
Sorry for my English.

rAct No.5

Run -> Enter vehicle while sprinting causes No.5 to get called falsely at times.

Script didn't do anything

Describe the bug
I implemet this include on bare gamemde, and the scripts seems didn't do anything

AC Package issue

Describe the bug
When using the whole package detection won't channel through OnPlayerViolate due to issues from the #if/else brackets
To Reproduce
Include the package and do no callbacks from your end, no detections will happen

= The fix i will implement: It just can't be fixed so i enforced my usage of it as it is the most recommended option

Anti Weapon can't detect this cleo

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
I would like you to make a anticheat which can fight against this cleo.

Describe alternatives you've considered
[LINK REMOVED]
Reason: Downloadable cheat (I already viewed it)

Additional context
no.

Opba.inc (OnPlayerBreakAir)/Anti airbreak faulty at No.6 passengers.

Using SetVehiclePos or any legit position change for a vehicle with passengers THAT DOESN'T have a driver will trigger OnPlayerBreakAir with breaktype No. 6, I'll fix it in a while. For now ignore it. I.e:

public OnPlayerBreakAir(playerid, breaktype)
{
    if(breaktype == 6) return 0;
    //Rest of the code
    return 1;
}

Some kind of attackings.

Hello,
My server faced multiple kinds of attacking, such as server restarting, changing scores and many more!
A hacker could kick someone playing even without being in-game!
A normal player told me he has Sobiet, he could restart the server in no moment!
How can i secure this from happening again?
Thanks a lot.

FakeKill broken detection

I completely ruined the boolean checks, IsValidReason and IsKillFalse will make sure that the include never works, this is going to be patched, just notifying anyone watching the repository.

Airbreak/teleport for falling players

Describe the bug
Airbreak/teleport gets detected for passengers when they fall (I dont know if its same for drivers but i think i fixed it on foot?)

To Reproduce
Steps to reproduce the behavior:

  1. Get in a vehicle as passenger
  2. Teleport mid-air and keep falling
  3. You will get detected with breaktype 3

Expected behavior
A protection should be given for falling players as passengers (Again im not sure if it detects drivers as well and i still think i fixed it for on-foot players)

Screenshots
N/A

Samp details (please complete the following information):

  • Version: Server is 0.3.7-R2, Client is 0.3.7-R4
  • Using filterscripts? Yes but that's irrelevant
  • Using sampctl? Yes but also irrelevant

Additional context
N/A

AirbreakTeleport.inc Detection Issue

Describe the bug
Sometimes, when going between world 0 and a virtual world (1000) in interior ID 1 (Warehouse 1) (and quite possibly vice-versa, I can't be sure of that), AirbreakTeleport.inc will be triggered. I should add that I'm also using LaggersDetect.inc.

To Reproduce
It is hard to give steps as it doesn't always happen, but the basic overview of what causes the issue is written above.

Expected behavior
AirbreakTeleport.inc should not flag the player(s).

Screenshots
N/A

Samp details (please complete the following information):

  • Version: 0.3.7-R2
  • Using filterscripts? Yes
  • Using sampctl? No

Additional context
N/A

rAct No.3 problem.

Describe the bug
Two Players in cars one hits the middle of the other with his front bumper makes the one hitting the other a cheater for No.3 In rAct

To Reproduce
Steps to reproduce the behavior:

  1. Get a vehicle
  2. Make another player get a vehicle
  3. Hit his middle vehicle with ur front bumper

Expected behavior
Player calls the callback for No.3 (RACT_SKICK_CAR)

Screenshots
None

Samp details (please complete the following information):

  • Version: 0.3.7-R2
  • Using filterscripts? Yes
  • Using sampctl? Yes

Additional context
None.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.