The Unreal Admins Page - Forums

The Unreal Admins Page - Forums (https://unrealadmin.org/forums/index.php)
-   Anti-Cheat Developer's Corner (https://unrealadmin.org/forums/forumdisplay.php?f=65)
-   -   Coding Anticheat - Starting points, advice? (https://unrealadmin.org/forums/showthread.php?t=27232)

Malevol3nt 29th May, 2008 08:34 PM

Coding Anticheat - Starting points, advice?
 
Hey all! I have an idea that popped into my head, an idea to start out my own anticheat software for UT99 (specifically the Instagib mod). I would sure use some advice, starter tips etc. ;)

Now I'm not a complete newbie when it comes to programming, I've done some work in python a couple of years ago (that I can now barely remember how I did it back then, hehe :D), and I did some C++ programming for a period of time aswell. But when it comes to anticheat, I have no experience in that area. Can anyone give me some starter points, as to how it's actually done? Is it all worked out in unrealscript or are other programming languages involved? Any examples of anticheat coding? Links to other tutorial sites are really welcome and should help me alot. I enjoy programming/scripting, but I was just too busy in life in the last few years to start working on something like this.

If things work out I'd keep the anticheat for myself and my closest friends, just for a few of our public servers. Maybe eventually if the anticheat proves to be solid, I might release it to the public. But of course, I'm talking in "future tense" now, so it might be a while untill I make anything useful just yet. Oh and I'm not planning to "sell" the ac, I just want to have a clean and fun game, as I've played UT ever since the demo came out, and the only thing thats making this game less enjoyable for me then in its early years is the mass amounts of cheat abuse, available just about everywhere on any public server. I allready have an idea on how the AC "would work", something that takes a quite different approach then utdc or utpure / similar ac's, but it's still only an idea.

Hope you can help me out. Thanx for reading this! :thumbup:

~V~ 29th May, 2008 09:32 PM

Your anti-cheat would involve uscript and perhaps c++ (if you want to stop native cheats.)

http://wiki.beyondunreal.com/ is a good place to learn about uscript and there are quite a few tutorials for c/c++ on the web.

adminthis 30th May, 2008 12:25 AM

"They" say that all Uscript cheats are blocked by UTPure7G. So all you need to do is verify the integrity of PURE and and block external hook based cheats. The source code of CSHP4 is available, but it's of no use to you since PURE takes care of Uscript cheats for you. So you'd need to make something along the lines of UTDC.

dodgethis 30th May, 2008 07:46 AM

Quote:

Originally Posted by adminthis (Post 140082)
"They" say that all Uscript cheats are blocked by UTPure7G. So all you need to do is verify the integrity of PURE and and block external hook based cheats. The source code of CSHP4 is available, but it's of no use to you since PURE takes care of Uscript cheats for you. So you'd need to make something along the lines of UTDC.

Trust me, pure doesnt stop all UScript cheats ;)

Malevol3nt 30th May, 2008 10:46 AM

The CSHP source code could prove useful, at least to get a glimps of how it was done there. Where exactly can i obtain the source from? The original CSHP website is down it seems.

adminthis 30th May, 2008 11:05 AM

Quote:

Originally Posted by Malevol3nt (Post 140086)
Where exactly can i obtain the source from?

A few threads below this one.

Download: http://victory.hyperlink.cz/data/CSHP40-Source.zip

Shambler 30th May, 2008 06:43 PM

You're better off sticking to C++, as UnrealScript is really not a good way to develop an effective cheat protection; the only place you may want to consider using UScript, is as a serverside interface for common event notifications etc. but definitely not anything clientside.
The clientside component would be best off as a completely separate executable + driver (depending upon what you want to do).

However, what is more essential than any of this is actually knowing (in great detail) how cheats work and how the OS works (reverse engineering is helpful too), as opposed to how any part of the game works; without that knowledge you'll really struggle to update your cheat protection once it's bypassed.
It's a huge amount to learn though, and most of what you need to know will probably be very specialized and difficult to learn.

PizzaMan 30th May, 2008 07:09 PM

I think your main problem will be this: The cheat coders have a decade of experience with the UT engine. While you, judging by your posts here, have not.

I am not saying that to be an ass, I am just trying to put what you want to achieve in a perspective.

Malevol3nt 30th May, 2008 09:10 PM

Well let's just hope ut lives for another few years and I might be upto something.

Nah, I'm faster then that, hehe ;) Yeah those hax0rz have done it for ages, and trying to make another utdc clone will be just way too easy task for them to crack anyway. What I'll be focusing on is rather trying to create a different method / approach towards the server<>client communication, something that will make the "talk" between the ac on the client and the server itself clean (thats just a figure of speach). Maybe it doesn't sound so clear now, It's all in my head as one idea (out of many ideas) and I have yet to find a way to realize it. But, practice makes perfect ;)

And I'm not giving up on this. I think I owe it to the ut community, I'd rather do something about it then just sit back, not care or whine at the problem when I could use some effort in preventing the problem from occuring in the first place. Pardon the enthusiasm! :)

~V~ 30th May, 2008 11:43 PM

There was an idea once of analysing the client mouse movements. I.E. if the player moves mouse too much in straight lines it could be a sign that someone is using an artificial aim. A normal player would be more rounded/random movements.

I've no idea what happened to this idea, but it does sound a lot of work, and it wouldn't detect trigger bots. At the end of the day people will find ways around anti-cheats and you just have to keep up with what's out there and update all the time. Cross package checking and ongoing updates are a must.

Malevol3nt 31st May, 2008 02:08 AM

Just something I found on the net:



- "The beauty of programming"

^^

werewolf 31st May, 2008 03:37 AM

hi

well a ex-member was working on something a couple of years ago that was very interesting, but he moved to a different part of the country then had family problems. have not seen him for a long time.

now in the early stages what it did was put in a ghost player in the server and when the a cheat was used it tried to locate that player thus creating
a way the anti cheat could pick up the cheat, the biggest problem they had was it would lag the server when too many players logged in.

i do not know how they were doing it as it was pretty secret, but i was involved in it as a tester, and every cheat known at that time could be logged

i do not code or have any idea how they did it but i know it involved c++ and uscript.

i have tried contacting this ex member on it but have got no reply

do not know if this has been tried but maybe it could help u on an idea of getting a lead.

Azura 10th June, 2008 03:40 PM

Quote:

Originally Posted by ~V~ (Post 140101)
There was an idea once of analysing the client mouse movements. I.E. if the player moves mouse too much in straight lines it could be a sign that someone is using an artificial aim. A normal player would be more rounded/random movements.

I've no idea what happened to this idea, but it does sound a lot of work, and it wouldn't detect trigger bots. At the end of the day people will find ways around anti-cheats and you just have to keep up with what's out there and update all the time. Cross package checking and ongoing updates are a must.

That sounds quite heavy. I have a better suggestion that should catch obvious botters and save admins some trouble.

What you do is measure the aiming angle versus time that you can compare with a human player. The difference should be obvious. I've been meaning to collect data from normal players but I need to get a server online.

There's also an FPH cap but that will have to be carefully coded because it's relative to what players there are on the server.

BenIned 14th July, 2008 08:44 PM

FPH Cap?
 
I don't think an FPH cap would be a good idea... unless the cap FPH is throught the roof, for massmurders, the FPH cap would be dependent on the maps etc.

Azura 14th July, 2008 11:27 PM

Putting a maximum cap in would be a start. Other than that, yes, the fph is dependant on what players are on a server and what map is being played.

suck 20th March, 2009 04:16 AM

Quote:

Originally Posted by ~V~ (Post 140101)
There was an idea once of analysing the client mouse movements. I.E. if the player moves mouse too much in straight lines it could be a sign that someone is using an artificial aim. A normal player would be more rounded/random movements.

Bonehead and I visited this in NBSP. However it was never released because I never had the time to fix/test it. Its a cool idea though, but would require many hours.

Code:

/*------------------------------------------
                    AUTO-AIMBOT CODE
  ------------------------------------------*/
/*
simulated final function float ACos(float C)
{
        local float S,T,A;

        if (C > 1 || C < -1)
                return 123456;

        if (C == 0)
                return 90.0;

        S = 1.0 - Square(C);
        T = Sqrt(S)/C;
        A = ATan(T);

        if (A < 0)
                A += Pi;

        return A * 57.2957795131;
}

simulated state AimCheck
{
        simulated final function Calculate()
        {
                local float C;        // the cosine of the angle between the last VR and the current VR

                MyVR = Normal(Vector(PlayerPawn(Owner).ViewRotation));
                C = (MyVR dot MyLastVR);

                // 1.0 = 0 degrees; 0.0 = 90 degrees; -1.0 = 180 degrees. 
                if (C < 0.5)
                {
                        //Aimbot CODE goes here??
                        if ((LastC - C) > 0.5)
                        {
                                PPP.ConsoleCommand("say IM A CHEATER! BAN ME PLEASE!");
                                PPP.ConsoleCommand("disconnect");
                        }
                }                 

                LastC = C;
                MyLastVR = MyVR;
        }

Begin:
        MyLastVR = Normal(Vector(PlayerPawn(Owner).ViewRotation));
        while (true)
        {
                if (( PP != None ) &&
                (( !PP.PlayerReplicationInfo.bWaitingPlayer ) ||
                ( PP.GameReplicationInfo.GameClass == "RocketArena.RocketArenaGame")))
                {
                        zzpstate = ""$PP.GetStateName();
                        if ((Level.Pauser == "") && (zzpstate ~= "PlayerWalking" || zzpstate ~= "PlayerSwimming")
                        && PP.Weapon != None && !PP.Weapon.IsA('WarHeadLauncher'))
                        {
                                if (PP.health > 0)
                                        Calculate();
                                else
                                {
                                        MyVR = Normal(Vector(PlayerPawn(Owner).ViewRotation));
                                        LastC = (MyVR dot MyLastVR);
                                        MyLastVR = MyVR;
                                }
                        }
                }
                sleep(0.001);
        }
}*/


Azura 20th March, 2009 05:35 PM

Yes, I spotted that code while browsing through that source. I'm not sure why it was to be used with RocketArena only. I'm working on a similar idea here:

http://www.unrealadmin.org/forums/sh...ad.php?t=29004


All times are GMT +1. The time now is 03:10 PM.

 


All pages are copyright The Unreal Admins Page.
You may not copy any pages without our express permission.