OK a while ago I posted a thread asking about memory addresses and where to put the codes now I am changing my question
First question: Is this the right place for the codes?
(note: If this isn't the right place there is a chance that I will commit suicide)
Second question: lots of things I can't get or can't understand!
dwProcessId ----> How to get it?
lpBaseAddress ---> Is this where I should put the memory address?
byte[] lpBuffer ---> What exactly is this and how to get it?!
This is my full code (thanks in advance)
If there is any thing wrong with the code other than the empty spots please tell me. (thanks again)
I know this isn't actually related to CO but most of epvp coders are Germans.
First question: Is this the right place for the codes?
(note: If this isn't the right place there is a chance that I will commit suicide)
Second question: lots of things I can't get or can't understand!
dwProcessId ----> How to get it?
lpBaseAddress ---> Is this where I should put the memory address?
byte[] lpBuffer ---> What exactly is this and how to get it?!
This is my full code (thanks in advance)
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using System.Security.Permissions;
using System.Security.Principal;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
enum ProcessAccessFlags : uint
{
All = 0x001F0FFF,
Terminate = 0x00000001,
CreateThread = 0x00000002,
VMOperation = 0x00000008,
VMRead = 0x00000010,
VMWrite = 0x00000020,
DupHandle = 0x00000040,
SetInformation = 0x00000200,
QueryInformation = 0x00000400,
Synchronize = 0x00100000
}
[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(ProcessAccessFlags 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);
static void Main(string[] args)
{
IntPtr hProcess = OpenProcess(ProcessAccessFlags.VMRead, false, 0x0012C0);
ReadProcessMemory(hProcess, 0xE72E40, , 4, 0);
}
}
}
I know this isn't actually related to CO but most of epvp coders are Germans.