![261924251497861.png](https://i-blog.csdnimg.cn/blog_migrate/2975d48940a7ffc82e99dc6c76c819cc.png)
双击会运行system("pause")打开计算器
现在禁止打开
#include
<stdio.h>
#include
<stdlib.h>
#include
<windows.h>
#include
<string.h>
#include
"detours.h"
#pragma
comment
(
lib
,
"detours.lib"
)
static
int
(*oldsystem)(
const
char
* _Command) = system;
int
newsystem(
const
char
*
_Command
){
return
0;
}
void
Hook()
{
DetourRestoreAfterWith();
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach((
void
**)&oldsystem, newsystem);
DetourTransactionCommit();
}
_declspec
(
dllexport
)
void
go(){
Hook();
}