登录 注册
当前位置:主页 > 资源下载 > 47 > 检查内存是否已被改动

检查内存是否已被改动

  • 更新:2024-07-23 11:12:32
  • 大小:137KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:C++ - 后端
  • 格式:RAR

资源介绍

直接代码 #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; }