struct MCommand2ParameterFloat : public MCommand2Parameter { float m_Value; MCommand2ParameterFloat(float value) { //MCommand2ParameterFloatConstructor (this, value); ((void (__thiscall*)(LPVOID, float))MCommand2ParameterFloat__MCommand2ParameterFloatAddress) (this, value); } }; struct MCommand2ParameterUInt : public MCommand2Parameter { uint32_t m_Value; MCommand2ParameterUInt(uint32_t value) { //MCommand2ParameterUIntConstructor (this, value); ((void (__thiscall*)(LPVOID, uint32_t))MCommand2ParameterUInt__MCommand2ParameterUIntAddress) (this, value); } }; struct MCommand2ParameterString : public MCommand2Parameter { char* m_Value; MCommand2ParameterString(char* value) { //MCommand2ParameterStringConstructor (this, value); ((void (__thiscall*)(LPVOID, char*))MCommand2ParameterString__MCommand2ParameterStringAddress) (this, value); } }; struct MCommand2ParameterMUID : public MCommand2Parameter { MUID m_Value; MCommand2ParameterMUID(MUID* value) { //MCommand2ParameterMUIDConstructor (this, value); ((void (__thiscall*)(LPVOID, MUID*))MCommand2ParameterMUID__MCommand2ParameterMUIDAddress) (this, value); } }; struct MCommand2ParameterBlob : public MCommand2Parameter { char* m_Value; int m_nSize; static void MakeBlobHeader(char* data, int elementCount, int elementSize) { int total = (elementCount * elementSize) + 8; data = new char[total+4]; memcpy(data, &total, 4); memcpy(data+4, &elementSize, 4); memcpy(data+8, &elementCount, 4); } static char* MMakeBlobArray(int nOneBlobSize, int nBlobCount) { char *result; result = new char[(nBlobCount * nOneBlobSize + 8)]; *((DWORD *)result + 1) = nBlobCount; *(DWORD *)result = nOneBlobSize; return result; } static char *MGetBlobArrayElement(char *pBlob, uint32_t i) { char *result; if (i < 0 || i >= *((DWORD *)pBlob + 1)) result = 0; else result = pBlob + (i * *(DWORD *)pBlob + 8); return result; } MCommand2ParameterBlob(LPVOID value, int size) { //MCommand2ParameterBlobConstructor (this, value, size); ((void (__thiscall*)(LPVOID, LPVOID, int))MCommand2ParameterBlob__MCommand2ParameterBlobAddress) (this, value, size); } }; struct MCommand2Desc; typedef MCommand2Desc* (__thiscall* MCommand2DescTypedef)(MCommand2Desc*, uint32_t, const char*, const char*, int); MCommand2DescTypedef MCommand2DescConstructor = reinterpret_cast(MCommand2Desc__MCommand2DescAddress); struct MCommand2Manager { void AddCommandDesc(MCommand2Desc* command) { ((void (__thiscall*)(LPVOID, MCommand2Desc*))MCommand2Manager__AddCommandDescAddress) (this, command); } }; struct MCommand2Desc { LPVOID m_pPolymoprhism; uint32_t m_nCommandId; char m_szName[256]; char m_szDescription[256]; uint32_t m_nFlag; std::vector m_pParameterDescs; MCommand2Desc(int commandId, const char* name, const char* description, int flag) { //MCommand2DescConstructor (this, commandId, name, description, flag); //Broken it seems ((void (__thiscall*)(LPVOID, int, const char*, const char*, int))MCommand2Desc__MCommand2DescAddress) (this, commandId, name, description, flag); } void AddParamDesc(MCommand2ParameterDesc* param) { ((void (__thiscall*)(LPVOID, MCommand2ParameterDesc*))MCommand2Desc__AddParameterDescAddress) (this, param); } }; struct MCommand2 { LPVOID CMemPool; MCommand2* m_pNextCommand; MUID m_uidSender; MUID m_uidReceiver; MCommand2Desc* m_pCommandDesc; std::vector m_pCommandParams; BYTE m_nSerialNumber; bool AddParameter(MCommand2Parameter* param) { return ((bool (__thiscall *)(LPVOID,MCommand2Parameter*))MCommand2__AddParameterAddress) (this, param); } bool GetParameter(void *pValue, int i, int type, int bufferSize) { return ((bool (__thiscall *)(LPVOID,LPVOID,int,int,int))MCommand2__GetParameterAddress) (this, pValue, i, type, bufferSize); } MCommand2Parameter* GetParameter(uint32_t i) { return ((MCommand2Parameter* (__thiscall*)(LPVOID, uint32_t))MCommand2__GetParameter2Address)(this, i); } static MCommand2* Create(uint32_t packetId) { return ((MCommand2* (__cdecl*)(uint32_t))0x004C3B60)(packetId); } static void Post(MCommand2* packet) { _asm { mov eax, 0x004ABCC0 call eax push packet mov edx, [eax] mov ecx,eax call [edx+0x30] } } }; enum MCommand2ParameterType { MPT_INT, MPT_UINT, MPT_FLOAT, MPT_BOOL, MPT_STRING, MPT_VECTOR, MPT_POS, MPT_DIR, MPT_COLOR, MPT_UID, MPT_BLOB, MPT_CHAR, MPT_UCHAR, MPT_SHORT, MPT_USHORT, MPT_INT64, MPT_UINT64, MPT_SVECTOR }; struct ZItem { struct class1{}; char unknown0[16]; unsigned long IsEquipped; //0010 char unknown1[12]; class1* Unknown2; //0020 char unknown3[8]; unsigned long AmmoRight; //002C unsigned long AmmoLeft; //0030 }; struct ZCharacter2 { public: struct class1 { char unknown0[12]; DWORD Base; //000C char unknown1[16]; __int32 Offset; //0020 }; DWORD ZCharacter2Marker; char unknown0[36]; MUID U; //0028 char unknown1[40]; D3DXVECTOR3 Direction; //90 class1* PositionFind; //0058 D3DXVECTOR3 Facing; //005C DWORD ZCharacter2ItemMarker; //006C char unknown2[4]; ZItem Head; //0070 ZItem Chest; //00A4 ZItem Hand; //00D8 ZItem Leg; //010C ZItem Foot; //0140 ZItem Ring1; //0174 ZItem Ring2; //01A8 ZItem Melee; //01DC ZItem Gun1; //0210 ZItem Gun2; //0244 ZItem