|
-
Jul 11th, 2007, 01:29 PM
#1
Thread Starter
Addicted Member
[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
2. iFile is the address and also valid
The thing is that data (the buffer), must return a string... and the messagebox returns this:
Bytes: 0
Data: System.Byte[]
any ideas???
-
Jul 11th, 2007, 01:42 PM
#2
I wonder how many charact
Re: [2.0] Question about ReadProcessMemory
Try:
MessageBox.Show(System.Text.Encoding.ASCII.GetString(data));
-
Jul 11th, 2007, 02:15 PM
#3
Thread Starter
Addicted Member
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!
Last edited by Kal-El; Jul 11th, 2007 at 02:16 PM.
Reason: typo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|