Cromon

CSection.cpp

Oct 18th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1.         if((mHeader.Characteristics & IMAGE_SCN_MEM_EXECUTE) != 0)
  2.         {
  3.             if(mHeader.Characteristics & IMAGE_SCN_MEM_READ)
  4.             {
  5.                 if(mHeader.Characteristics & IMAGE_SCN_MEM_WRITE)
  6.                     dwProtect = PAGE_EXECUTE_READWRITE;
  7.                 else
  8.                     dwProtect = PAGE_EXECUTE_READ;
  9.             }
  10.             else
  11.             {
  12.                 if(mHeader.Characteristics & IMAGE_SCN_MEM_WRITE)
  13.                     dwProtect = PAGE_EXECUTE_WRITECOPY;
  14.                 else
  15.                     dwProtect = PAGE_EXECUTE;
  16.             }
  17.         }
  18.         else if((mHeader.Characteristics & IMAGE_SCN_MEM_READ) != 0) {
  19.             if(mHeader.Characteristics & IMAGE_SCN_MEM_WRITE)
  20.                 dwProtect = PAGE_EXECUTE_READWRITE;
  21.             else
  22.                 dwProtect = PAGE_EXECUTE_READ;
  23.         }
  24.         else if((mHeader.Characteristics & IMAGE_SCN_MEM_WRITE) != 0) {
  25.             dwProtect = PAGE_EXECUTE_WRITECOPY;
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment