Packet capture/decrypt lib menu

User Tag List

Results 1 to 8 of 8
  1. #1
    SinnerG's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Packet capture/decrypt lib

    For the original thread, see http://www.mmowned.com/forums/wow-me...crypt-lib.html (Cannot reply there but my reply is 'related' to that code :P)

    If anyone has it, could they please be so kind to share their UpdateMask 'class' (doesn't matter what language, buuut I prefer c# )

    I think mine should be ok, except it does fail at some point :/


    My class:

    Code:
        public class UpdateMask
        {
            uint mCount;
            uint mBlocks;
            uint[] mUpdateMask;
    
            public UpdateMask()
            {
                //mUpdateMask = new uint[cnt];
            }
    
            public void SetCount(uint valuesCount)
            {
                mCount = valuesCount;
                mBlocks = (valuesCount + 31) / 32; // 31) / 32
                //mUpdateMask = new uint[mBlocks];
    
                mCount = valuesCount;
                //mBlocks = valuesCount/32 + 1;
                //mBlocks = (valuesCount + 31) / 32;
                mBlocks = mCount >> 5;
                if ((mCount & 31) == 31)
                    ++mBlocks;
    
                mUpdateMask = new uint[mBlocks];
            }
    
            public byte[] Mask
            {
                get
                {
                    var res = new List<byte>();
    
                    for (int i = 0; i < mUpdateMask.Length; i++)
                    {
                        res.AddRange(BitConverter.GetBytes(mUpdateMask[i]));
                    }
    
                    return res.ToArray();
                }
            }
    
            public bool GetBit(uint index)
            {
                try
                {
                    if ((index >> 3) >= mCount)
                        return false;
    
                    return (Mask[index >> 3] & (1 << (int) (index & 0x7))) != 0;
                }catch(Exception ex)
                {
                   // ex = ex;
                    //throw;
                    return false;
                }
            }
    
            public void Read(BinaryReaderExt data, uint masksize)
            {
                int bla = 0;
                mUpdateMask = new uint[mCount];
                try
                {
                    var cnt = masksize/4;
                    for (int i = 0; i < cnt; i++)
                    {
                        bla = i;
                        mUpdateMask[i] = data;
                    }
                }catch (Exception ex)
                {
                    ex = ex;
                    throw;
                }
            }
    
            public void SetMask(uint[] mask)
            {
                mUpdateMask = mask;
            }
    
            public void Clear()
            {
                mUpdateMask = new uint[mBlocks];
            }
    
        }
    FYI: BinaryReaderExt data => when used like var = data; it will retrieve sizeof(var) bytes, just so you know

    I use it like this:

    Code:
            public void UpdateValues(BinaryReaderExt data)
            {
                byte blockcount, tyid;
                uint value, masksize, valuesCount;
                float fvalue;
    
                valuesCount = ValuesCount;
                
                blockcount = data;
                if (blockcount == 0)
                    return;
                masksize = (uint) (blockcount << 2);
    
                var umask = new UpdateMask();
                umask.SetCount(valuesCount);
                umask.Read(data, masksize);
    
                for (uint i = 0; i < masksize / 8; i++)
                {
                    if (umask.GetBit(i))
                    {
                        try
                        {
                            if (IsFloatField((byte) Type, i))
                            {
                                fvalue = data;
                                SetFloatValue((int) i, fvalue);
                            }
                            else
                            {
                                value = data;
                                SetUInt32Value((int) i, value);
                            }
                        }
                        catch (Exception ex)
                        {
                            ex = ex;
                            throw;
                        }
                    }
                }
            }
    Any help would be useful!

    Packet capture/decrypt lib
  2. #2
    Cromon's Avatar Legendary


    Reputation
    840
    Join Date
    Mar 2008
    Posts
    714
    Thanks G/R
    0/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats the class ive used for my draft of an emulator.
    Code:
    class DLL_EXPORT UpdateMask
    {
    	ui32* m_UpdateMask;
    	ui32 m_Count; // in values
    	ui32 m_Blocks; // in ui32 blocks
    
    public:
    	UpdateMask() : m_UpdateMask(0), m_Count(0), m_Blocks(0) { }
    	UpdateMask(const UpdateMask& mask) : m_UpdateMask(0) { *this = mask; }
    
    	~UpdateMask()
    	{
    		if(m_UpdateMask)
    			delete [] m_UpdateMask;
    	}
    
    	void SetBit(const ui32 index)
    	{
    		if(index >= m_Count)
    			return;
    		((ui8*)m_UpdateMask)[index >> 3] |= 1 << (index & 0x7);
    	}
    
    	void UnsetBit(const ui32 index)
    	{
    		if(index >= m_Count)
    			return;
    		((ui8*)m_UpdateMask)[index >> 3] &= (0xff ^ (1 <<  (index & 0x7)));
    	}
    
    	bool GetBit(const ui32 index) const
    	{
    		if(index >= m_Count)
    			return false;
    		return (((ui8*)m_UpdateMask)[index >> 3] & (1 << (index & 0x7))) != 0;
    	}
    
    	ui32 GetUpdateBlockCount() const 
    	{
    		ui32 x;
    		for(x = m_Blocks - 1; x; x--)
    			if(m_UpdateMask[x])
    				break;
    
    		return (x + 1); 
    	}
    	inline ui32 GetBlockCount() const { return m_Blocks; }
    	
    	inline ui32 GetLength() const { return (m_Blocks * sizeof(ui32)); }
    	inline ui32 GetCount() const { return m_Count; }
    	inline const ui8* GetMask() const { return (ui8*)m_UpdateMask; }
    
    	void SetCount(ui32 valuesCount)
    	{
    		if(m_UpdateMask)
    			delete [] m_UpdateMask;
    
    		m_Count = valuesCount;
    		m_Blocks = m_Count >> 5;
    		if(m_Count & 31)
    			++mBlocks;
    
    		m_UpdateMask = new ui32[m_Blocks];
    		memset(m_UpdateMask, 0, m_Blocks * sizeof(ui32));
    	}
    
    	void Clear()
    	{
    		if (m_UpdateMask)
    			memset(m_UpdateMask, 0, m_Blocks << 2);
    	}
    
    	UpdateMask& operator = (const UpdateMask& mask)
    	{
    		SetCount(mask.m_Count);
    		memcpy(m_UpdateMask, mask.m_UpdateMask, m_Blocks << 2);
    
    		return *this;
    	}
    
    	void operator &= (const UpdateMask& mask)
    	{
    		if(mask.m_Count > m_Count)
    			return;
    		for(ui32 i = 0; i < m_Blocks; i++)
    			m_UpdateMask[i] &= mask.m_UpdateMask[i];
    	}
    
    	void operator |= ( const UpdateMask& mask )
    	{
    		if(mask.m_Count > m_Count)
    			return;
    		for(ui32 i = 0; i < mBlocks; i++)
    			m_UpdateMask[i] |= mask.m_UpdateMask[i];
    	}
    
    	UpdateMask operator & (const UpdateMask& mask) const
    	{
    		UpdateMask newmask;
    		if(mask.m_Count > m_Count)
    			return newmask;
    
    		newmask = *this;
    		newmask &= mask;
    
    		return newmask;
    	}
    
    	UpdateMask operator | (const UpdateMask& mask) const
    	{
    		UpdateMask newmask;
    		if(mask.m_Count > m_Count)
    			return newmask;
    
    		newmask = *this;
    		newmask |= mask;
    
    		return newmask;
    	}
    };

  3. #3
    SinnerG's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that was mostly what I had :/

    But, I'm not sure if the usage is correctly:

    For example, this part:

    1) Do I use SetCount correctly?
    2) Do I read the correct amount of bytes? (masksize)
    3) Is the for loop looping on the correct value?

    Code:
                masksize = (uint) (blockcount << 2);
    
                var umask = new UpdateMask();
                umask.SetCount(masksize / 4);
                umask.Read(data, masksize);
    
                for (uint i = 0; i < blockcount/8; i++)
                {
    edit: Loop is wrong for sure.. But what then :s

    edit 2 : getting there, still an error when I get a UPDATEFLAG_SELF package, but that should be movement processing related! Working on this now :P (all seperate update value packs were processed correctly now )
    Last edited by SinnerG; 03-15-2010 at 04:10 AM.

  4. #4
    SinnerG's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone know what special happens with UPDATEFLAGS_SELF ?

    I did some ugly testing and I found that I 'missed' 85 bytes (kept looping adding 1 more byte read until it read all data correctly)

    Anyone know ?

    edit: may be UPDATEFLAGS_HAS_MOVEMENT (in combo with 'any' player (no other players nearby to test atm though :/))

    edit 2 : meh, now it has read 39 bytes 2 much pffff...

    Ok next step, looks like UPDATETYPE_OUT_OF_RANGE_OBJECTS is wrong at times:

    Code:
                                    uint blax = data;
                                  //  blax = data;
                                    
                                    for (ushort ix = 0; ix < blax; ix++)
                                    {
                                        uguid = data.ReadPackGUID();
                                    }
    Last edited by SinnerG; 03-15-2010 at 05:39 AM.

  5. #5

  6. #6
    SinnerG's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    78
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Omg, if this works, I'm so gonna (try) rep you ^^

    edit: It is still failing.. Hang on while I get some debug info

    Code:
    Created object TYPEID_PLAYER HIGH GUID: 1280
    After this, things get 'out of sync' (same issue I had with my own code)

    edit 2: I ported your 'updatemask' as well to make sure that this wasnt causing the problems - it wasnt

    edit 3 : some more info

    Code:
    UPDATEFLAG_LIVING, UPDATEFLAG_HAS_POSITION
    NONE
    MOVEFLAG2_NONE
    speed 1: 2,5
    speed 2: 7
    speed 3: 4,5
    Speed values are ok, so we can be sure that we're OK atleast until the point where we get those (I used the speeds to debug my own code)

    I think that either some exception needs to build in for players OR we need to something for UPDATEFLAG_HAS_POSITION (since UPDATEFLAG_HAS_POSITION is only used @ not living objects atm - so I wonder, WHY send it in the first place?)
    Last edited by SinnerG; 03-15-2010 at 07:10 AM.

  7. #7
    BoogieManTM's Avatar Active Member
    Reputation
    52
    Join Date
    May 2008
    Posts
    193
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here's my clientless code:

    updatemask.cs:
    Code:
    public UpdateMask()
            {
                mCount = 0;
                mBlocks = 0;
                mUpdateMask = new byte[0];
            }
    
    
            public void SetBit(UInt16 index)
            {
                mUpdateMask[ index >> 3 ] |= (byte)(1 << ( index & 0x7 ));
            }
    
            public void UnsetBit(UInt16 index)
            {
                mUpdateMask[ index >> 3 ] &= (byte)(0xff ^ (1 <<  ( index & 0x7 ) ) );
            }
    
            public bool GetBit(UInt16 index)
            {
                return ( mUpdateMask[ index >> 3 ] & ( 1 << ( index & 0x7 ) )) != 0;
            }
    
            public UInt16 GetBlockCount() { return mBlocks; }
            public UInt16 GetLength() { return (UInt16)(mBlocks << 2); }
            public UInt16 GetCount() { return mCount; }
            public byte[] GetMask() { return mUpdateMask; }
    
            public void SetCount(UInt16 valuesCount)
            {
    
                mCount = valuesCount;
                mBlocks = (UInt16)((valuesCount >> 5) + 1);
    
                mUpdateMask = new byte[mBlocks*4];
            }
    
            public void SetMask(byte[] data, UInt16 length)
            {
    
                mCount = (UInt16)(length << 5);
                mBlocks = (UInt16)(length >> 2);
    
                mUpdateMask = new byte[mBlocks*4];
                mUpdateMask = data;
            }
    
            public void Clear()
            {
                mUpdateMask = new byte[mBlocks*4];
            }
    
            private UInt16 mCount; // in values
            private UInt16 mBlocks; // in UInt32 blocks
            private byte[] mUpdateMask;
        };
    and the Create block (well, most of it)

    Code:
                        case IcarusBot.Core.UpdateType.Create: // ObjCreate
                        case IcarusBot.Core.UpdateType.CreateSelf: // ObjCreate
                            {
                                guid = wr.ReadPackedGuid();
    
                                objTypeId = (IcarusBot.Core.ObjectTypeId)wr.ReadByte();
    
                                Log(LogType.NeworkComms, 10, "Got Object Create Mask: GUID: {0} ObjTypeID: {1} ", guid, objTypeId);
    
                                ushort flags = wr.ReadUInt16();
    
                                MovementBlock mb = new MovementBlock(this, ref wr, flags);
    
                                UpdateMask UpdateMask = new UpdateMask();
    
                                byte bc = wr.ReadByte(); // Block Count
    
    
                                UpdateMask.SetCount((ushort)(bc * 32));
                                UpdateMask.SetMask(wr.ReadBytes(bc * 4), bc);
    
                                UInt32[] Fields = new UInt32[UpdateMask.GetCount()];
    
                                for (ushort x = 0; x < UpdateMask.GetCount(); x++)
                                {
                                    if (UpdateMask.GetBit(x))
                                        Fields[x] = wr.ReadUInt();
                                }
                          }
        public class MovementBlock : IMovementBlock
        {
            BenderCore BenderCore { get; set; }
            public MovementFlags Flags { get; set; }
            public float RunSpeed { get; set; }
    
            UInt32 flags2{ get; set;}
    
    
            public float X { get { return posX; } }
            public float Y { get { return posY; } }
            public float Z { get { return posZ; } }
            public float Facing { get { return facing; } }
    
    
            public UInt32 unk3;
            public float posX = 0, posY = 0, posZ = 0, facing = 0;
            public float walkSpeed,  backWalkSpeed, swimSpeed, backSwimSpeed, turnRate = 0;
            public UInt16 unk_flags;
    
            public MovementBlock(BenderCore benderCore)
            {
                BenderCore = benderCore;
                flags2 = 0;
            }
            public MovementBlock(BenderCore benderCore,ref WoWReader wr, UInt16 flags) : this(benderCore)
            {
                if ((flags & 0x20) >= 1)
                {
    
                    flags2 = wr.ReadUInt();
    
                    unk_flags = wr.ReadUInt16(); // 3.0.8
    
                    unk3 = wr.ReadUInt(); // time
    
                    posX = wr.ReadSingle();
                    posY = wr.ReadSingle();
                    posZ = wr.ReadSingle();
                    facing = wr.ReadSingle();
    
                    
                    if ((flags2 & 0x02200000) >= 1 || (unk_flags & 0x20) >= 1)
                    {
                        wr.ReadFloat(); // swim/fly pitch
                    }
    
                    wr.ReadSingle(); // fall time
    
                    if ((flags2 & 0x00001000) >= 1)
                    {
    
                        wr.ReadFloat(); // unk 2.3.0
                        wr.ReadFloat();
                        wr.ReadFloat();
                        wr.ReadFloat();
                    }
    
                    if ((flags2 & 0x04000000) >= 1)
                    {
    
                        wr.ReadFloat();
                    }
    
                    walkSpeed = wr.ReadSingle();
                    RunSpeed = wr.ReadSingle();
                    backWalkSpeed = wr.ReadSingle();
                    swimSpeed = wr.ReadSingle();
                    backSwimSpeed = wr.ReadSingle();
                    wr.ReadSingle(); //unk1 // fly speed
                    wr.ReadSingle(); //unk2 // fly backwards speed
                    turnRate = wr.ReadSingle();
                    wr.ReadSingle(); // 3.0.8
    
    
    
                    if ((flags2 & 0x08000000) >= 1)
                    {
    
                        UInt32 splineFlags = wr.ReadUInt();
    
                        if ((splineFlags & 0x20000) >= 1)
                        {
                            wr.ReadSingle(); // Final facing?
                        }
                        else
                        {
    
                            if ((splineFlags & 0x10000) >= 1)
                            {
    
                                wr.ReadUInt64(); // final facing guid?
                            }
    
                            if ((splineFlags & 0x8000) >= 1)
                            {
    
                                posX = wr.ReadSingle();
                                posY = wr.ReadSingle();
                                posZ = wr.ReadSingle();
    
                            }
                        }
    
                        UInt32 time1, time2, splineCount, unk4;
    
                        //1.8
                        time1 = wr.ReadUInt();
                        time2 = wr.ReadUInt();
                        unk4 = wr.ReadUInt();
                        wr.ReadSingle(); // 3.1 unk1
                        wr.ReadSingle(); // 3.1 unk2
                        wr.ReadSingle(); // 3.1 unk3
                        wr.ReadUInt(); // 3.1 unk4
                        splineCount = wr.ReadUInt();
    
    
                        for (UInt32 j = 0; j < splineCount; ++j)
                        {
    
                            posX = wr.ReadSingle();
                            posY = wr.ReadSingle();
                            posZ = wr.ReadSingle();
    
                        }
    
                        wr.ReadByte();
                        
                        posX = wr.ReadSingle();
                        posY = wr.ReadSingle();
                        posZ = wr.ReadSingle();
    
                    }
                }
    
    
                else if ((flags & 0x100) >= 1)
                {
                    // transport apparently -
                    wr.ReadPackedGuid();
    
                    // object Pos
                    wr.ReadSingle();
                    wr.ReadSingle();
                    wr.ReadSingle();
    
                    // Transport pos
                    wr.ReadSingle();
                    wr.ReadSingle();
                    wr.ReadSingle();
    
                    // Orientations
                    wr.ReadSingle();
                    wr.ReadSingle();
                }
                else if ((flags & 0x40) >= 1)
                {
    
                    posX = wr.ReadSingle();
                    posY = wr.ReadSingle();
                    posZ = wr.ReadSingle();
                    facing = wr.ReadSingle();
    
                }
    
    
                if ((flags & 0x8) >= 1)
                {
    
                    wr.ReadUInt();
    
                }
    
                if ((flags & 0x10) >= 1)
                {
                    wr.ReadUInt();
                }
    
                if ((flags & 0x4) >= 1)
                {
    
                    wr.ReadPackedGuid();
    
                }
    
                if ((flags & 0x2) >= 1)
                {
    
                    wr.ReadUInt();
                }
    
                if ((flags & 0x80) >= 1)
                {
                    wr.ReadInt();
                    wr.ReadInt();
                }
    
                if ((flags & 0x200) >= 1)
                {
                    wr.ReadUInt64(); // packed rotation? (gameobject_rotation)
                }
            }
        }
    that sums up object update. it may be a bit out of date, and i butchered the code to make it more of a PoC so it probably won't compile out of the box. needs stuff like figuring out what to do with splines (properly storing them and calculating current position based on the timing) but it should help get on track.
    Last edited by BoogieManTM; 03-16-2010 at 09:04 AM.

  8. #8
    Nonal's Avatar Member
    Reputation
    3
    Join Date
    Sep 2008
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Some info from my side: these are the decoding functions I was using up to yersterday, it was working fine.
    Sorry this is C/C++, plugged to STL maps (objectMap object).

    You will always know when you read too many (or not enough) bytes. You can as well do sanity
    checks (on counts, types, etc...), I found it helpful.

    Main entry (after decompression):

    Code:
    bool updateobject(unsigned char** pos)
    {
    	unsigned long long guid;
    	unsigned int blockcount, nb;
    	int i, j;
    
    	GETINT32(blockcount,*pos);
    	logopcode("blockcount=%d ",blockcount);			
    	if (blockcount<0 || blockcount>1000) {
    		printf("Error: blockcount=%d !\n",blockcount);
    		return false;
    	}
    
    	for(i=0; i<blockcount; i++) {
    		unsigned char blocktype,objtype;
    		GETINT8(blocktype,*pos);
    
    		//hexdump(*pos,30);
    		logopcode("%d:[ blocktype %d, ",i,blocktype);
    
    		switch (blocktype) {
    			case UPDATETYPE_VALUES:
    				guid = get_pguid(pos);
    				logopcode("field update %016llX ",guid);
    				if (!updateblock_fields(guid,pos)) return false;
    				break;
    
    			case UPDATETYPE_MOVEMENT:
    				guid = get_pguid(pos);
    				logopcode("movement update %016llX ",guid);
    				if (!updateblock_position(guid,pos)) return false;
    				break;
    
    			case UPDATETYPE_CREATE_OBJECT:
    			case UPDATETYPE_CREATE_OBJECT2:
    				guid = get_pguid(pos);
    				GETINT8(objtype,*pos);
    				logopcode("create %016llX objtype=%d ",guid,objtype);
    				objectMap.create(guid,objtype);
    				if (!updateblock_position(guid,pos)) return false;
    				if (!updateblock_fields(guid,pos)) return false;
    				break;
    
    			case UPDATETYPE_OUT_OF_RANGE_OBJECTS:
    				GETINT32(nb,*pos);
    				logopcode("out_of_range: ");
    				for(j=0; j<nb; j++) {
    					guid = get_pguid(pos);
    					logopcode("%016llX ",guid);
    					objectMap.destroy(guid);
    				}
    				break;
    
    			case UPDATETYPE_NEAR_OBJECTS:
    				GETINT32(nb,*pos);
    				logopcode("near: ");
    				for(j=0; j<nb; j++) {
    					guid = get_pguid(pos);
    					logopcode("%016llX ",guid);
    				}
    				break;
    
    			default:
    				printf("Bad block type %d ",blocktype);
    				return false;
    		}
    		logopcode("] ");
    	}
    	return true;
    }
    Fields :

    Code:
    bool updateblock_fields(unsigned long long guid, unsigned char** pos)
    {
    	unsigned int value;
    	unsigned int mask[256];
    	unsigned char blockCount;
    	int i, j, index;
    
    	GETINT8(blockCount,*pos);
    	logopcode("updatefields blocks=%d ",blockCount);
    
    	if (blockCount>0) {
    		if (blockCount>50) {
    			printf("Too many field blocks (%d) !",blockCount);
    			return false;
    		}
    
    		for(i=0; i<blockCount; i++) {
    			GETINT32(mask[i],*pos);
    		}
    
    		index = 0;
    		for(i=0; i<blockCount; i++) {
    			unsigned int bitmask = mask[i];
    			for(j=0; j<32; j++) {
    				if (bitmask & 1) {
    					GETINT32(value,*pos);				
    					logopcode("value(%d)=%d ",index,value);
    					objectMap.updateField(guid,index,value);
    				}
    				bitmask=bitmask>>1;
    				index++;
    			}
    		}
    	}
    	return true;
    }
    and position (after some fixes, I remember some online codes had issues with updateblock):

    Code:
    bool updateblock_position(unsigned long long guid, unsigned char** pos)
    {
    	unsigned long long rotation_guid, target_guid, transport_guid;
    	unsigned int updateFlags,movementFlags,timestamp,ttimestamp,fallTime,val,lowGuid,HighGuid,splineFlags,vehiculeid;
    	unsigned short movementFlags2;
    	unsigned char tseat;
    	float x,y,z,o,tx,ty,tz,to,sx,sy,sz,so,px,py,pz,jumpUnk1,jumpSinAngle,jumpCosAngle,jumpXYSpeed,pitch,speed,aim;
    	int i,count;
    	//hexdump(*pos,50);
    
    	GETINT16(updateFlags,*pos);
    	logopcode("updateflags=%X ",updateFlags);
    
    	if (updateFlags & UPDATEFLAG_LIVING) {
    		logopcode("living ");
    		GETINT32(movementFlags,*pos);
    		GETINT16(movementFlags2,*pos);
    		GETINT32(timestamp,*pos);
    		GETFLOAT(x,*pos);
    		GETFLOAT(y,*pos);
    		GETFLOAT(z,*pos);
    		GETFLOAT(o,*pos);
    		logopcode("movflags=%X movFlags2=%X timestamp=%u x,y,z,o=%.1f,%.1f,%.1f,%.1f ",movementFlags,movementFlags2,timestamp,x,y,z,o);
    		objectMap.updatePos(guid,x,y,z,o);
    
    		if (movementFlags & MOVEFLAG_TAXI) {
    			transport_guid = get_pguid(pos);
    			GETFLOAT(tx,*pos);
    			GETFLOAT(ty,*pos);
    			GETFLOAT(tz,*pos);
    			GETFLOAT(to,*pos);
    			GETINT32(ttimestamp,*pos);
    			GETINT8(tseat,*pos);
    			logopcode("tguid=%016llX tx,ty,tz,to=%.1f,%.1f,%.1f,%.1f ",transport_guid,tx,ty,tz,to);
    		}
    		if ((movementFlags & (MOVEFLAG_SWIMMING | MOVEFLAG_AIR_SWIMMING)) || (movementFlags2 & 0x20)) {
    			GETFLOAT(pitch,*pos);
    			logopcode("pitch=%.1f ",pitch);
    			objectMap.updatePitch(guid,pitch);
    		}
    		GETINT32(fallTime,*pos);
    		logopcode("fallTime=%d ",fallTime);
    		if (movementFlags & MOVEFLAG_JUMPING) {
    			GETFLOAT(jumpUnk1,*pos);
    			GETFLOAT(jumpSinAngle,*pos);
    			GETFLOAT(jumpCosAngle,*pos);
    			GETFLOAT(jumpXYSpeed,*pos);
    			logopcode("jump ");
    		}
    		if (movementFlags & MOVEFLAG_SPLINE_MOVER) {
    			IGNOREFLOAT(*pos);
    			logopcode("splinemover ");
    		}
    		logopcode("speeds ");
    		for (i=0; i<9; ++i) {
    			GETFLOAT(speed,*pos);
    			logopcode("%.1f/",speed);
    		}
    		logopcode(" ");
    		if (movementFlags & MOVEFLAG_SPLINEPATH) {
    			GETINT32(splineFlags,*pos);
    			logopcode("splinepath flags=%X ",splineFlags);
    			if (splineFlags & SPLINEFLAGS_ORIENTATION) {
    				IGNOREFLOAT(*pos);
    				logopcode("target ");
    			} else if (splineFlags & SPLINEFLAGS_GUID) {
    				get_pguid(pos);
    				logopcode("guid ");
    			} else if (splineFlags & SPLINEFLAGS_XYZ) {
    				GETFLOAT(sx,*pos);
    				GETFLOAT(sy,*pos);
    				GETFLOAT(sz,*pos);
    				GETFLOAT(so,*pos);
    				logopcode("XYZ sx,sy,sz,so=%.1f,%.1f,%.1f,%.1f ",sx,sy,sz,so);
    			}
    
    			IGNOREINT32(*pos);
    			IGNOREINT32(*pos);
    			IGNOREINT32(*pos);
    
    			IGNOREFLOAT(*pos);
    			IGNOREFLOAT(*pos);
    			IGNOREFLOAT(*pos);
    			IGNOREINT32(*pos);
    
    			GETINT32(count,*pos);
    			if (count>100) {
    				printf("splinepath count too big (%d) ! ",count);
    				return false;
    			} else {
    				for(i=0;i<count;i++) {
    					GETFLOAT(px,*pos);
    					GETFLOAT(py,*pos);
    					GETFLOAT(pz,*pos);
    					logopcode("node=%.1f,%.1f,%.1f ",px,py,pz);
    				}
    			}
    			IGNOREINT8(*pos);            
    			GETFLOAT(px,*pos);
    			GETFLOAT(py,*pos);
    			GETFLOAT(pz,*pos);
    			logopcode("finalnode=%.1f,%.1f,%.1f ",px,py,pz);
    		}
    	} else if (updateFlags & UPDATEFLAG_OBJONTRANSPORT) {
            	transport_guid = get_pguid(pos);
    		GETFLOAT(x,*pos);
    		GETFLOAT(y,*pos);
    		GETFLOAT(z,*pos);
    		GETFLOAT(tx,*pos);
    		GETFLOAT(ty,*pos);
    		GETFLOAT(tz,*pos);
    		GETFLOAT(o,*pos);
    		IGNOREFLOAT(*pos);		
    		objectMap.updatePos(guid,x,y,z,o);
    		logopcode("objontransport tguid=%016llX x,y,z,o=%.1f,%.1f,%.1f,%.1f tx,ty,tz=%.1f,%.1f,%.1f ",transport_guid,x,y,z,o,tx,ty,tz);
    	} else if (updateFlags & UPDATEFLAG_STATIONARY) {
    		GETFLOAT(x,*pos);
    		GETFLOAT(y,*pos);
    		GETFLOAT(z,*pos);
    		GETFLOAT(o,*pos);
    		objectMap.updatePos(guid,x,y,z,o);
    		logopcode("hasposition x,y,z,o=%.1f,%.1f,%.1f,%.1f ",x,y,z,o);
    	}
    
    	if (updateFlags & UPDATEFLAG_HighGuid) {
    		unsigned int highGuid;
    		GETINT32(highGuid,*pos);
    		logopcode("highGuid=%08X ",highGuid);
    	}
    
    	if (updateFlags & UPDATEFLAG_LowGuid) {
    		unsigned int lowGuid;
    		GETINT32(lowGuid,*pos);
    		logopcode("lowGuid=%08X ",lowGuid);
    	}
    
    	if (updateFlags & UPDATEFLAG_ATTACKINGTARGET) {
    		target_guid = get_pguid(pos);
    		logopcode("target_guid=%016llX ",target_guid);
    	}
    
    	if ((updateFlags & UPDATEFLAG_TRANSPORT) != 0) {
    		logopcode("TRANSPORT ");
    		IGNOREINT32(*pos);
    	}
    
    	if (updateFlags & UPDATEFLAG_VEHICULE) {
    		GETINT32(vehiculeid,*pos);
    		GETFLOAT(aim,*pos);
    		logopcode("VEHICULE id=%d aim=%.1f",vehiculeid,aim);
    	}
    
    	if (updateFlags & UPDATEFLAG_HASROTATION) {
    		IGNOREINT64(*pos);
    		logopcode("HASROTATION ");
    	}
    	return true;
    }
    Last edited by Nonal; 03-24-2010 at 05:19 PM.

Similar Threads

  1. ESO Packet Decrypt/Encrypt. Close, but cannot determine key
    By jarjar1 in forum Elder Scrolls Online General
    Replies: 3
    Last Post: 10-06-2013, 12:19 PM
  2. [Question] What packets are not encrypted/decrypted?
    By adapa in forum WoW Memory Editing
    Replies: 10
    Last Post: 09-28-2011, 09:03 AM
  3. [C] WoW packet decryption
    By pendra in forum WoW Memory Editing
    Replies: 12
    Last Post: 03-06-2010, 12:39 AM
  4. Packet capture/decrypt lib
    By amadmonk in forum WoW Memory Editing
    Replies: 17
    Last Post: 08-14-2009, 04:37 AM
All times are GMT -5. The time now is 12:28 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search