ok so i have a question about how do i use the api function writeprocessmemory in C#, i already have readprocessmemory but i can't seem to get writeprocessmemory... so if anyone could show me the call and an example (preferably a pinball example) it would be very helpful
heres what i have so far:
PHP Code:
//==============================================================================================// // Function: MemoryOpen(int ProcessID[, Enum DesiredAccess[, bool InheritHandle]])) // //______________________________________________________________________________________________// // Description: Opens a process and enables all possible access rights to the process, // // the Process ID of the process is used to specify which process to open. // //______________________________________________________________________________________________// // Parameter(s): int ProcessID - The Process ID of the program you want to open. // // // // Enum DesiredAccess - The desired access. // // -All // // -Terminate // // -CreateThread // // -VMOperation // // -VMRead // // -VMWrite // // -DupHandle // // -SetInformation // // -QueryInformation // // -Synchronize // // // // Bool InheritHandle - All processes created by this process will inherit // // the access handle. // // -true // // -false // //______________________________________________________________________________________________// // Return Value(s): On Success - Returns the process handle // // On Failure - Returns 0 // //==============================================================================================// [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, bool bInheritHandle, int dwProcessId);
//==============================================================================================// // Function: MemoryRead(IntPtr OpenedHandle, IntPtr BaseAddress, UInt32 Size, // // ref UInt32 Bytes) // //______________________________________________________________________________________________// // Description: Reads the specified amount of bytes from a memory address. // //______________________________________________________________________________________________// // Parameter(s): IntPtr OpenedHandle - The handle of the opened process returned by // // MemoryOpen. // // // // IntPtr BaseAddress - A pointer to the base address in the specified // // process from which to read. Before any data transfer// // occurs, the system verifies that all data in the // // base address and memory of the specified size is // // accessible for read access, and if it is not // // accessible the function fails. // // // // UInt32 Size - The number of bytes to be read from the specified process. // // // // ref UInt32 Bytes - A pointer to a variable that receives the number of // // bytes transferred into the specified buffer. // //______________________________________________________________________________________________// // Return Value(s): On Success - Returns buffer (containing read bytes) // // On Failure - The return value is 0 (zero) // // -The function fails if the requested read operation // // crosses into an area of the process that is inaccessible// //==============================================================================================//
static public byte[] MemoryRead(IntPtr OpenedHandle, IntPtr BaseAddress, UInt32 Size, ref IntPtr Bytes) { byte[] buffer = new byte[Size]; ReadProcessMemory(OpenedHandle, BaseAddress, buffer, Size, out Bytes); return buffer;
}
//==============================================================================================// // Function: MemoryClose(IntPtr OpenedHandle) // //______________________________________________________________________________________________// //Description: Close an opened handle to a process, returned by MemoryOpen. // //______________________________________________________________________________________________// // Parameter(s): IntPtr OpenedHandle - the handle to a opened process, returned // // by MemoryOpen. // //______________________________________________________________________________________________// // Return Value(s): On Success - The return value is nonzero. // // On Failure - The return value is zero // //==============================================================================================// [DllImport("kernel32.dll")] static extern Int32 CloseHandle(IntPtr hObject);
static int MemoryClose(IntPtr OpenedHandle) { int rtn; rtn = CloseHandle(OpenedHandle); return rtn; }
[VB]Write Memory bzw Read Memory 06/26/2010 - .NET Languages - 8 Replies Hi
Ich hab das TuT von *Guidman* benütz um einen hack zu machen.
So aber nun hab ihc ein paar fragen könnte man memory teil kürzer machen und am besten wie kann man das selber machen weil ich will nihct immer C&P machen.
Und zu Read Memory kann man das auch machen das ein Label immer die Bestimmte Ahnzahl angiebt von dem Pointer?.(Wenn das Read Memory ist ?)
Bitte helf mir
Danke
Injection vs. Memory Write 12/15/2009 - Aion - 11 Replies Hallo,
kann mir einer da mal den genauen Unterschied erklären bitte.
Ich weiß nur das Injection hohe Banngefahr hat und Memory Write wohl nicht ?
Danke
Maxx.
write memory process problem 10/28/2009 - General Coding - 3 Replies Hey Leute
Habe mir ebem mal das tut von Blackfog angeschaut.
Verstehe es auch, bloss will mein compi nich so wie ich will XD
habe es au scho mit copy and paste versucht, das ding macht einfach nix
Habe eine wichtige frage zu write process memory (packete verändern und zurück senden 10/28/2009 - General Coding - 3 Replies Hey Leute
Habe mal eine wichtige frage.
Ihr wisst doch bestimmt das man bei einem Spiel sachen bauen kann z.b eine Waffe für seinen charackter.
Ist es möglich mittels write memory process... oder auch anders z.b rohstoffe die man bekommt beliebig die anzahl zu verändern und an den server zurück zu schicken?
Ich möchte nur wissen ob es möglich ist, soweit bin ich noch nicht, werde erstmal einfache bots schreiben, die Leben auslesen und paar mobs killen können ^^.