diff options
Diffstat (limited to 'memscan.cc')
| -rw-r--r-- | memscan.cc | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2,6 +2,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <inttypes.h> #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> @@ -28,7 +29,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){ int Remainder = Count % BytesPerLine; for(int i = 0; i < FullLines; i += 1){ - printf("%16llX | ", (Address + i * BytesPerLine)); + printf("%16" PRIXPTR " | ", (Address + i * BytesPerLine)); for(int j = 0; j < BytesPerLine; j += 1){ if(j > 0) putchar(' '); @@ -46,7 +47,7 @@ void DebugPrintBuf(uintptr Address, const uint8 *Buffer, int Count){ } if(Remainder > 0){ - printf("%16llX | ", (Address + FullLines * BytesPerLine)); + printf("%16" PRIXPTR " | ", (Address + FullLines * BytesPerLine)); for(int j = 0; j < BytesPerLine; j += 1){ if(j > 0) putchar(' '); @@ -225,7 +226,7 @@ int main(int argc, char **argv){ uintptr BaseAddr = 0; MEMORY_BASIC_INFORMATION Info; while(VirtualQueryEx(Process, (void*)BaseAddr, &Info, sizeof(Info)) != 0){ - if(Info.State & MEM_COMMIT && !(Info.Protect & PAGE_NOACCESS) && !(Info.Protect & PAGE_GUARD)){ + if((Info.State & MEM_COMMIT) && !(Info.Protect & PAGE_NOACCESS) && !(Info.Protect & PAGE_GUARD)){ ScanProcessMemory(Process, (uintptr)Info.BaseAddress, Info.RegionSize, Data, DataSize, ContextWindow); } BaseAddr = (uintptr)Info.BaseAddress + Info.RegionSize; |
