Microsoft Developer Network >
Página Inicial dos Fóruns
>
.NET Base Class Library
>
Prevent SuspendThread API
Prevent SuspendThread API
- Hi.
I'm making a anti cheat for a game, and there's a cheater injector that have the option of "Suspend", analysing, it uses SuspendThread API.
How can i prevent it from suspend my app?
Respostas
- Hi,
Yes, this API is mostly used in debuggers, my idea is that we can start another working thread (or even a new process) to detect your game thread status, if the cheater suspend your game thread, the new thread can resume the game thread, or exit the game. is it acceptable to you?
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.- Marcado como RespostaeryangMSFT, Moderadorterça-feira, 17 de novembro de 2009 2:38
Todas as Respostas
- Hi,
As far as I know, a thread cannot prevent itself from been suspended by SuspendThread API, but, here is a walk-around solution: we can start a new thread, the new thread will check whether the target thread has been suspended every fixed interval, if the target thread was suspended, we can stop the game process or even terminate the game process, so that the cheater will not take effect.
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. Hi,
I already tried this.
As far as I know, a thread cannot prevent itself from been suspended by SuspendThread API, but, here is a walk-around solution: we can start a new thread, the new thread will check whether the target thread has been suspended every fixed interval, if the target thread was suspended, we can stop the game process or even terminate the game process, so that the cheater will not take effect.
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.On Form_LoadDim t As Thread = New Thread(New ThreadStart(AddressOf Verify))t.Start()Sub Verify()While TrueMsgBox("a")End WhileEnd SubI did just to se if the SuspendThread stops all threads and it stoped the Verify() too.- Hi,
Do you mean the cheater stops all threads of your game process?
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help. Hi,
No, no.
Do you mean the cheater stops all threads of your game process?
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.The anti cheat works on background (but it can be seen by the Process List of the cheat) and the cheat have a option to select the process in it Process List and then "Suspend" the process.Taking a look on a debugger it calls the SuspendThread API and then my routins are stopped and he can use the cheat.- Hi,
Yes, this API is mostly used in debuggers, my idea is that we can start another working thread (or even a new process) to detect your game thread status, if the cheater suspend your game thread, the new thread can resume the game thread, or exit the game. is it acceptable to you?
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.- Marcado como RespostaeryangMSFT, Moderadorterça-feira, 17 de novembro de 2009 2:38
Hi,
I tried do this by Process.WorkingSet(), but sometimes returns the same amount of memory. Do you have an idea on how do this?
Yes, this API is mostly used in debuggers, my idea is that we can start another working thread (or even a new process) to detect your game thread status, if the cheater suspend your game thread, the new thread can resume the game thread, or exit the game. is it acceptable to you?
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.

