[HELP] Only some of the objMgr work. menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] Only some of the objMgr work.

    Hey guys I was working with the new object manager that Cypher posted, modified for my needs, but I can only get some of the fields to work.

    Here is an example.

    Code:
    [11:55:29 AM]=>Name: Fuggo Type: 272933536
    X: -431.001221, Y: -4285.897949, Z: 42.178799
    Target GUID: 0x231FF6C04940000 <-- Stays the same no matter who I target.
    I get the correct Name and POS, but Type and target guid, which is GetKnownField(0x12), dont return correctly. I think I have an alignment issue but I cant seem to figure it out.

    Here is the rest of the code.

    Code:
    // Base object class. Abstract class, designed to be inherited from only
    // Actual type available in 'type' member
    class CGObject_C
    {
    public:
        // Virtual functions defined as pure virtual because I'm lazy
        virtual void Function0() = 0;
        virtual void Function1() = 0;
        virtual void Function2() = 0;
        virtual void Function3() = 0;
        virtual void Function4() = 0;
        virtual void Function5() = 0;
        virtual void Function6() = 0;
        // Returns a pointer to the object's bag
        virtual void Function7() = 0;//virtual CGContainer_C * GetBagPtr() = 0;        //  Function7 
        // Gets the coordinates of an object. Returned via reference
        virtual void GetPosition(WOWPOS & MyPos) = 0;    // Function8
        // Gets the facing of an object
        // TODO: Test this
        virtual float GetFacing() = 0;                    // Function9
        // Gets the scale of an object
        virtual float GetScale() = 0;                    // Function10
        virtual void Function11() = 0;
        virtual void Function12() = 0;
        virtual void Function13() = 0;
        virtual void Function14() = 0;
        virtual void Function15() = 0;
        // Gets the name and path of the model the object is displayed as.
        virtual const char * GetModel() = 0;            // Function16
        virtual void Function17() = 0;
        virtual void Function18() = 0;
        virtual void Function19() = 0;
        virtual void Function20() = 0;
        virtual void Function21() = 0;
        virtual void Function22() = 0;
        virtual void Function23() = 0;
        // Gets the facing of an object
        // TODO: Test this
        virtual float GetFacingAngle() = 0;                // Function24
        virtual void Function25() = 0;
        virtual void Function26() = 0;
        virtual void Function27() = 0;
        virtual void Function28() = 0;
        virtual void Function29() = 0;
        virtual void Function30() = 0;
        virtual void Function31() = 0;
        virtual void Function32() = 0;
        virtual void Function33() = 0;
        // Used when the local player 'interacts' (right clicks) on an object
        virtual void Interact() = 0;                    // Function34
        virtual void Function35() = 0;
        virtual void Function36() = 0;
        virtual void Function37() = 0;
        virtual void Function38() = 0;
        virtual void Function39() = 0;
        virtual void Function40() = 0;
        virtual void Function41() = 0;
        virtual void FunctionF2() = 0;
        virtual void Function43() = 0;
        virtual void Function44() = 0;
        virtual void Function45() = 0;
        virtual void Function46() = 0;
        // Gets the name of an object
        virtual const char * GetObjectName() = 0;        // Function47
        virtual void Function48() = 0;
        virtual void Function49() = 0;
        virtual void Function50() = 0;
        virtual void Function51() = 0;
        virtual void Function52() = 0;
        virtual void Function53() = 0;
        virtual void Function54() = 0; 
        virtual void Function55() = 0;
        virtual void Function56() = 0;
        virtual void Function57() = 0; 
        virtual void Function58() = 0;
        virtual void Function59() = 0;
        virtual void Function60() = 0;
        virtual void Function61() = 0;
    
    	// Pointer to the 'storage' array. Accessed using the descriptors
        // dumped from the client
        unsigned int    GetStoragePtr()        { return m_pStorage1; }
        // Type of the object. 0(Unit, Player, GameObject, etc)
        // Use enum eObjType
        unsigned int    GetObjectType()        { return m_Type; }
    
    protected:
        // NOTE: Not all these members belong to CGObject_C
        // I am not sure where the 'cutoff' is for each inherited class
        
        // Pointer to the 'storage' array. Accessed using the descriptors
        // dumped from the client
        unsigned int m_pStorage1;            // 0x0008 - 0x000C
        // Another pointer to the 'storage' array
        unsigned int m_pStorage2;            // 0x000C - 0x0010
        unsigned int m_Unknown10;            // 0x0010 - 0x0014
        // Type of the object. 0(Unit, Player, GameObject, etc)
        unsigned int m_Type;                // 0x0014 - 0x0018
        char m_Unknown018[0x18];                // 0x0018 - 0x0030
    
    public:
    	unsigned long GetKnownField( unsigned long dwField )
    	{
    		return *(unsigned long *)(m_pStorage1 + dwField);
    	}
    
    };
    Here is how I point it to the objManager, it a dll that gets injected.

    Code:
    CGObject_C * pObject = (CGObject_C*)(PlayerObj);
    Here is my output code.

    Code:
    WOWPOS wPos;
    pObject->GetPosition(wPos);
    
    addlog("Name: %s Type: %d\nX: %f, Y: %f, Z: %f\nTarget GUID: 0x%I64X\n\n",pObject->GetObjectName(),pObject->GetObjectType(),wPos.X,wPos.Y,wPos.Z,pObject->GetKnownField(0x12));
    Any help would be awesome.
    Last edited by cenron; 11-28-2008 at 04:06 PM.

    [HELP] Only some of the objMgr work.
  2. #2
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I am retarded. It was an alignment issue, thats what I get for programming high.

    Anyway here is the updated CObject_C

    Code:
    class CGObject_C
    {
    private:
        virtual void Function0() = 0;
        virtual void Function1() = 0;
        virtual void Function2() = 0;
        virtual void Function3() = 0;
        virtual void Function4() = 0;
        virtual void Function5() = 0;
        virtual void Function6() = 0;
    public:
        virtual CContainer_C * GetBagPtr() = 0;     
        virtual void GetPosition(WOWPOS & MyPos) = 0;   
        virtual float GetFacing() = 0;                    
        virtual float GetScale() = 0;     
    private:
        virtual void Function11() = 0;
        virtual void Function12() = 0;
        virtual void Function13() = 0;
        virtual void Function14() = 0;
        virtual void Function15() = 0;
    public:
        virtual const char * GetModel() = 0;
    private:
        virtual void Function17() = 0;
        virtual void Function18() = 0;
        virtual void Function19() = 0;
        virtual void Function20() = 0;
        virtual void Function21() = 0;
        virtual void Function22() = 0;
        virtual void Function23() = 0;
    public:
        virtual float GetFacingAngle() = 0;
    private:
        virtual void Function25() = 0;
        virtual void Function26() = 0;
        virtual void Function27() = 0;
        virtual void Function28() = 0;
        virtual void Function29() = 0;
        virtual void Function30() = 0;
        virtual void Function31() = 0;
        virtual void Function32() = 0;
        virtual void Function33() = 0;
    public:
        virtual void Interact() = 0;  
    private:
        virtual void Function35() = 0;
        virtual void Function36() = 0;
        virtual void Function37() = 0;
        virtual void Function38() = 0;
        virtual void Function39() = 0;
        virtual void Function40() = 0;
        virtual void Function41() = 0;
        virtual void FunctionF2() = 0;
        virtual void Function43() = 0;
        virtual void Function44() = 0;
        virtual void Function45() = 0;
        virtual void Function46() = 0;
    public:
        virtual const char * GetObjectName() = 0;
    private:
        virtual void Function48() = 0;
        virtual void Function49() = 0;
        virtual void Function50() = 0;
        virtual void Function51() = 0;
        virtual void Function52() = 0;
        virtual void Function53() = 0;
        virtual void Function54() = 0; 
        virtual void Function55() = 0;
        virtual void Function56() = 0;
        virtual void Function57() = 0; 
        virtual void Function58() = 0;
        virtual void Function59() = 0;
        virtual void Function60() = 0;
        virtual void Function61() = 0;
    
    public:
    
        unsigned int    GetStoragePtr()        { return m_pStorage1; }
        unsigned int    GetObjectType()        { return m_Type; }
        WGUID           GetGuid()			   { return m_Guid; }
        unsigned int    GetStoragePtr120()     { return m_pStorage3; }
        unsigned int	GetMovementInfo()      { return 0; }
        unsigned int    GetUnitInfo()          { return 0; }
        unsigned int    GetModelInfo()         { return 0; }
    
    protected:
        unsigned int m_pStorage1;             // 0x0008 - 0x000C
        unsigned int m_pStorage2;             // 0x000C - 0x0010
        unsigned int m_Unknown10;             // 0x0010 - 0x0014
        unsigned int m_Type;                  // 0x0014 - 0x0018
        char m_Unknown018[0x18];              // 0x0018 - 0x0030
        WGUID m_Guid;                         // 0x0030 - 0x0038
        char m_Unknown038[0xD0];              // 0x0038 - 0x0108
        unsigned int m_pStorage3;             // 0x0108 - 0x010C
        char m_Unknown124[0x04];              // 0x010C - 0x0110
    
    public:
    	unsigned long GetKnownField( unsigned long dwField )
    	{
    		BYTE *pStorage = (BYTE*)m_pStorage1;
    		return pStorage[(dwField * 4)];
    	}
    
    };

  3. #3
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your GetKnownField function is wrong, just return pStrage[dwField] ^^
    I hacked 127.0.0.1

  4. #4
    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)
    He copy-pasted 99% of the code, dunno why he wouldn't just copypaste this too:

    // Gets a field in the storage array
    template<typename T>
    T CGObject_C::GetKnownField(unsigned int Field)
    {
    try
    {
    // Get a pointer to the array of the type supplied
    T* pMyStorage = (T*)(m_pStorage1);
    // Return the value requested
    return pMyStorage[Field];
    }
    // Catch any memory access violations
    catch (...)
    {
    // Output debug info to log file
    gpRedPillMgr->GetLog()->Add(str(boost::format("Failed to get field %i") %Field));
    }
    // Something went wrong. Return null.
    return (T)0;
    }

  5. #5
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Xarg0 View Post
    Your GetKnownField function is wrong, just return pStrage[dwField] ^^
    Are you sure? Cause that works for me. It gives me back the correct value.


    Originally Posted by Cypher View Post
    He copy-pasted 99% of the code, dunno why he wouldn't just copypaste this too:

    // Gets a field in the storage array
    template<typename T>
    T CGObject_C::GetKnownField(unsigned int Field)
    {
    try
    {
    // Get a pointer to the array of the type supplied
    T* pMyStorage = (T*)(m_pStorage1);
    // Return the value requested
    return pMyStorage[Field];
    }
    // Catch any memory access violations
    catch (...)
    {
    // Output debug info to log file
    gpRedPillMgr->GetLog()->Add(str(boost::format("Failed to get field %i") %Field));
    }
    // Something went wrong. Return null.
    return (T)0;
    }
    Its actually 98% copy & paste. The copy & paste the reason I didn't use your get known fields, that and I am not to familiar with templates. I am trying to get away from others people code but I needed a base to start with so I could understand the fundamentals.

  6. #6
    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)
    If you don't understand templates you probably need to read a few more books on C++.

  7. #7
    cenron's Avatar Member
    Reputation
    12
    Join Date
    Mar 2008
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    If you don't understand templates you probably need to read a few more books on C++.
    I agree 100%. There is just so much to learn but that is def on my todo list.

    One question for you though if you could help me out. I cant get interact to work

    here is the code that calls it for me.


    Code:
    CGObject_C *m_pTargetObj = GetObjectByGUID(m_pPlayerObj->GetKnownGUIDField(UNIT_FIELD_TARGET));
    
    if(m_pTargetObj)
    {
        m_pTargetObj->Interact();
    }
    I am using your VMT table and all the actions below and above it work.

  8. #8
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having the exact same issue. I'll probably screw around tonight and figure it out on accident though. Lol.

Similar Threads

  1. Need some help getting some textures from the game
    By Iaccidentallytwink in forum Hearthstone: Heroes of Warcraft
    Replies: 3
    Last Post: 10-16-2014, 03:23 AM
  2. [help] only one account works
    By Synris in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 05-04-2008, 09:44 PM
  3. [Model Edit] Help! Some of the modelchanges dont work!
    By Blubben in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 01-28-2008, 09:21 PM
  4. Only some people see the realm as Online
    By Ukrainia in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 01-26-2008, 07:14 PM
  5. Need help finding some textures...
    By sooos in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 12-24-2006, 02:25 PM
All times are GMT -5. The time now is 07:08 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