bool readMap(HANDLE process) { unsigned long width, height; unsigned long xcount, ycount; unsigned long offset; unsigned long *xoffsets, *yoffsets; ReadProcessMemory(process, (void *)MAP_DATA, &offset, sizeof(unsigned long), NULL); ReadProcessMemory(process, (void *)MAP_WIDTH, &width, sizeof(unsigned long), NULL); ReadProcessMemory(process, (void *)MAP_HEIGHT, &height, sizeof(unsigned long), NULL); ReadProcessMemory(process, (void *)MAP_XCOUNT, &xcount, sizeof(unsigned long), NULL); ReadProcessMemory(process, (void *)MAP_YCOUNT, &ycount, sizeof(unsigned long), NULL); printf("%d,%d\n", width, height); xoffsets = (unsigned long *)malloc(xcount * sizeof(unsigned long)); memset(xoffsets, 0, xcount * sizeof(unsigned long)); ReadProcessMemory(process, (void *)offset, xoffsets, xcount * sizeof(unsigned long), NULL); for (unsigned long x = 0; x < xcount; x++) { printf("%08X\n", xoffsets[x]); yoffsets = (unsigned long *)malloc(ycount * sizeof(unsigned long)); memset(yoffsets, 0, ycount * sizeof(unsigned long)); ReadProcessMemory(process, (void *)xoffsets[x], yoffsets, ycount * sizeof(unsigned long), NULL); for (unsigned long y = 0; y < ycount; y++) { printf(" %08X\n", yoffsets[y]); } } free(xoffsets); return true; }