Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can I use readprocessmemory?
#1
thank you,yijingjiejueliao.
#2
If you want to write 2 bytes to scp, pass its address, not itself. Replace +scp to &scp.

QM also has class __ProcessMemory that can be used for it.
Macro Macro1374
Code:
Copy      Help
int pid = ProcessNameToId("notepad" 0 1)
__ProcessMemory m.Alloc(pid 0 1) ;;just opens process, does not allocate
int scp
m.ReadOther(+0x0100A5f1, &scp, 2)
err end _error
out scp
#3
thank you.
#4
Code:
Copy      Help
int pid = ProcessNameToId("notepad" 0 1)
__ProcessMemory m.Alloc(pid 0 1) ;;just opens process, does not allocate
int scp
m.ReadOther(+0x0100A5f1, &scp, 2)
err end _error
out scp

The above code gives me an error. I am on Windows7 64 bit if that helps any.

Code:
Copy      Help
Error (RT) in Macro:  Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

I tried running the same code again and it gave me a new error.

Code:
Copy      Help
Error (RT) in Macro:  Invalid access to memory location.
#5
That code is not working as is. It was just as example. It also has a bug, sorry.

To read 2 bytes from a known address in other process to int variable scp:
Macro Macro1779
Code:
Copy      Help
byte* addressInOtherProcess=+0x0100A5f1 ;;this must be a valid address in other process. In this example it will probably give error because 0x0100A5f1 is probably an invalid address.

int pid = ProcessNameToId("notepad" 0 1)
__ProcessMemory m.Alloc(pid 0 1) ;;just opens process, does not allocate
int scp
m.ReadOther(&scp addressInOtherProcess 2)
err end _error
out scp
#6
Thank you so much for your help! I was able to get my code working.


Forum Jump:


Users browsing this thread: 4 Guest(s)