-
-
[原创]ring3 & ring0 通用InlineHook代码(修补)
-
发表于:
2008-8-27 05:00
12536
-
[原创]ring3 & ring0 通用InlineHook代码(修补)
修补加强了下,支持多核,多线程
一晚上的战绩, 希望尊重版权, 写一个ring3下的例子,ring0下就不写了,很简单
#include <stdio.h>
#include "InlineHook.h"
typedef void (__stdcall *__Sleep)(DWORD);
__Sleep realSleep = NULL;
VOID
__stdcall
MySleep(
IN DWORD dwMilliseconds
)
{
printf("Sleep(%d) Called\n", dwMilliseconds);
return realSleep(dwMilliseconds);
}
int main(int argc, char* argv[])
{
InlineHook(Sleep, MySleep, &realSleep);
Sleep(10);
UnInlineHook(Sleep, realSleep);
return 0;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!