Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hello,

I'm developer of the anti-cheat for the game and I need stop procces by original name...
I add photos: https://ctrlv.cz/shots/2017/07/03/fjm8.png[^]

PLEASE HELP !!! (VB.NET code please...)


-Majniik_

What I have tried:

I tried stop by process ID and stop process Application.exe, when i rename this hack, hack's procces will be like his name...
Posted
Updated 7-Jul-17 12:54pm
v4

1 solution

I used Code Converter[^] to convert this C# code

C#
foreach (Process process in Process.GetProcessesByName(YourProcessNameHere.exe))
{
    if (process.Id != current.Id)
    {
        process.Kill();
    }
}


to VB, so here is the VB version


VB
For Each process__1 As Process In Process.GetProcessesByName("YourProcessNameHere.exe")
	If process__1.Id <> current.Id Then
		process__1.Kill()
	End If
Next


Where YourProcessNameHere.exe is to be replaced with the applications you need to kill, ex: KC9.exe.
 
Share this answer
 
Comments
Member 13290915 3-Jul-17 14:20pm    
This is not, what i wanted... If (for example) KC9.exe rename to (for example) Radar.exe -> process will be renamed to Radar.exe ... I must to kill original process name (photos)

Help please !
David_Wimbley 3-Jul-17 14:51pm    
So why do you change Process.GetProcessesByName("YourProcessNameHere.exe") to Process.GetProcesses. Then loop over the processes, use FileVersionInfo to see if the description of the processes contains Application.exe.


foreach (var p in Process.GetProcesses())
{
FileVersionInfo f = FileVersionInfo.GetVersionInfo(p.MainModule.FileName);

if(f.FileDescription.Contains("Application.exe"))
{
p.Kill();
}
}

Member 13290915 3-Jul-17 15:24pm    
This is 32-bit program :/ https://ctrlv.cz/shots/2017/07/03/5vn8.png
Code on 32-bit ????
David_Wimbley 3-Jul-17 15:37pm    
Two things to try.

1) You could change your app you are making from any cpu platform to say...x64 platform.

2) Or, I'd suggest looking at these links for your fix.

https://stackoverflow.com/questions/9501771/how-to-avoid-a-win32-exception-when-accessing-process-mainmodule-filename-in-c

https://stackoverflow.com/questions/5497064/c-how-to-get-the-full-path-of-running-process/5497319#5497319
Member 13290915 3-Jul-17 15:56pm    
Still it doesn't work... Is any another code to do this? Please...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900