示例#1
0
        public Packet(CDataStore dataStore, bool other = false)
        {
            TimeStamp = Helper.GetUnixTime();

            var buffer = Memory.Read(dataStore.Data, (int)dataStore.Size);

            if (buffer != null)
            {
                if (!other)
                {
                    stream = new BinaryReader(new MemoryStream(buffer));

                    Message = stream.ReadUInt32();

                    var size = (int)dataStore.Size - 4;

                    Data = stream.ReadBytes(size);
                }
                else
                {
                    stream = new BinaryReader(new MemoryStream(buffer));

                    var size = (int)dataStore.Size;

                    Data = stream.ReadBytes(size);
                }
            }
        }
示例#2
0
        public CDataStore Clone()
        {
            var ds = new CDataStore
            {
                VTable = this.VTable,
                Data   = this.Data,
                Base   = this.Base,
                Alloc  = this.Alloc,
                Size   = this.Size,
                Read   = this.Read,
            };

            return(ds);
        }
示例#3
0
        public CDataStore Clone()
        {
            var ds = new CDataStore
            {
                VTable = this.VTable,
                Data   = this.Data,
                Base   = this.Base,
                Alloc  = this.Alloc,
                Size   = this.Size,
                Read   = this.Read,
            };

            return ds;
        }
示例#4
0
        public static uint ClientSend(IntPtr ptr, ref CDataStore dataStore, int args)
        {
            var ds = dataStore.Clone();
            var pkt = new Packet(ds);

            PacketLog.Write(pkt, "ClientMessage");

            Memory.Write(originalFunction, originalInstruction);

            var ret = (uint)originalDelegate.DynamicInvoke(new object[] { ptr, dataStore, args });

            Memory.Write(originalFunction, hookInstruction);

            return (uint)ret;
        }
示例#5
0
        public Packet(CDataStore dataStore)
        {
            TimeStamp = Helper.GetUnixTime();

            var buffer = Memory.Read(dataStore.Data, (int)dataStore.Size);

            if (buffer != null)
            {
                stream = new BinaryReader(new MemoryStream(buffer));
                Message = stream.ReadUInt32();

                var size = (int)dataStore.Size - 4;

                Data = stream.ReadBytes(size);
            }
        }