Question Working on Anti Cheat, need help making DLL

Untamed

Well-known member
Joined
Jul 25, 2009
Messages
53
Programming Experience
5-10
Introduction: I have made a simple anticheat.exe application, which runs in processes once my patcher/launcer program I also made starts up "MainClient.exe".

A few problems:
1. I need tomake a DLL to make sure that the "AntiCheat.exe" process is open when the "MainClient.exe" process is. If it is not, it will kill the "MainClient.exe" process.
2. A DLL is needed because the problem is people can easily close the AntiCheat.exe process and stop the whole anticheat I have made, yet keep playing normally.
3. The main MainClient.exe can be run with a simple 2 words in a batch file, easily bypassing my launcher, updater, and anticheat. I'd like to make a dll that can, at best, hook into the MainClient.exe application itself, or something that the MainClient.exe always loads. At worst I am looking into at least hooking it into my anticheat.exe.

Also, I do not have the source of the MainClient.exe, just the compiled executable file. I was thinking of possibly hexing the compiled executable, or hexing one of the files it needs to load, and possibly hooking my DLL into it.

My current DLL I have made [I have never made a DLL before... I have only been using visual basic for 3 days] has this code... it returns no errors or warnings:
Code:
Public Class AntiCheat


    Public Sub killProcess(ByRef strProcessToKill As String)
        Dim proc() As Process = Process.GetProcesses
        For i As Integer = 0 To proc.GetUpperBound(0)
            If proc(i).ProcessName = strProcessToKill Then
                proc(i).Kill()
            End If
        Next
    End Sub
    Public Function ProcessesRunning(ByVal ProcessName As String) As Integer
        Try
            Return Process.GetProcessesByName(ProcessName).GetUpperBound(0) + 1
        Catch
            Return 0
        End Try
    End Function

    Public Function MainCheck()
        If ProcessesRunning("MainClient") >= 1 Then
            Dim acp = ProcessesRunning("AntiCheat")
            If acp < 1 Then
                Return 0
                killProcess("MainClient")
            Else : Return 0
            End If
        Else : Return 0
        End If
    End Function
End Class
I am not sure if this would work for what I am trying to do. I have tried importing it into my resources in the project, and in the main class itself on my anticheat. Also I put it in my client. Nothing changed, so I think I may have to either make a new DLL or figure out how to call the MainCheck() function.

Also, it would be incredibly great if someone could tell me how I could hook a DLL to an already compiled file that I don't have the source to.

Thanks for the reply and the help, I hope someone can help me with my problem soon!
 

anthony.selby

Well-known member
Joined
Sep 3, 2009
Messages
65
Programming Experience
5-10
So how exactly do you plan on doing this ?

If you can't change the MainClient.exe then you it can't look for anti-cheat ... depending on how "bad" you want to get I would rename "anticheat" to process.exe or one of the other processes you can't kill with the taskmanager and start it with windows ... that still won't help you if they disable anticheat from starting with windows ... but what you really need to do is have mainclient look for anticheat every so often ... plus you really should have some type of communcation that goes on between the two ... otherwise you will get some smart guy that simply renames notepad to "anticheat.exe" and run that ...

I would love to have what you come up ?
 

Untamed

Well-known member
Joined
Jul 25, 2009
Messages
53
Programming Experience
5-10
I changed the way the mainclient.exe loads [it needed to be run with a command after it, i changed that command], and made the anticheat load in 3 executables. One is the main anti cheat, the other two make sure that the other 2 executables that are not the current one are loaded. If not, boom goes all 3 anticheat executables and the mainclient.exe
 
Top Bottom