MemoryReading with c++ menu

Shout-Out

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use a template so you can have one function to write to any data-type

    MemoryReading with c++
  2. #17
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kynox View Post
    You should use a template so you can have one function to write to any data-type

    Templates are ftw.

    Then again, why would we listen to you, you're a "noob", remember?

  3. #18
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True.. but then again.. who takes offense to leachers these days?

  4. #19
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So i went ahead and whipped this up in 10 minutes, should work to however you want it to.

    Code:
    class CMemoryReader
    {
    public:
        
        template <class T>
        bool Read( DWORD dwOffset, T& TSave )
        {
            if ( !Un****( dwOffset, sizeof( T ) ) )
                return false;
    
            TSave = *(T*)dwOffset;
    
            Re****( dwOffset, sizeof( T ) );
    
            return true;
        }
        
        template <class T>
        bool Write( DWORD dwOffset, T TData )
        {
            if ( !Un****( dwOffset, sizeof( T ) ) )
                return false;
    
            *(T*)dwOffset = TData;
    
            Re****( dwOffset, sizeof( T ) );
    
            return true;
        }
    
        //-----------------------------------------------------------
    
        bool Un****( DWORD dwOffset, DWORD dwSize )
        {
            return VirtualProtect( (LPVOID)dwOffset, dwSize, PAGE_EXECUTE_READWRITE, &m_dwOld );
        }
    
        bool Re****( DWORD dwOffset, DWORD dwSize )
        {
            return VirtualProtect( (LPVOID)dwOffset, dwSize, m_dwOld, &m_dwOld );
        }
    private:
        DWORD m_dwOld;
    };
    
        CMemoryReader MemoryReader;
    
        DWORD dwDwordValue  = NULL;
        BYTE  byteByteValue = 0;
        MemoryReader.Read<DWORD>( 0x00411474, dwDwordValue );  // Reads a dword from the offset
        MemoryReader.Read<BYTE>(  0x00411474, byteByteValue );   // Reads a byte from the offset
        printf( "Value: %Xrn", dwDwordValue );
        printf( "Value: %X", byteByteValue );
    Should probably note that this is for inprocess stuff, so just change *(T*)xxx to ReadProcessMemory, etc.
    Last edited by kynox; 05-09-2008 at 01:39 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 7
    Last Post: 02-13-2012, 06:56 AM
  2. ZF Witch Doctor Hunting for Hunter (with video)
    By Matt in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 06-21-2006, 07:39 PM
  3. Farm AQ with a Hunter
    By Matt in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 04-04-2006, 01:31 PM
  4. World of Warcraft Bot (GetALifeBot) 0.57 working with 1.9.4
    By Matt in forum World of Warcraft Bots and Programs
    Replies: 7
    Last Post: 03-07-2006, 09:43 PM
  5. Getting into BG with that pesky deserters buff!
    By janzi9 in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 03-06-2006, 11:35 PM
All times are GMT -5. The time now is 09:50 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