How to get read AND write access to wow process? menu

User Tag List

Results 1 to 9 of 9
  1. #1
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get read AND write access to wow process?

    Right now i only have read access, and i do it like this:

    Code:
    public Memory(int ProcessID)
            {
                this.ProcessID = ProcessID;
                System.Diagnostics.Process.EnterDebugMode();
    
                ProcessHandle = OpenProcess(OpenProcess_Access.VMRead | OpenProcess_Access.QueryInformation, false, ProcessID);
                if (ProcessHandle == 0)
                    throw new Win32Exception("Unable to open process ID " + this.ProcessID);
            }
    But i've come so far that i want to write to memory (i can fetch data i need). I've tried OpenProcess_Access.VMWrite but big bad message box says "Access Denied" all the time (silly box :P)

    How to get read AND write access to wow process?
  2. #2
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WriteProcessMemory Function (Windows)

    Originally Posted by msdn
    hProcess [in]
    A handle to the process memory to be modified. The handle must have PROCESS_VM_WRITE and PROCESS_VM_OPERATION access to the process.
    And if you still getting errors, you're not running as admin or something.

  3. #3
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okey, thanks for the input. Changed code to

    Code:
    ProcessHandle = OpenProcess(OpenProcess_Access.VMWrite & OpenProcess_Access.VMOperation, true, ProcessID);
    And instead of access denied i got:

    System.ComponentModel.Win32Exception: Unable to open process ID 4348

    Im sure i run as Admin cuz i tried to build and then open EXE as administrator (running win7)

  4. #4
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Changed somethings... and got this error:

    System.ComponentModel.Win32Exception: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

    Wierd as it should work(it should, shouldnt it? )

    Code:
    const uint PROCESS_ALL_ACCESS = 0x000F0000 | 0x00100000 | 0xFFF;
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS , false, ProcessID);
    the error shows up when the program tries to read a float.

    what throws my exception:
    Code:
            public float ReadFloat(uint address)
            {
                float value = 0f;
                int returnLength = 0;
                if (!ReadProcessMemory(ProcessHandle, address, out value, Marshal.SizeOf(value), out returnLength))
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                return value;
            }

  5. #5
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OpenProcess_Access.VMWrite & OpenProcess_Access.VMOperation
    Learn something about bit operators


    And for the second problem - change your import of ReadProcessMemory to:

    Code:
                [DllImport( "kernel32.dll", SetLastError = true )]
                public static extern bool ReadProcessMemory( IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] lpBuffer, int nSize, out int lpNumberOfBytesRead );
    Last edited by Kryso; 09-26-2009 at 02:06 PM.

  6. #6
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Kryso View Post
    Learn something about bit operators


    And for the second problem - change your import of ReadProcessMemory to:

    Code:
                [DllImport( "kernel32.dll", SetLastError = true )]
                public static extern bool ReadProcessMemory( IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] lpBuffer, int nSize, out int lpNumberOfBytesRead );
    My operator mistake was allready corrected if you look at my third post. Should be working: const uint PROCESS_ALL_ACCESS = 0x000F0000 | 0x00100000 | 0xFFF;


    But is there a difference is ur dll import and (??)

    Code:
    [DllImport("kernel32.dll", SetLastError = true)]
            public static extern bool ReadProcessMemory(
             int hProcess,
             uint lpBaseAddress,
             out byte[] buffer,
             int dwSize,
             out int lpNumberOfBytesRead
            );
    Anyways... my reading was working all dandy and nice, it was when i tried to include some writing and add access the problems started.

  7. #7
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does your application have debug privileges?
    Kryso's right using winapi through importing necessary dll.
    My code is unmanaged!)))
    i did it 4 lulz

  8. #8
    bigtimt's Avatar Active Member
    Reputation
    41
    Join Date
    Mar 2008
    Posts
    100
    Thanks G/R
    2/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the record. if you are using .Net and you use Process.EnterDebugMode(), you can also use Process.Handle. no need for OpenProcess.
    The handle received from Process.Handle is an All_Access handle

  9. #9
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But is there a difference is ur dll import and (??)
    [In, Out] != out

Similar Threads

  1. [Guide] How to get you and others easy Blazing chest and make easy cash
    By Bippy in forum World of Warcraft Guides
    Replies: 3
    Last Post: 09-13-2013, 12:31 AM
  2. Looking for a C# Programmer (memory reading and writing)
    By Vanguards in forum WoW Memory Editing
    Replies: 2
    Last Post: 02-05-2012, 12:31 PM
  3. Reading and writing strings
    By miceiken in forum WoW Memory Editing
    Replies: 9
    Last Post: 03-10-2010, 03:49 PM
  4. How to get alli and horde to under stand each other with out learning the skill
    By project anthrax in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 07-07-2008, 07:51 PM
  5. need help (don't know how to get the edits to work in wow)
    By Daluur in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 01-07-2008, 10:16 AM
All times are GMT -5. The time now is 12:15 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search