[Question] menu

User Tag List

Thread: [Question]

Results 1 to 1 of 1
  1. #1
    BananasMelona's Avatar Member
    Reputation
    1
    Join Date
    Jun 2017
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question]

    Hi,
    I'm new to botting and I've unfortunately been unable to read data from the game. I tried reading the tutorials in this forum and implement something similar but I don't get the right result.
    What I'm trying to do right now is simply find my player and read information related to it. If I understood the tutorials correctly, the steps are:
    -Find the local player GUID
    -Compare it to the GUID of all the objects that can be currently found in order to find the address
    -Read data...
    I'm currently stuck on step 2

    Here's my really simple code(i'm currently trying to apply this to patch 3.3.5.12340):
    Code:
    #include <Windows.h>
    #include <iostream>
    #include <string>
    
    enum ObjectManager
    {
    	CurMgrPointer = 0x00C79CE0,                 // 3.3.5a 12340
    	CurMgrOffset = 0x00002ED0,                  // 3.3.5a 12340
    	NextObject = 0x3C,                          // 3.3.5a 12340
    	FirstObject = 0xAC,                         // 3.3.5a 12340
    	LocalGUID = 0xC0,                           // 3.3.5a 12340
    };
    
    enum WoWObjectFields
    {
    	OBJECT_FIELD_GUID = 0x0,
    	OBJECT_FIELD_TYPE = 0x2,
    	OBJECT_FIELD_ENTRY = 0x3,
    	OBJECT_FIELD_SCALE_X = 0x4,
    	OBJECT_FIELD_PADDING = 0x5,
    	//TOTAL_OBJECT_FIELDS = 0x5
    };
    
    UINT READUInt(HANDLE WowHandle, UINT address) {
    	UINT val;
    	ReadProcessMemory(WowHandle, (LPVOID)(address), (LPVOID)(&val), sizeof(UINT), 0);
    	return val;
    }
    UINT64 READUInt64(HANDLE WowHandle, UINT address) {
    	UINT64 val;
    	ReadProcessMemory(WowHandle, (LPVOID)(address), (LPVOID)(&val), sizeof(UINT64), 0);
    	return val;
    }
    std::string READString(HANDLE WowHandle, UINT address, size_t length) {
    	std::string res(length, 0);
    	ReadProcessMemory(WowHandle, (LPVOID)(address), (LPVOID)(&res[0]), sizeof(char) * length, 0);
    	return res;
    }
    
    DWORD GetMemLocByGUID(HANDLE WowHandle, UINT64 guid, DWORD curMgr) {
    	DWORD nextObject = READUInt(WowHandle, curMgr + FirstObject);
    	DWORD ObjType = READUInt(WowHandle, nextObject + OBJECT_FIELD_TYPE);
    
    	while ((ObjType <= 7) && (ObjType > 0)) {
    		if (READUInt64(WowHandle, nextObject) == guid) {
    			return nextObject;
    		}
    		nextObject = READUInt(WowHandle, nextObject + NextObject);
    		ObjType = READUInt(WowHandle, nextObject + OBJECT_FIELD_TYPE);
    	}
    
    	return 0;
    }
    
    int main(int argc, char* argv[]) {
    
    	HWND Wow = FindWindow(NULL, "World of Warcraft");
    	if (!Wow) {
    		std::cout << "Failed to find window process" << std::endl;
    		return 0;
    	}
    	DWORD Pid;
    	GetWindowThreadProcessId(Wow, &Pid);
    	HANDLE WowHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, Pid);
    	SIZE_T read;
    	DWORD currentManager_pre = READUInt(WowHandle, CurMgrPointer);
    	DWORD currentManager = READUInt(WowHandle, currentManager_pre + CurMgrOffset);
    	UINT64 PGuid = READUInt64(WowHandle, currentManager + LocalGUID);
    	DWORD player = GetMemLocByGUID(WowHandle, PGuid, currentManager);
    
    	std::cout << PGuid << std::endl;
    	std::cout << player << std::endl;
    
    	
    
    	return 0;
    }
    I'd be glad if someone could help I assure you I actually tried a lot of different things before bothering you all ;D

    [Question]

Similar Threads

  1. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  2. Couple Private Server questions
    By Jboz in forum World of Warcraft General
    Replies: 21
    Last Post: 07-26-2006, 07:37 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 04:09 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search