dll注入实现MFC程序劫持(4)
时间:2015-05-26 21:09:09
收藏:0
阅读:389

双击会运行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();
}
原文:http://www.cnblogs.com/ZhangJinkun/p/4531493.html
评论(0)