文件名称:检测内存是否被修改
文件大小:137KB
文件格式:RAR
更新时间:2020-04-06 17:28:57
内存
直接代码 #include "GuardMemDll.h" #pragma comment (lib, "GuardMemDll.lib") int Test( int iTest) { if(0 == iTest ) MessageBox(NULL,"Mem Is Modified","",MB_OK); else MessageBox(NULL,"Mem is Ok","",MB_OK); return iTest; } int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { int iTest=1; CHostAssist assist; Test( iTest ); int iStat= assist.GuardMemDll( hInstance); if(1024 == iStat ) MessageBox(NULL,"Mem check ok","",MB_OK); else MessageBox(NULL,"Mem check false","",MB_OK); DWORD iWrite=0; char iData[]={0x90,0x90}; DWORD_PTR iPtr =(DWORD_PTR) hInstance + 0x2d6f0; void *pAdr = (void *)(iPtr + 0x22); WriteProcessMemory(GetCurrentProcess(), pAdr, iData, 2, &iWrite); Test( iTest ); int iStat1= assist.GuardMemDll( hInstance ); if(1024 == iStat1 ) MessageBox(NULL,"Mem check ok","",MB_OK); else MessageBox(NULL,"Mem check false","",MB_OK); return iStat; }
【文件预览】:
TestMem.vcproj
TestMem.cpp
GuardMemDll.dll
TestMem.exe
GuardMemDll.lib
GuardMemDll.h