質問

ReadProcessMemory() seems to crash my program, when it reads undefined(?) memory.
Well my question is, how can I check if the address is undefined or whatever before I use ReadProcessMemory to avaoid crashes?

The errormessage btw:

Unhandled exception at 0x00ce1c70 in Program.exe: 0xC0000005: Access violation writing location 0x00e3f000.

役に立ちましたか?

解決

The crash is not coming because you are reading invalid / undefined memory, it is coming because you passed an invalid buffer into ReadProcessMemory. Note that the the error message says violation writing, not reading.

You need to make sure the buffer you are passing is appropriately sized for the data amount that you are requesting. If you post the code used to call the method we may be able to help spot the error

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top