Hello, I just want to loop through memory, and If value spotted then replace it with other value. My problem is - it's too slow. Iterate from 0x12000000 to 0x14000000 takes years.
Well, obviously you would need to remove the cout for speed, right? But you say it crashes without the cout? That's probably because it's so much faster without it that it reads into memory that you maybe don't have access to.
It's also obviously going to be slower to read the memory piecemeal instead of grabbing it all at once and scanning it afterwards. It's only about 32 megs. Read it all, scan it and make your replacements, write it all back. Or if there's only a few replacements, you could just write those back. And test the return value of ReadProcessMemory to see if it fails.
What is DOUBLE? If that represents a double floating point value, then they are 64 bits, not 32 (the size of a DWORD).
I assume you are looking for something high performance or really small since you are soliciting C++ programmers. This is my area of specialtyhttps://www.krogerfeedback.nl https://talktosonic.onlhttps://talktowendys.vip I do much work in Windows. In fact, I believe I am the only person, ever, to a have a patent on MS Windows without having worked at MS.
Send me a better project description and a email and I will forward my resume. Thanks
if you want to keep the printed data but get it quickly, redirect it.
program.exe > filename
will buffer the output into a text file at astonishing speeds compared to the sluggish performance of cout/print to screen calls. Also remember to compile it optimized.
I do not know why it is crashing, do you have an error message or anything useful?
memory.h is a C header that could cause you woes having a new file with same name. Be careful here.
Exact checking of double values is often folly, but I am assuming something as low level as this, you know what you are doing and looking for.