[RESOLVED] [2.0] Question about ReadProcessMemory
This is my declaration:
[DllImport("kernel32.dll")]
public static extern int ReadProcessMemory(IntPtr hProcess, Int32 lpBaseAddress, [In, Out] byte[] buffer, Int32 nSize, [In, Out] Int32 lpNumberOfbytesWritten);
//
int BytesWritten = 0;
byte[] data = new byte[260];
ReadProcessMemory(lpProcess, iFile, data, 260, BytesWritten);
MessageBox.Show("Bytes: " + BytesWritten + "\nData: " + data);
This is what I tested:
1. lpProcess is valid handle :thumb:
2. iFile is the address and also valid :thumb:
The thing is that data (the buffer), must return a string... and the messagebox returns this:
Quote:
Bytes: 0
Data: System.Byte[]
any ideas???
Re: [2.0] Question about ReadProcessMemory
Try:
Quote:
MessageBox.Show(System.Text.Encoding.ASCII.GetString(data));
Re: [2.0] Question about ReadProcessMemory
Thank you...
Some letters doesn't show, for example "í" is replace by a square....but the example you gave me, left me to this:
vb Code:
System.Text.Encoding.GetEncoding("ISO-8859-1").GetString(data);
Thanks! ;)