Arkadaşlar notepada 01783010 bu adrese bir şeyler yazmak istiyorum fakat başaramıyorum ne eksik ?
Kod:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace ConsoleApp5
{
public class Program
{
const int PROCESS_VM_WRITE = 0x0020;
const int PROCESS_VM_OPERATION = 0x0008;
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess,
bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress,
byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesWritten);
public static **** Main()
{
Process process = Process.GetProcessesByName("notepad++")[0];
IntPtr processHandle = OpenProcess(0x1F0FFF, false, process.Id);
int bytesWritten = 0;
byte[] buffer = Encoding.Unicode.GetBytes("It works!\0");
WriteProcessMemory((int)processHandle, 0x01783010, buffer, buffer.Length, ref bytesWritten);
Console.ReadLine();
Console.ReadKey();
}
}
}
