ReClass.NET
ReClass.NET copied to clipboard
Out of memory page reading? (low prioriry)
Very rare bug, not sure it can be/should be fixed. I got a bug with reading string from memory, reading more bytes after string cause to fail reading at all. Just check my video: https://dl.dropboxusercontent.com/s/zrkpuvh4x6njohz/2018-05-08_05-44-40.mp4 I think the problem that reclass trying to read memory that goes out of memory page region and can't be read it at all.
I got this problem in my program, then I find out that this problem present in reclass too.
I'm aware of this "bug" but it is by design. ReadProcessMemory will fail if you read memory out of bounds. RPM will return false and GetLastError will be ERROR_PARTIAL_COPY. I have not tested if the first bytes are read and only the last bytes are skipped. Could you remove this line https://github.com/ReClassNET/ReClass.NET/blob/master/ReClass.NET/Memory/MemoryBuffer.cs#L116 and test if the string is still shown? If not I don't think I can provide a simple solution. A workaround would be to split the RPM call in multiple calls aligned with the memory sections but I don't know whether this is beneficial or not. Don't you use the latest version? There should be an icon which shows that the memory is not valid.
RPM doesn't read memory at all if the ERROR_PARTIAL_COPY error occurs. So the only solution is to split the RPM call in multiple calls if it spans about multiple memory regions. The current class design doesn't support this but it should be implemented in a future version.
Thanks for ur answer
Yes, seems we will get a zero array. You have a memory page regions in code, maybe you could just use them to limit reading. Or just show a warning as icon somewhere when this thing is happen. Just thoughts.
Yes, I know. But currently the MemoryBuffer class contains a single byte array. If I split the RPM calls I have to split this array too. And every Read<Type> method must be rewritten to support the bounds of the array parts.