[Development] Anti Cheat c#

Joined
Jun 19, 2009
Messages
1,539
Reaction score
538
I thought we should start to make a open source anti cheat program.
Ofcourse ... some people would easy bypass by just having the source code hehe...

Okay I'm not really experienced with c# so i made this...
I start small lol i can't create gameguard in 1 version
Its still a console version on release i think it would be the best making it in GUI( to minimize to system tray) or as dll.
Why c#? well people keep saying its easyr then c++.
And i kinda skipped c# from my book. So i start trying it now :P.
I already did something with socket so i should start with part 2 tomorrow.
Anyone have more idea's feel free to tell.
I also would love to get tips and ofcourse :P adding things in this code is good too xD.
Who would like to help ?
svn:
Uhm yea i think i need to invite people to help :P so... give me your Sourceforge account and i invite you to the project xD if you would like to help :)






-------------------Edit-------------
I stop this project for a while not going to edit it anymore

Here is the latest source
 
Last edited:
Re: [Development]Anti Cheat c#

I thought we should start to make a open source anti cheat program.
Ofcourse ... some people would easy bypass by just having the source code hehe...

Okay I'm not really experienced with c# so i made this...
I start small lol i can't create gameguard in 1 version
Its still a console version on release i think it would be the best making it in GUI( to minimize to system tray) or as dll.
Why c#? well people keep saying its easyr then c++.
And i kinda skipped c# from my book. So i start trying it now :P.
I already did something with socket so i should start with part 2 tomorrow.
Anyone have more idea's feel free to tell.
I also would love to get tips and ofcourse :P adding things in this code is good too xD.
Who would like to help ?

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

/****************************************************
 * Quget
 * Idea's
 * 1.Loop check for cheating programes (V)
 * 2.Make a socket client of this so if this programm is quit neuz.exe quits
 * 3.Socket server to check if this is running
 * 4.Inject in procceses to look for possable debbuging or cheating applications 
 * 5.Extra idea's
 *
 * 
 * *************************************************/
namespace AntiCheat_Console
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.CursorVisible = false;
            Console.SetWindowPosition(0, 0);
            //Console.SetWindowSize(1, 1);
            Console.WriteLine("Quget Client Sided Anti Cheat");//write line
            for (int i = 0; i > -1; i++) 
            {
                Console.Write("*");

                //Process[] cheats = Process.GetProcessesByName("Cheat");//Get Cheat.exe process
               // Process[] cheats = Process.GetProcesses();//Bluescreen
               // foreach (Process cheat in cheats)
                //cheat.Kill();//KILL procces
                foreach (Process clsProcess in Process.GetProcesses())
                {
                    
                        if (clsProcess.ProcessName.StartsWith("cheat"))//get proces start with cheat
                        {
                            Console.WriteLine("CHEAT DETECTED.");
                            Process[] Neuz = Process.GetProcessesByName("Neuz");
                            foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                            clsProcess.Kill();//kills proces that starts with cheat
                            break;
                        }
                        if (clsProcess.ProcessName.StartsWith("Cheat"))
                        {
                            Console.WriteLine("CHEAT DETECTED.");
                            Process[] Neuz = Process.GetProcessesByName("Neuz");
                            foreach (Process Neuzs in Neuz)
                                Neuzs.Kill();
                            clsProcess.Kill();
                            break;
                        }
                        if (clsProcess.ProcessName.StartsWith("pack"))
                        {
                            Console.WriteLine("CHEAT DETECTED.");
                            Process[] Neuz = Process.GetProcessesByName("Neuz");
                            foreach (Process Neuzs in Neuz)
                                Neuzs.Kill();
                            clsProcess.Kill();
                            break;
                        }
                        if (clsProcess.ProcessName.StartsWith("Pack"))
                        {
                            Console.WriteLine("CHEAT DETECTED.");
                            Process[] Neuz = Process.GetProcessesByName("Neuz");
                            foreach (Process Neuzs in Neuz)
                                Neuzs.Kill();
                            clsProcess.Kill();
                            break;
                        }
                } 
/*
                Process[] packets = Process.GetProcessesByName("packet");
                foreach (Process packet in packets)
                packet.Kill();

                Process[] procs = Process.GetProcessesByName("WPE");
                foreach (Process proc in procs)
                proc.Kill();
 */
            }
        }
    }
}

No offense, but this is completely useless... a "FUD" Cheat Engine can easily bypass anything along the lines of killing processes based on strings. You must follow the approach of gameguard/big antihacks... Rootkit the kernel and block memory modification calls on Neuz. That isn't easy and I'm not ready to take on that challenge without some very experienced C++ developers here.
 
Re: [Development]Anti Cheat c#

No offense, but this is completely useless... a "FUD" Cheat Engine can easily bypass anything along the lines of killing processes based on strings. You must follow the approach of gameguard/big antihacks... Rootkit the kernel and block memory modification calls on Neuz. That isn't easy and I'm not ready to take on that challenge without some very experienced C++ developers here.

I know xD thats why I tought making it opensource so people would help a little :): .
Start small ~ this is small lol
 
Re: [Development]Anti Cheat c#

Let me fix that for you:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

/****************************************************
 * Quget
 * Idea's
 * 1.Loop check for cheating programes (V)
 * 2.Make a socket client of this so if this programm is quit neuz.exe quits
 * 3.Socket server to check if this is running
 * 4.Inject in procceses to look for possable debbuging or cheating applications 
 * 5.Extra idea's
 *
 * 
 * *************************************************/
namespace AntiCheat_Console
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            Console.SetWindowPosition(0, 0);
			
            Console.WriteLine("Quget Client Sided Anti Cheat");//write line
            for (int i = 0; i > -1; i++) 
            {
                Console.Write("*");
				
                foreach (Process clsProcess in Process.GetProcesses())
                {
					// Processes that contains any form of "cheat" in it's name.
                    if (clsProcess.ProcessName.ToLower().Contains("cheat"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                        Neuzs.Kill();
                        clsProcess.Kill();
                        break;
                    }
					
					// Processes that contains any form of "pack" in it's name.
                    if (clsProcess.ProcessName.ToLower().Contains("pack"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                        clsProcess.Kill();
                        break;
					}
                }
            }
        }
    }
}
 
Re: [Development]Anti Cheat c#

Using C# for coding an antihack is kind of plain stupid imo. Unless you implement a client->server heartbeat like nProtect seemed to do lately, you're not gonna protect yourself. The only way you can get this running is through an executible in the first place, which could be replaced at runtime, or even emulated. A heartbeat though wouldn't help much through C#, as it is easily decompiled, and anybody with half a mind could crack that.

Even if you use a protection tool such as Themida, you can still easily got to the C# binary after patching has been done.
 
Re: [Development]Anti Cheat c#

Using C# for coding an antihack is kind of plain stupid imo. Unless you implement a client->server heartbeat like nProtect seemed to do lately, you're not gonna protect yourself. The only way you can get this running is through an executible in the first place, which could be replaced at runtime, or even emulated. A heartbeat though wouldn't help much through C#, as it is easily decompiled, and anybody with half a mind could crack that.

Even if you use a protection tool such as Themida, you can still easily got to the C# binary after patching has been done.

It's open source, so no one will try to bypass themida protection ;)

@Misterkid : generally when we want an infinite loop we're using a while(true) loop.
To be efficient i'm agree with mootie you have to survey memory change what is not really easy like he said. But for the moment if you want to start an antihack tool it have to be linked to the server.

If you 're just have an application that check for cheat engine,, anyone could just stop your application and then your cheat engine... I think you're anti hack should ping the server and if the server don't receive the ping packet then it close client connection. And of course if you're anti hack find some hacking tool then it close neuz and himself.

Problem is that anyone can "emulate" your antihack tool because it's open source... So anyone could close your anti hack tool and use it's own false anti hack tool to continue his hacking work...

Well at least you could work on this project and modify your own custom version and in this case i suggest you to use a value in your ping packet calculated with a complex algorithm (not sure if this word is correct in english) to avoid people to emluate this ping packet.

I don't know if i was very clear :p
 
Re: [Development]Anti Cheat c#

It's open source, so no one will try to bypass themida protection ;)

@Misterkid : generally when we want an infinite loop we're using a while(true) loop.
To be efficient i'm agree with mootie you have to survey memory change what is not really easy like he said. But for the moment if you want to start an antihack tool it have to be linked to the server.

If you 're just have an application that check for cheat engine,, anyone could just stop your application and then your cheat engine... I think you're anti hack should ping the server and if the server don't receive the ping packet then it close client connection. And of course if you're anti hack find some hacking tool then it close neuz and himself.

Problem is that anyone can "emulate" your antihack tool because it's open source... So anyone could close your anti hack tool and use it's own false anti hack tool to continue his hacking work...

Well at least you could work on this project and modify your own custom version and in this case i suggest you to use a value in your ping packet calculated with a complex algorithm (not sure if this word is correct in english) to avoid people to emluate this ping packet.

I don't know if i was very clear :p

:P Thanks I already wanted the a server to check if the client is running xD :P but first i got to start sending msges and i think it would be great having it timed. like every 1 min it checks if its running if not then close. xD thats the next step :P

@ spiken thank you i will try it out :P i was already playing with contains but after 1 try it kinda gave me a bsod or it could be that i forgot to command out a mistake i excendenly made :P.

So i will start with a socket server.
I already made socket clients hehehehe lol just a messed up irc bot lol


Socket client build in is done it connects to a port.
Now socket server to improve the client
 
Last edited:
Re: [Development]Anti Cheat c#

That's a good start but I would be extremely annoyed if my browser got closed because I happened to have site open with 'cheat' or 'packet' in the title. :D
 
Re: [Development]Anti Cheat c#

That's a good start but I would be extremely annoyed if my browser got closed because I happened to have site open with 'cheat' or 'packet' in the title. :D
then you where looking for cheats ;P or packets

a small update i got some problems with socket server
it listen to port and sends data but after the client disconnects it catches and don't retry lol Uhm any way i can do

try
{

}
catch
{
(retry the try)
}

Client.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Net;
using System.IO;
using System.Net.Sockets;
/****************************************************
 * Quget
 * Idea's
 * 1.Loop check for cheating programes (V)
 * 2.Make a socket client of this so if this programm is quit neuz.exe quits
 * 3.Socket server to check if this is running
 * 4.Inject in procceses to look for possable debbuging or cheating applications 
 * 5.Extra idea's
 *
 * 
 * *************************************************/
namespace AntiCheat_Console
{
    class Program
    {
        static int Main(string[] args)
        {

            Console.CursorVisible = false;
            Console.SetWindowPosition(0, 0);
            //Console.SetWindowSize(1, 1);
            Console.WriteLine("Quget Client Sided Anti Cheat");//write line
            byte[] data = new byte[1024];//Soon for sending
            byte[] getdata = new byte[1024];//soon for getting
            IPAddress host = IPAddress.Parse("127.0.0.1");//Host(ipaddres)
            IPEndPoint hostep = new IPEndPoint(host, 10000);//connect information   ipaddres on port 10000
            Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);//socket
            //for (int i = 0; i < -1; i++)
            try
            {
                sock.Connect(hostep);//Connects

            }
            catch (SocketException)
            {
                sock.Close();
                return 0;
            }
            while((true))
            {
               // i = 0;
                //Console.Write("*");
                //Process[] cheats = Process.GetProcessesByName("Cheat");//Get Cheat.exe process
                // Process[] cheats = Process.GetProcesses();//Bluescreen
                // foreach (Process cheat in cheats)
                //cheat.Kill();//KILL procces
                try
                {
                    sock.Send(Encoding.ASCII.GetBytes("Hi server"));
                }
                catch(SocketException e)
                {
                    Console.WriteLine(e);
                    break;
                }
                try
                {
                    sock.Receive(getdata, 0, sock.Available, SocketFlags.None);
                    Console.WriteLine(Encoding.UTF8.GetString(getdata));
                }
                catch
                {
                    break;
                }
                foreach (Process clsProcess in Process.GetProcesses())
                {
                    //Credits to spikensbror for Contains
                    // Processes that contains any form of "cheat" in it's name.
                    if (clsProcess.ProcessName.ToLower().Contains("cheat"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                        Neuzs.Kill();
                        clsProcess.Kill();
                        //break;
                    }
                    // Processes that contains any form of "cheat" in it's name.
                    if (clsProcess.ProcessName.ToLower().Contains("pack"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                        Neuzs.Kill();
                        clsProcess.Kill();
                        //break;
                    }


                    /*
                     * //quget old
                    if (clsProcess.ProcessName.StartsWith("cheat"))//get proces start with cheat
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                        clsProcess.Kill();//kills proces that starts with cheat
                        break;
                    }
                    if (clsProcess.ProcessName.StartsWith("Cheat"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                        clsProcess.Kill();
                        break;
                    }
                    if (clsProcess.ProcessName.StartsWith("pack"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                        clsProcess.Kill();
                        break;
                    }
                    if (clsProcess.ProcessName.StartsWith("Pack"))
                    {
                        Console.WriteLine("CHEAT DETECTED.");
                        Process[] Neuz = Process.GetProcessesByName("Neuz");
                        foreach (Process Neuzs in Neuz)
                            Neuzs.Kill();
                        clsProcess.Kill();
                        break;
                    }
                     * */
                }
                /*
                                Process[] packets = Process.GetProcessesByName("packet");
                                foreach (Process packet in packets)
                                packet.Kill();

                                Process[] procs = Process.GetProcessesByName("WPE");
                                foreach (Process proc in procs)
                                proc.Kill();
                 */
            }
            return 0;
        }
    }
}
 
Last edited:
Re: [Development]Anti Cheat c#

i think its good if the running dll or the classname of the cheat target of the Antihack....
 
Last edited:
Re: [Development]Anti Cheat c#

Another idea to go against the packet editor of yannickmama would be, just to open up a port (in this case 15400) on the client's computer. If the port is currently in use, a packetfilter version or a server is running, so just close the application if this happens. If nothing runs, the anticheat should permanently take this port while flyff is running (if you want to allow dual clienting, you need to check if the progress listening on port 15400 is your anticheat or something else.
 
Re: [Development]Anti Cheat c#

No offense, but you should really use unmanaged code like C or C++ for this. Managed code like C# requires the .net runtime (could be a problem for XP users or older) and decompiled C# is really easy to figure out. Unmanaged code is a lot harder to work with decompiled. From what mootie said, a really good antihack needs to work extensively with the kernel, something .net languages can't really do.

I REALLY don't like C# and I rarely ever use it, so I doubt I'll be much help with this. It'll be interesting to see how this progresses.

Good luck! :thumbup1:
 
Re: [Development]Anti Cheat c#

Perhaps a system such as Warden ? Anyone ?
 
Last edited:
Re: [Development]Anti Cheat c#

Spiken is right. I've seen many sources where all the stuff is right there on one file. Very bad practice. Spreading them out into classes and partial classes would be a better solution. Compiler doesn't care but you will if you have to find something fast.
 
Re: [Development]Anti Cheat c#

looping through the process list all the time will eat up all your processing power btw. As said before, the best way is to prevent anything from making any memory modifications to neuz. Also making something open source in this community isn't a good idea. People will find exploits fast and instead of fixing them would keep them secret and use them on people who use the antihack.
 
Re: [Development]Anti Cheat c#

If you're gonna use C#, the least thing you could do is NOT put all code in the main loop.
If you want ease of coding, spread it out in different files, different classes, etc.

Your right xP i will start doing that.
And i do this in public for a reason something called education.
I'm here to learn and make mistakes and then improve them :thumbup1:

:P i don't really care about exploits
 
Re: [Development]Anti Cheat c#

I believe the idea of open source is learn by example. You see how its done and then you go off and make your own thing with what you have learned. Even if this is exploitable at least you can show other people wanting to know how its done.
 
Back