Using Cheat Engine I find an array of bytes at address 0x10456554. I want to find the array of bytes in C#, so I open the game process with permissions 0x1F0FFF (all access) first, then I do a ReadProcessMemory() from 0x00000000 - 0x7FFFFFFF (entire process) and that section of bytes (0x10000000, etc.) is all empty.
So I tried stepping through every module and dumping the data to individual dump files. However that address section (0x10000000) was never dumped, almost like it got skipped over. Even cheat engine says that section of memory doesn't belong to a specific module. So I have no idea where it's coming from.
public IntPtr pHandle = OpenProcess(0x1F0FFF, 1, id);
public Process procs = Process.GetProcessById(id);
//dump main module first
byte[] test = new byte[procs.MainModule.ModuleMemorySize];
ReadProcessMemory(pHandle, (UIntPtr)((int)procs.MainModule.BaseAddress), test, (UIntPtr)procs.MainModule.ModuleMemorySize, IntPtr.Zero);
File.WriteAllBytes(procs.MainModule.BaseAddress.ToString("x8") + " " + procs.MainModule.ModuleName + ".dmp", test);
//now dump all other modules
foreach (ProcessModule p in procs.Modules)
{
byte[] test2 = new byte[p.ModuleMemorySize];
ReadProcessMemory(pHandle, (UIntPtr)((int)p.BaseAddress), test2, (UIntPtr)p.ModuleMemorySize, IntPtr.Zero);
File.WriteAllBytes(p.BaseAddress.ToString("x8") + " " + p.ModuleName + ".dmp", test2);
}