Hello everyone I am currently trying to develop a memory scanner.
And I am having some trouble with the memory.
After calling VirtualQueryEx() to get the memory region I call ReadProcessMemory() and read the entire buffer everything is going great until I hit the process of my program. It starts as normal memory usage goes true the roof and it crashes giving me this error.
bytes To Read: 577536
EndOfBUffer.........................
bytes read 577536 from: VirtualQuery.exe
bytes To Read: 1282048
EndOfBUffer.........................
bytes read 1282048 from: VirtualQuery.exe
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Process returned 3 (0x3) execution time : 18.741 s
Press any key to continue. |
So I tried several ways of not opening my process. But with no success.
1 2
|
if (hOpenProcess != GetCurrentProcess() && hOpenProcess != FALSE)
{
|
hOpenProcess being a handle that is retrieved with OpenProcess().
I also tryd like this + several other methods
1 2 3 4
|
hOpenProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, CurrentProcEntry.th32ProcessID);
if (CurrentProcEntry.th32ProcessID != CurrentProcEntry.th32ParentProcessID && hOpenProcess != FALSE)
{
|
If anyone can steer me in the right direction it would be greatly appreciated.
And also when scanning true processes it do not seem to be allot of humanly readable content.
I wouldn't expect it to be allot of it but some atleast. Like if I have notepad up with my nick in an unsaved .Txt file shouldn't I be able to read that from memory.? Some sort of pattern recognition I can do to sort out what's what maybe? I dont mean to search for WetCode in a string i know how to do that :p . But somthing i need to do in order to make the data in the buffer look meaning full to humen eys?
Cheers
WetCode.
Edit: I`am using Code::Blocks 10.05 on Windows 7 64 bit if anyone would want to know