![]() |
|
[C#] Detecting if programs are running - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Detecting if programs are running (/showthread.php?tid=5875410) Pages: Pages
1
2
|
Detecting if programs are running - ExceptionAmoto - Aug 18, 2018 Hello HF 🤝 i have a simple question for you. I want to know if applications that are used for debugging and looking into your programs are running for example, if my program is running and Fiddler is running then close fiddler and my program. so if Fiddler, Cheat Engine, or other cracky apps are running -> Close. how would i accomplish that? RE: Detecting if programs are running - Lync - Aug 18, 2018 Tested and working, upon being ran it will check all processes for a "Bad Program". Once done, it will create two events using the ManagementEventWatcher for when new executables are launched or closed. Just add the names to the List at the bottom of the code. Don't worry about case sensitivity as I have used the extension method ToLower() on them. Make sure you reference System.Management from your Framework Assemblies if you are using a Console Application. https://pastebin.com/QFUWZMsz RE: Detecting if programs are running - ExceptionAmoto - Aug 18, 2018 (Aug 18, 2018 02:43 PM)Pitri Wrote: Tested and working, upon being ran it will check all processes for a "Bad Program". Once done, it will create two events using the ManagementEventWatcher for when new executables are launched or closed. Just add the names to the List at the bottom of the code. Don't worry about case sensitivity as I have used the extension method ToLower() on them. Make sure you reference System.Management from your Framework Assemblies if you are using a Console Application. hello! thank you for fast response! i don't want to ask too much, but you don't have a list of "bad" program names by any chance? RE: Detecting if programs are running - Lync - Aug 18, 2018 (Aug 18, 2018 03:10 PM)ExceptionAmoto Wrote: hello! thank you for fast response! No I don't, the name doesn't have to be full/exact, partial names will work. So for example Notepad++ can be "notepad". You will have to run the programs you want to block and see what their process name is. Otherwise you can just guess and write a partial name for it. RE: Detecting if programs are running - Washi - Aug 18, 2018 (Aug 18, 2018 03:14 PM)Pitri Wrote: No I don't, the name doesn't have to be full/exact, partial names will work. So for example Notepad++ can be "notepad". You will have to run the programs you want to block and see what their process name is. Otherwise you can just guess and write a partial name for it. I mean, any experienced user of those kind of applications will see through that immediately and just rename the executable file to something that sounds harmless... RE: Detecting if programs are running - Lync - Aug 18, 2018 (Aug 18, 2018 04:07 PM)Washi Wrote: I mean, any experienced user of those kind of applications will see through that immediately and just rename the executable file to something that sounds harmless... Obviously, doesn't take a rocket scientist to figure that out. RE: Detecting if programs are running - ExceptionAmoto - Aug 18, 2018 is there a way to detect it even if they change the executable name? RE: Detecting if programs are running - Lync - Aug 18, 2018 (Aug 18, 2018 04:48 PM)ExceptionAmoto Wrote: is there a way to detect it even if they change the executable name? Not really, you could look at the assembly information and check for it there. You are asking to detect a multitude of different programs that serve different purposes. Doing such would require a different technique for each type of program. For example, you wouldn't use the detection method for Fiddler too find Cheat Engine as they are two entirely different types of applications with two entirely different purposes. RE: Detecting if programs are running - LustWare - Aug 20, 2018 is this correct? O.o [img]http://get.infistar.ban-ned.today/FHf4v8KM/3nsIk3v3o9wsmgVn.png[/img] Code private static List<string> badPrograms = new List<string>()RE: Detecting if programs are running - Lync - Aug 20, 2018 (Aug 20, 2018 01:09 PM)Peakz Wrote: is this correct? O.o The List? What is that screenshot? It doesn't look like a console app which is what I wrote in my code. Also, why are you closing random apps that aren't even in the List lol. Not really sure what you are asking here lol. RE: Detecting if programs are running - LustWare - Aug 20, 2018 (Aug 20, 2018 01:57 PM)Pitri Wrote: The List? What is that screenshot? It doesn't look like a console app which is what I wrote in my code. Also, why are you closing random apps that aren't even in the List lol. Not really sure what you are asking here lol. i've made it so it reports back to my backend server each time it closes a app. and with those settings its closing things at random.. https://pastebin.com/bPv7edVP RE: Detecting if programs are running - Lync - Aug 20, 2018 (Aug 20, 2018 02:10 PM)Peakz Wrote: i've made it so it reports back to my backend server each time it closes a app. I can't reproduce your issue, when running the code that I have sent too OP as administrator it works as intended. RE: Detecting if programs are running - LustWare - Aug 20, 2018 (Aug 20, 2018 02:26 PM)Pitri Wrote: I can't reproduce your issue, when running the code that I have sent too OP as administrator it works as intended. well its not actually closing these processes.. but it logs and says that it does. RE: Detecting if programs are running - Lync - Aug 20, 2018 (Aug 20, 2018 03:05 PM)Peakz Wrote: well its not actually closing these processes.. It does not log that it is closing those types of programs for me. It works entirely as intended for me. Not sure what your issue could be. RE: Detecting if programs are running - Angela White - Aug 20, 2018 if it's logging that it's closing something and it's not closing it, make sure where you're logging the process name is in the same space as where it actually closes said process. Sounds to me like you're doing something like Code void blah (string ProcessName)you might want to check that out or message me and i'll fix it for you i have nothing else to do today |