How to convert value to string :confused:
this is my code Is this code right or is it wrong?
thanks in advance!:handsdown:
note: I know that CloseHandle is missing :)
this is my code Is this code right or is it wrong?
thanks in advance!:handsdown:
note: I know that CloseHandle is missing :)
PHP Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace ReadMemory_function
{
public partial class Form1 : Form
{
[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(uint dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll", SetLastError = true, PreserveSig = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress,
byte[] lpBuffer, UIntPtr nSize, out int lpNumberOfBytesRead);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int PID = Process.GetProcessesByName("calc")[0].Id;
IntPtr hprocess = OpenProcess(0x0010, false, PID);
byte[] value = new byte[4];
int num;
ReadProcessMemory(hprocess, (IntPtr)0x030000, value, (UIntPtr)4, out num);
}
}
}