Unable to write to a multilevel-pointer menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    Amrok's Avatar Banned
    Reputation
    4
    Join Date
    Apr 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to write to a multilevel-pointer

    Hi,

    i'm using this function:

    Code:
    // ReadMultilevelPointer
    int CMemory::ReadMultilevelPointer(unsigned int Module, unsigned int Pointer1, unsigned int Pointer2, unsigned int Pointer3, unsigned int Pointer4)
    {
    	UINT_PTR uiptrFinal = DeRef( DeRef( DeRef( Module + Pointer1 ) + Pointer2 ) + Pointer3) + Pointer4;
    
    	int Value;
    	::ReadProcessMemory(PROC_HANDLE, reinterpret_cast<LPVOID>(uiptrFinal), &Value, sizeof(int), NULL);
    	return Value;
    }
    Code:
    // ReadMultilevelPointer DeRef Function
    UINT_PTR CMemory::DeRef( UINT_PTR _uiptrPointer ) {
        UINT_PTR uiptrRet;
        if ( !::ReadProcessMemory( PROC_HANDLE, reinterpret_cast<LPVOID>(_uiptrPointer), &uiptrRet, sizeof( uiptrRet ), NULL ) ) { return 0UL; }
        return uiptrRet;
    }
    To Read values from a multilevel pointer.

    Now i'd like to change the value i've read, so i made a new function to write this:
    Code:
    // WriteMultilevelPointer
    bool CMemory::WriteMultilevelPointer(unsigned int Module, unsigned int Pointer1, unsigned int Pointer2, unsigned int Pointer3, unsigned int Pointer4, LPCVOID Value)
    {
    	UINT_PTR uiptrFinal = DeRef( DeRef( DeRef( Module + Pointer1 ) + Pointer2 ) + Pointer3) + Pointer4;
    	if(::WriteProcessMemory(PROC_HANDLE, reinterpret_cast<LPVOID>(uiptrFinal), Value, sizeof(Value), NULL))
    		return true;
    	else
    		return false;
    }
    so Here is my Problem:
    the variable "Value" must be a LPCVOID.. but how do i convert my int to LPCVOID?
    like:
    Code:
    Value = ReadMultilevelPointer(.........)+50
    any idea how to convert from int to LPCVOID?

    Unable to write to a multilevel-pointer
  2. #2
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LPCVOID roughly translates to 'long pointer to constant void'.
    Just get a pointer to your int variable and cast it to void.

    Code:
    int val;
    LPCVOID ptr = static_cast<LPCVOID>(&val);
    Two more things:
    1. Write template code for this function, it requires only minimal changes and you're able to write types other than int correctly.
    2. Check return values. Your code might "remote dereference" invalid memory addresses and you don't even check if ReadProcessMemory suceeds.
    Last edited by flo8464; 07-17-2011 at 12:16 PM.
    Hey, it compiles! Ship it!

  3. #3
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Amrok View Post
    the variable "Value" must be a LPCVOID.. but how do i convert my int to LPCVOID?
    To answer your question: (which is the wrong question to ask btw)
    Code:
    (LPCVOID)Value
    I'm not saying this to be rude, but to help both yourself and the rest of us here on this forum.. Maybe before you attempt to hack wow you should actually learn the language and the windows API. It would save you a lot of time and trouble in the long run.

  4. #4
    tymezz's Avatar Member
    Reputation
    9
    Join Date
    Nov 2007
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suggest you check out HadesMem by Cypher, it seems like it could save you a lot of trouble. hadesmem - Windows memory hacking library - Google Project Hosting

Similar Threads

  1. Quotes from Steven Write
    By Amedis in forum Community Chat
    Replies: 2
    Last Post: 11-14-2022, 10:26 AM
  2. Multilevel Pointer - getting to base address
    By siriuz in forum WoW Memory Editing
    Replies: 12
    Last Post: 02-07-2013, 06:35 PM
  3. Writing To a Pointer
    By DarkLinux in forum Programming
    Replies: 4
    Last Post: 06-07-2011, 08:51 PM
  4. Replies: 1
    Last Post: 07-23-2009, 01:17 PM
  5. Writing Guides: for Dummies
    By Krazzee in forum World of Warcraft Guides
    Replies: 3
    Last Post: 06-11-2006, 01:05 PM
All times are GMT -5. The time now is 03:36 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