stefansundin / superf4

:file_folder: Kill programs instantly with Ctrl+Alt+F4. (Windows)
https://stefansundin.github.io/superf4/
GNU General Public License v3.0
660 stars 39 forks source link

[Concern] Is this program susceptible to cheat detection? #33

Open NanoCats opened 5 years ago

NanoCats commented 5 years ago

I'm just wary of anything that runs in the background and could get me in trouble/banned form video games.

stefansundin commented 5 years ago

It's a fair question. I'd say that the chance is extremely low. SuperF4 does listen for keypresses to detect the button combination. The program does not attempt to read the memory or alter other processes, which I think is what most cheat programs do.

When SuperF4 detects the key combination, it does the following:

  1. Attempts to give itself SeDebugPrivilege in order to kill any process (but may still be limited to kill elevated processes, if SuperF4 itself is not elevated). https://support.microsoft.com/en-us/help/131065/how-to-obtain-a-handle-to-any-process-with-sedebugprivilege
  2. Tries to get a handle to the process we are going to kill with:
    process = OpenProcess(PROCESS_TERMINATE, FALSE, pid)

    https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocess

  3. Tries to kill the process with:
    TerminateProcess(process,1)

    https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-terminateprocess

  4. Removes SeDebugPrivilege from itself.

See the code here: https://github.com/stefansundin/superf4/blob/2a6afbee2927e5f67f26c009347d4ca071db0a15/superf4.c#L204-L291

But as always, I take no responsibility for anything. Use at your own risk.

It would be interesting to ask the same question to some game developers.. how do their anti-cheat protection try to detect cheaters?

Synetech commented 3 years ago

Any anti-cheat that would "catch" this would also catch any macro/hotkey program as well as Windows' built-in taskkill and Task Manager. Besides, this isn't a cheating tool, it's no different than pressing Alt+F4 or killing it with the Task Manager; any game that prevents you from exiting the game has bigger problems than players cheating. ¬_¬