From anonymous, 5 Days ago, written in Plain Text.
Embed
  1. DWORD Scan(char* content)
  2. {
  3.     SYSTEM_INFO SystemInfo;
  4.     GetSystemInfo(&SystemInfo);
  5.     DWORD PageSize = SystemInfo.dwPageSize;
  6.     MEMORY_BASIC_INFORMATION meminfo;
  7.     DWORD Start = (DWORD)SystemInfo.lpMinimumApplicationAddress;
  8.     DWORD End = (DWORD)SystemInfo.lpMaximumApplicationAddress;
  9.     for (DWORD lpAddress = Start; lpAddress <= End; lpAddress += PageSize)
  10.     {
  11.         VirtualQuery((void*)lpAddress, &meminfo, PageSize);
  12.         if (meminfo.Type == MEM_MAPPED) continue;
  13.         if (meminfo.Protect == PAGE_READWRITE) {
  14.             DWORD Address = SearchAddress(lpAddress, PageSize, (PBYTE)content, "xxxx");
  15.             if (Address != NULL)
  16.                 return Address;
  17.         }
  18.     }
  19. }