Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 16:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#] ReadWritingMemory Error [NEED HELP]

Discussion on [C#] ReadWritingMemory Error [NEED HELP] within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
b0sted's Avatar
 
elite*gold: 110
Join Date: May 2010
Posts: 487
Received Thanks: 214
[C#] ReadWritingMemory Error [NEED HELP]

Hallo Leute.

Ich hab gestern in Google eine ReadWritingMemory in C# gefunden und sie in meinem Projekt mit eingebunden:


So sieht es aus:

Code:
public class ReadWritingMemory
    {

        [Flags()]
        public enum ProcessAccessType
        {

            PROCESS_TERMINATE = 1,

            PROCESS_CREATE_THREAD = 2,

            PROCESS_SET_SESSIONID = 4,

            PROCESS_VM_OPERATION = 8,

            PROCESS_VM_READ = 16,

            PROCESS_VM_WRITE = 32,

            PROCESS_DUP_HANDLE = 64,

            PROCESS_CREATE_PROCESS = 128,

            PROCESS_SET_QUOTA = 256,

            PROCESS_SET_INFORMATION = 512,

            PROCESS_QUERY_INFORMATION = 1024,
        }

        [DllImport("kernel32.dll")]
        public static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, Int32 dwProcessId);

        [DllImport("kernel32.dll")]
        public static extern Int32 CloseHandle(IntPtr hObject);

        [DllImport("kernel32.dll")]
        public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] buffer, UInt32 size, ref IntPtr lpNumberOfBytesRead);

        [DllImport("kernel32.dll")]
        public static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] buffer, UInt32 size, ref IntPtr lpNumberOfBytesWritten);

        public static void WriteLong(string ProcessName, int Address, long Value, int nsize)
        {
            if (ProcessName.EndsWith(".exe"))
            {
                ProcessName = ProcessName.Replace(".exe", "");
            }
            Process[] processesByName = Process.GetProcessesByName(ProcessName);
            if ((processesByName.Length == 0))
            {
                MessageBox.Show((ProcessName + " is not running"));
            }
            else
            {
                IntPtr ptr = ((IntPtr)(OpenProcess(127231, 0, processesByName[0].Id)));
                if ((ptr == IntPtr.Zero))
                {
                    MessageBox.Show(("Failed to open: "
                                    + (ProcessName + "!")));
                }
                else
                {
                    int lpBaseAddress = Address;
                    long lpBuffer = Value;
                    int lpNumberOfBytesWritten = 0;
                    WriteProcessMemory3(((int)(ptr)), lpBaseAddress, ref lpBuffer, nsize, ref lpNumberOfBytesWritten);
                }
            }
        }

        [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")]
        private static extern int WriteProcessMemory1(int hProcess, int lpBaseAddress, ref int lpBuffer, int nSize, ref int lpNumberOfBytesWritten);

        [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")]
        private static extern float WriteProcessMemory2(int hProcess, int lpBaseAddress, ref float lpBuffer, int nSize, ref int lpNumberOfBytesWritten);

        [DllImport("kernel32.dll", EntryPoint = "WriteProcessMemory")]
        private static extern long WriteProcessMemory3(int hProcess, int lpBaseAddress, ref long lpBuffer, int nSize, ref int lpNumberOfBytesWritten);

        private const int PROCESS_ALL_ACCESS = 127231;
    }

Das ist Problem ist aber, wenn ich diesen Code einfüge, passiert nichts im Spiel:

Code:
if (checkBoxZ1.Checked == true)
            {
                ReadWritingMemory.WriteLong("S4Client.exe" + 0x5A40D6, 267620496);
            }
Ich wäre auf jeden Fall dankbar, wenn mir jemand helfen könnte.
b0sted is offline  
Old 08/27/2016, 05:37   #2
 
atom0s's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 175
Received Thanks: 125
You are calling the function incorrectly with the wrong parameters based on what it wants. You are also not using the function correctly with the address that you are trying to write to.
atom0s is offline  
Old 08/29/2016, 16:06   #3



 
Shawak's Avatar
 
elite*gold: 0
The Black Market: 259/0/0
Join Date: Apr 2010
Posts: 10,289
Received Thanks: 3,613
Instead of "S4Client.exe" you need to pass the base address of the s4 league process.
Shawak is offline  
Old 09/01/2016, 11:48   #4
 
elite*gold: 0
Join Date: Jun 2009
Posts: 14
Received Thanks: 1
Die pointer ändern sich auch mit jedem Update.
theplake is offline  
Reply


Similar Threads Similar Threads
ReadWritingMemory.vb hilfe
09/03/2014 - .NET Languages - 2 Replies
Hallo, ich bin anfänger im coden und weiß auch nicht ob das die richtige section ist. Für einen Hack hab ich eine adresse die value ist 30070 die adresse CshXXXX.tmp+006FB560 ;offset: 18; 2bytes Wie kann ich offset und 2bytes hier verwenden? WriteInteger("Wolfteam.bin", Label2.Text + &H006FB560, "30073")
ReadWritingMemory - Alternativen?
03/16/2014 - Wolfteam - 13 Replies
Hallöle, wollte mal fragen, was eigentlich jetzt genutzt wird, da RWM gepatcht ist. Umgeht man das nochmals irgendwie über einen Bypass oder sowas ähnliches oder werden da ganz andere Methoden genutzt? Gruß
[ENG] Error: Error 1 error C2601: 'HackMain' local function definitions are illegal
08/20/2013 - C/C++ - 1 Replies
So, as the title says I've been encountering an error Error 1 error C2601: 'HackMain' local function definitions are illegal I'm running on VC++ (Visual C++) This is my code: void HackMain() { for (;; ) { HackThread(); }
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_
04/08/2012 - elite*gold Trading - 2 Replies
API Error Code: 100 API Error Description: Invalid parameter Error Message: redirect_uri URL is not properly formatted Das bekomme ich wenn ich ne App installiere... ich habe schon 3 Apps richtig installiert, danach kam immer das bei anderen Apps die ich installiert habe.. was heisst das? redirect_uri URL is not properly formatted
ReadWritingMemory in VB08
02/25/2012 - .NET Languages - 3 Replies
Hi Leute, ich habe das hier mal aus dem Internet geladen und möchte, auch das man damit Text auslesen kann und nicht nur Zahlen. Hier der Code; Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer Const PROCESS_ALL_ACCESS = &H1F0FF Private Declare Function ReadProcessMemory1 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As...



All times are GMT +1. The time now is 16:57.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.