c++ function get_base_address menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    prontime3's Avatar Private
    Reputation
    1
    Join Date
    Aug 2012
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    c++ function get_base_address

    Hello! Help me plz. I am looking for function on c++, like this
    Func GETWOWBASEADDRESS($PID)

    $HSNAP = DllCall("Kernel32.dll", "HANDLE", "CreateToolhelp32Snapshot", "DWORD", 8, "DWORD", $PID)

    $STMODULE = DllStructCreate("DWORD dwSize;DWORD th32ModuleID;DWORD th32ProcessID;" & "DWORD GlblcntUsage;DWORD ProccntUsage;ptr modBaseAddr;" & "DWORD modBaseSize;HANDLE hModule;WCHAR szModule[256];" & "WCHAR szExePath[260]")

    DllStructSetData($STMODULE, "dwSize", DllStructGetSize($STMODULE))

    $RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32FirstW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))

    IF ($RET[0] = False) Then
    DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])
    Return 0
    Else
    $RET[0] = True
    Do
    If DllStructGetData($STMODULE, "szModule") = "Wow.exe" Then

    DllCall("Kernel32.dll", "BOOLEAN", "CloseHandle", "HANDLE", $HSNAP[0])

    Return DllStructGetData($STMODULE, "modBaseAddr")
    EndIf
    $RET = DllCall("Kernel32.dll", "BOOLEAN", "Module32NextW", "HANDLE", $HSNAP[0], "ptr", DllStructGetPtr($STMODULE))
    Until $RET[0] = False
    EndIf
    EndFunc ;==>GETWOWBASEADDRESS

    c++ function get_base_address
  2. #2
    reliasn's Avatar Legendary Authenticator enabled
    Reputation
    774
    Join Date
    Jan 2009
    Posts
    136
    Thanks G/R
    24/215
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by prontime3 View Post
    Hello! Help me plz. I am looking for function on c++, like this
    I use this one (some unnecessary code was removed):
    I copied some of the code from OHack's source code (thank this guy here - l0l1dk)and adapted some stuff to my needs...

    Code:
    void attachWoW(LPVOID param){
    	DWORD pid;
    	HWND hwnd;
    	try	{
    		void* Token = NULL;
    		TOKEN_PRIVILEGES Privileges;
    		if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, reinterpret_cast<void**>(&Token)) == 0)
    		{
    			throw Exception("Unable to open the local process token.");
    		}
    		Privileges.PrivilegeCount = 1;
    		LookupPrivilegeValue(NULL, "SeDebugPrivilege", &Privileges.Privileges[0].Luid);
    		Privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    		AdjustTokenPrivileges(Token, 0, &Privileges, sizeof(Privileges), NULL, NULL);
    		CloseHandle(Token);
    		hwnd = FindWindow("GxWindowClass", "World of Warcraft");
    		if(!hwnd)//didn't find the window
    		{
    			//cout <<"Window not found!\n";
    		}
    		else
    		{
    			GetWindowThreadProcessId(hwnd,&pid);
    			HANDLE phandle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);//get permission to read
    			MODULEENTRY32 module; 
    			module.dwSize = sizeof(MODULEENTRY32);
    			Module32First(phandle, &module);
    			CloseHandle(phandle);
    			void* Handle = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
    			char name[20];
    			ReadProcessMemory(Handle2, reinterpret_cast<void*>(reinterpret_cast<unsigned int>(module.modBaseAddr) + PlayerNameOffset), &name, sizeof(name), 0);			
                            DWORD currMgr_pre;
    			ReadProcessMemory(Handle2, reinterpret_cast<void*>(reinterpret_cast<unsigned int>(module.modBaseAddr) + CurMgrPointer), &currMgr_pre, sizeof(currMgr_pre), 0);
    			DWORD currMgr;
    			ReadProcessMemory(Handle2, reinterpret_cast<void*>(currMgr_pre + CurrMgrOffset), &currMgr, sizeof(currMgr), 0);
    			UINT64 p_guid;
    			ReadProcessMemory(Handle2, reinterpret_cast<void*>(currMgr + localPlayerGUIDOffset), &p_guid, sizeof(p_guid), 0);
    		}
    	}
    	catch(exception Exception)
    	{
    		cout << Exception.what() << " Error: " << GetLastError() << std::endl;
    	}
    }
    PS: I don't think this is the right section for this. Go to this section instead where you will have better support.
    Last edited by reliasn; 08-05-2012 at 11:31 PM.

  3. #3
    prontime3's Avatar Private
    Reputation
    1
    Join Date
    Aug 2012
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx =)
    Originally Posted by reliasn View Post
    PS: I don't think this is the right section for this. Go to this section instead where you will have better support.
    sorry for this mistake)

Similar Threads

  1. [Release] Scan Pixels function for VB.net
    By suicidity in forum World of Warcraft Bots and Programs
    Replies: 6
    Last Post: 07-09-2014, 02:12 PM
  2. item Teleport [completed and functional]
    By venom9122 in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 12-13-2007, 11:46 PM
  3. [Release]Blizzlike Database - Fully Functioning
    By ~SaiLyn~ in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 11-12-2007, 09:52 PM
  4. Function locating.
    By HolyForce in forum World of Warcraft General
    Replies: 0
    Last Post: 03-03-2007, 07:19 AM
All times are GMT -5. The time now is 12:10 AM. 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