C++ Wow 2.4.3 Mem Reading/Writing menu

User Tag List

Results 1 to 11 of 11
  1. #1
    Dupheadss's Avatar Contributor CoreCoins Purchaser
    Reputation
    98
    Join Date
    Aug 2015
    Posts
    147
    Thanks G/R
    38/61
    Trade Feedback
    2 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    C++ Wow 2.4.3 Mem Reading/Writing

    So I've spent the past weekend looking into this and I am still drawing blanks:

    Code:
    #include<iostream>
    #include<Windows.h>
    
    using namespace std;
    
    int main()
    {
    	int newValue = 0;
    	HWND hwnd = FindWindowA(NULL, "World of Warcraft");
    	if (hwnd == NULL)
    	{
    		cout << "Woops homie can't find Wow." << endl;
    		Sleep(3000);
    			exit(-1);
    		}
    	else
    	{
    		DWORD procID;
    		GetWindowThreadProcessId(hwnd, &procID);
    		HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
    
    
    		if (procID == NULL)
    		{
    
    			cout << "Cannot Find window procces." << endl;
    			Sleep(3000);
    				exit(-1);
    
    		}
    		else
    		{
    			WriteProcessMemory(handle, (LPVOID)0x008C8398, &newValue, sizeof(newValue), 0);
    		}
    
    	}
    
    
    
    	return 0;
    }

    There are no errors and the WriteProccesMem differently is triggered however it does not do any writing, Any help would be amazing thanks!

    PS:
    The address is taken from a 2.4..5 dump thread and works checked with Cheat Engine.
    We are trying to change the vaule of 0x008C8398 to 0 (Allowing Wall Climb)
    Last edited by Dupheadss; 06-04-2017 at 10:59 AM.

    C++ Wow 2.4.3 Mem Reading/Writing
  2. Thanks Jansi (1 members gave Thanks to Dupheadss for this useful post)
  3. #2
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1584
    Join Date
    May 2010
    Posts
    1,824
    Thanks G/R
    188/531
    Trade Feedback
    16 (100%)
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    What's the page type? Try VirtualProtect I guess.

    VirtualProtect function (Windows)

    I would also check if you have a valid handle. Or output GetLastEror() and see if you get anything.
    Last edited by DarkLinux; 06-04-2017 at 05:35 PM.

  4. Thanks Dupheadss, Jansi (2 members gave Thanks to DarkLinux for this useful post)
  5. #3
    namreeb's Avatar Legendary

    Reputation
    658
    Join Date
    Sep 2008
    Posts
    1,023
    Thanks G/R
    7/215
    Trade Feedback
    0 (0%)
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Hint: do not ignore the result of WriteProcessMemory()

  6. Thanks Dupheadss (1 members gave Thanks to namreeb for this useful post)
  7. #4
    Dupheadss's Avatar Contributor CoreCoins Purchaser
    Reputation
    98
    Join Date
    Aug 2015
    Posts
    147
    Thanks G/R
    38/61
    Trade Feedback
    2 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply I'll look into VirtualProtect in a bit, However.
    GetLastError() returned 6 after some googling it says that error points to an invalid Handler?
    So I printed the handle to console and got
    00000000000204E0

    PID: 3612

    CheatEng Handle : 00000E1C-Wow.exe
    Any tips?

    EDIT --------
    Did some more digging and found that the OpenProcess is throwing the error 5 (Access Denied )
    if you could show me a tut on your VirtualProtect Function I'd be grateful.
    Last edited by Dupheadss; 06-05-2017 at 10:13 AM.

  8. #5
    Corthezz's Avatar Elite User Authenticator enabled
    Reputation
    386
    Join Date
    Nov 2011
    Posts
    325
    Thanks G/R
    183/98
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nothing about a good old google search:
    LMGTFY

    Also about OpenProcess:
    OpenProcess returns access denied
    Check my blog: https://zzuks.blogspot.com

  9. Thanks Dupheadss (1 members gave Thanks to Corthezz for this useful post)
  10. #6
    tperkz's Avatar Member
    Reputation
    2
    Join Date
    Jun 2017
    Posts
    1
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had a similar problem and found that i had forgotten to run the compiled exe with admin priviledges

  11. Thanks Dupheadss (1 members gave Thanks to tperkz for this useful post)
  12. #7
    Dupheadss's Avatar Contributor CoreCoins Purchaser
    Reputation
    98
    Join Date
    Aug 2015
    Posts
    147
    Thanks G/R
    38/61
    Trade Feedback
    2 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So i have used VirtualProtectEx However it is throwing the error of invalid Handle ?
    using the Handle i get from FindWindowA()

  13. #8
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1584
    Join Date
    May 2010
    Posts
    1,824
    Thanks G/R
    188/531
    Trade Feedback
    16 (100%)
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Try,

    Enumerating All Processes (Windows)

    Also, run your app as admin.

  14. #9
    Dupheadss's Avatar Contributor CoreCoins Purchaser
    Reputation
    98
    Join Date
    Aug 2015
    Posts
    147
    Thanks G/R
    38/61
    Trade Feedback
    2 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    My handle is returning 262900 ? that doesn't seem right.

  15. #10
    tutrakan's Avatar Contributor
    Reputation
    134
    Join Date
    Feb 2013
    Posts
    175
    Thanks G/R
    124/52
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if this is your issue, but from my experience i had to change AdjustTokenPrivileges for my TBC and Vanilla c++.

  16. #11
    Jansi's Avatar Member
    Reputation
    2
    Join Date
    Mar 2015
    Posts
    3
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to learn C++ -> WoW injection and your post was a great start. DarkLinux was right - after setting VirtualProtectEx your code works (with admin privileges).

    One thing I noticed is that you are setting an int value, but the variable is of type float. I am not sure if it makes any difference since we are changing it to zero.

    Here is the complete working sample (Visual Studio, Windows 10):
    Code:
    #include <iostream>
    #include <Windows.h>
    
    int main() {
      HWND hWnd = FindWindow(0, TEXT("World of Warcraft"));
    
      if (hWnd == 0) {
    	  std::cerr << "Error cannot find window." << std::endl;
      } else {
        DWORD proccessID;
    
        GetWindowThreadProcessId(hWnd, &proccessID);
        HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccessID);
    
        if (!hProcess) {
    		std::cerr << "Could not open the process!" << std::endl;
        } else {
    		float newData = 0.0;
    		float oldData = 0.0;
    		DWORD oldProtect = 0;
    		LPVOID address = (LPVOID)0x008C8398;
    
    		if (ReadProcessMemory(hProcess, address, &oldData, sizeof(oldData), NULL)) {
    			std::cout << "Old Climb value: " << oldData << std::endl;
    		}
    
    		// Enable writing to the page
    		VirtualProtectEx(hProcess, address, sizeof(newData), PAGE_EXECUTE_READWRITE, &oldProtect);
    
    		if (!WriteProcessMemory(hProcess, address, &newData, sizeof(newData), NULL)) {
    			std::cerr << "Error in WriteProcessMemory: " << GetLastError() << std::endl;
    		}
    	  
    		// Restore the original rights
    		VirtualProtectEx(hProcess, address, sizeof(newData), oldProtect, NULL); 
    
    		if (ReadProcessMemory(hProcess, address, &oldData, sizeof(oldData), NULL)) {
    			std::cout << "New Climb value: " << oldData << std::endl;
    		}
    
    		CloseHandle(hProcess);
        }
      }
    
      std::getchar();
    
      return 0;
    }

  17. Thanks Dupheadss (1 members gave Thanks to Jansi for this useful post)

Similar Threads

  1. (Tutorial) Starting WoW-Memory Reading/Writing
    By Mrbrightside in forum WoW Memory Editing
    Replies: 198
    Last Post: 06-02-2017, 05:11 PM
  2. WoW Memory reading/writing questions
    By mathix in forum WoW Memory Editing
    Replies: 3
    Last Post: 03-11-2013, 08:17 AM
  3. i NEED WOW+TBC CD KEYS PLZ READ!!!
    By Kileris in forum Community Chat
    Replies: 1
    Last Post: 01-28-2008, 09:13 AM
  4. What is good about wow? [Parents will buy wow for you after they read this!]
    By latruwski in forum Screenshot & Video Showoff
    Replies: 8
    Last Post: 12-15-2007, 06:58 PM
  5. WTT WoW account for glider key. READ.
    By Elites360 in forum Members Only Accounts And CD Keys Buy Sell
    Replies: 3
    Last Post: 02-21-2007, 10:39 AM
All times are GMT -5. The time now is 04:11 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