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.