-
👋 Does someone have any example of proper usage of ReadProcessMemory and WriteProcessMemory? Because for me function always returns 0 (what means that it did not succeed) and i have no idea what is wrong because GetLastError() does not work either and i can not check msdn error codes to find out the problem.
Handle to the process is opened with full access flag and application is launched with admin privileges. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
GetLastError does not work at this point dart-lang/sdk#38832. |
Beta Was this translation helpful? Give feedback.
-
First of all, you have a number of bugs in your code. You are passing a pointer to a pointer into the function (you even truncate it for some reason by doing int64 to int32 conversion), but you should just pass a pointer, e.g. ReadProcessMemory(activeHandle, Pointer<int>.fromAddress(lpBaseAddress), lpBuffer, nSize, nullptr) Then you should make sure that Finally, make sure that process handle has READ access right associated with it. |
Beta Was this translation helpful? Give feedback.
-
If anyone is looking for the answer:
nSize should be the same size as lpBuffer, not more, not less. (after working with java jni i thought that it's okay to make nSize even more than buffer itselft) However, writeProcessMemory still fails and i have no idea how to use it properly |
Beta Was this translation helpful? Give feedback.
If anyone is looking for the answer:
nSize should be the same size as lpBuffer, not more, not less. (after working with java jni i thought that it's okay to make nSize even more than buffer itselft)
However, writeProcessMemory still fails and i have no idea how to use it properly