[C#]WindowsDetection Class

Skilled Illusionist
Joined
Jan 7, 2007
Messages
347
Reaction score
78
Easy to use.

Code:
//Copyright © MetaStudios
public static class WindowsDetection 
    {
        [DllImport("user32.dll", SetLastError = true)]
        public static extern int FindWindow(string lpClassName, string lpWindowName);
        static string[] prog = { "Olly", "Dbg", "hack", "h4ck", "hax", "Hack", "HACK", "H4CK", "massive", "MASSIVE", "lawnmower", "LAWNMOWER", "god", "GOD", "G0D", "g0d", "God", "Ghost", "ghost", "gh0st", "speed", "Speed", "Sp33d", "sp33d", "dll", "DLL", "OneWhoSign", "OWS", "ThevingSix", "thevingsix", "t6", "theving6", "Anônimo", "anônimo", "Wizkid", "WizKid", "wizkid", "WIZKID", "Evilness", "evilness", "bytes4bread", "thesupermax", "bypass", "Bypass", "BYPASS", "Cipher", "Sulfin", "sulfin", "SULFIN", "Thanu21", "lone222", "WaffleByte", "hmhax", "Xeffar", "Mafiacoders", "mafiacoders", "Injec", "injec", "Hook", "hook", "Pserv", "pserv" };
        
        //WindowsName Protect
        public static readonly bool WNP
        {
            get
            {
               foreach (string x in prog)
                {
                    Thread.Sleep(300);
                    int hwnd = FindWindow(null, x);
                    if (hwnd >= 1) { return true; }
                }
                return false;
            }
        }

        //Secondary WindowsName Protect
        public static readonly bool SWNP
        {
            get
            {
                Process[] ProcList = Process.GetProcesses();
                foreach (Process xProcess in ProcList)
                {
                    foreach (string x in prog)
                    {
                        Thread.Sleep(300);
                        if (xProcess.ProcessName.Contains(x)) { return true; }
                    }
                }
                return false;
            }
        }

        //MainTitleName Protect
        public static readonly bool MTNP
        {
            get
            {
                Process[] ProcList = Process.GetProcesses();
                foreach (Process xProcess in ProcList)
                {
                    foreach (string x in prog)
                    {
                        Thread.Sleep(300);
                        if (xProcess.MainWindowTitle.Contains(x)) { return true; }
                    }
                }
                return false;
            }
        }
    }
Using it:
Code:
while (true)
    {
      Thread.Sleep(1000);
       if (WindowsDetection.WNP == true || WindowsDetection.SWNP == true || WindowsDetection.MTNP == true)
       { //Hack detected, do something. Exemple:
         //foreach(Process yProcess in Process.GetProcesses()){
         //if(yProcess.MainWindowTitle == "The duel"){yProcess.Close();
         //Process.GetCurrentProcess().Close();}}
       }
    }
It's simple but usefull :):

FindWindows methode can also be really usefull:
Code:
WindowsDetection.FindWindow(null, "windows title");

Dots.
 
Last edited:
so if I do not know is that I can help?, and why is your post, then as it costs less to explain at least some to see what it does, do not deserve "LIKE" at least not for me :thumbdown:

:mellow: whats is this exactly and how to use? someone answer me please?
 
so if I do not know is that I can help?, and why is your post, then as it costs less to explain at least some to see what it does, do not deserve "LIKE" at least not for me :thumbdown:
Learn C# then you'll know why i don't need to explain anything. C# is similar to english read for fun it's pretty simple to understand if you know Algebra..

whats is this exactly and how to use? someone answer me please?
Microsoft Visual C# 2010 Express> New Project> Windows Application ...

Add this:
Code:
while (true)
    {
      Thread.Sleep(1000);
       if (WindowsDetection.WNP == true || WindowsDetection.SWNP == true)
       { //Hack detected, do something. Exemple:
         //foreach(Process yProcess in Process.GetProcesses()){
         //if(yProcess.MainWindowTitle == "The duel"){yProcess.Close();
         //Process.GetCurrentProcess().Close();}}
       }
    }
in main braces.{}
Add WindowsDetection Class under Program class (after his brace {})
done. ( remove the // if you want the ah to stop the game on hack detection )
Exept on that "//Hack detected, do something. Exemple:".
 
Last edited:
i did something like that
Code:
Dim h As String() = {"msnmsgr", "firefox", "iexplorer", "chrome", "opera"}
        Dim d As Process() = Process.GetProcesses
        Dim b As Boolean = True
        For Each f As Process In d
            If LCase(f.MainWindowTitle.ToString) <> "theduel" Then
                For Each c As String In h
                    If LCase(f.ProcessName.ToString) = c Then
                        b = True
                        Exit For
                    Else
                        b = False
                    End If
                Next
                If b = False Then
                    f.Kill()
                    b = True
                End If
            End If
        Next
 
i did something like that
Code:
Dim h As String() = {"msnmsgr", "firefox", "iexplorer", "chrome", "opera"}
        Dim d As Process() = Process.GetProcesses
        Dim b As Boolean = True
        For Each f As Process In d
            If LCase(f.MainWindowTitle.ToString) <> "theduel" Then
                For Each c As String In h
                    If LCase(f.ProcessName.ToString) = c Then
                        b = True
                        Exit For
                    Else
                        b = False
                    End If
                Next
                If b = False Then
                    f.Kill()
                    b = True
                End If
            End If
        Next
This is not C# it's VB or VB.NET

BTW codes updated.
 
Last edited:
Back