Page 16 of 33 FirstFirst ... 6121314151617181920 26 ... LastLast
Results 226 to 240 of 486
  1. #226
    Contributor culino2's Avatar
    Reputation
    168
    Join Date
    Feb 2013
    Posts
    104
    Thanks G/R
    70/23
    CoreCoins
    125
    Trade Feedback
    0 (0%)
    Quote Originally Posted by namreeb View Post
    You still can't pass a null pointer for 'this'.
    That's right. His function looks wrong anyway, he has to pass eax and edx if he uses the magic delphi hack to call __thiscall functions, the timestamp is also missing.

    But if he really wants to use datastore..

    Code:
    procedure blah();
    const
      NetClient__ProcessMessage: procedure(__eax, __edx, __this: Pointer; DataStore: PDataStore; timeStamp: Cardinal) = Pointer($00537AA0);
      ClientServices__Connection: function: Pointer = Pointer($005AB490);
    var
      data: TByteBuffer;
      p: TDataSTore;
    begin
      data := TByteBuffer.Create(6);
      data.PutUInt16(SMSG_LEARNED_SPELL);
      data.PutUInt32(1);
    
      p.vTable := nil;
      p.m_buffer := @data.Data[0];
      p.m_base := 0;
      p.m_alloc := -1;
      p.m_size := data.WritePos;
      p.m_read := 0;
    
      NetClient__ProcessMessage(nil, nil, ClientServices__Connection(), @p, OsGetAsyncTimeMs);
    
      data.Free();
    end;

  2. #227
    Sergeant R4zyel's Avatar
    Reputation
    23
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/4
    CoreCoins
    153
    Trade Feedback
    0 (0%)
    Quote Originally Posted by culino2 View Post
    That's right. His function looks wrong anyway, he has to pass eax and edx if he uses the magic delphi hack to call __thiscall functions, the timestamp is also missing.

    But if he really wants to use datastore..

    Code:
    procedure blah();
    const
      NetClient__ProcessMessage: procedure(__eax, __edx, __this: Pointer; DataStore: PDataStore; timeStamp: Cardinal) = Pointer($00537AA0);
      ClientServices__Connection: function: Pointer = Pointer($005AB490);
    var
      data: TByteBuffer;
      p: TDataSTore;
    begin
      data := TByteBuffer.Create(6);
      data.PutUInt16(SMSG_LEARNED_SPELL);
      data.PutUInt32(1);
    
      p.vTable := nil;
      p.m_buffer := @data.Data[0];
      p.m_base := 0;
      p.m_alloc := -1;
      p.m_size := data.WritePos;
      p.m_read := 0;
    
      NetClient__ProcessMessage(nil, nil, ClientServices__Connection(), @p, OsGetAsyncTimeMs);
    
      data.Free();
    end;
    Thanks culino2.
    The only problem i found is that i'm forced to call this function through Main thread, otherwise i get crashes.

  3. #228
    Elite User CoreCoins User Authenticator enabled namreeb's Avatar
    Reputation
    470
    Join Date
    Sep 2008
    Posts
    876
    Thanks G/R
    4/104
    CoreCoins
    3751
    Trade Feedback
    0 (0%)
    Why does this always happen? I give someone an answer and it is totally ignored. I sometimes wonder if I am the only one who can see my posts.

  4. #229
    Sergeant R4zyel's Avatar
    Reputation
    23
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/4
    CoreCoins
    153
    Trade Feedback
    0 (0%)
    Quote Originally Posted by namreeb View Post
    Why does this always happen? I give someone an answer and it is totally ignored. I sometimes wonder if I am the only one who can see my posts.
    Culino2 Spoonfeeds, provide offsets, and writes in delphi, meanwhile i don't understand you at all.

    Btw, to contribute ONTOPIC, i found out by myself that Datastore.vtable is totally necessary for NetClient_PorcessMessage.
    datastore^.vTable := Pointer($7FF9E4);

  5. #230
    👺👺👺👺👺👺👺👺 CoreCoins User Jadd's Avatar
    Reputation
    1260
    Join Date
    May 2008
    Posts
    2,243
    Thanks G/R
    65/150
    CoreCoins
    742600
    Trade Feedback
    0 (0%)
    Quote Originally Posted by R4zyel View Post
    Culino2 Spoonfeeds, provide offsets, and writes in delphi, meanwhile i don't understand you at all.
    You'll probably find you learnt only half of what you could have when you end up with a half copy-pasted hack.
    I'm not a trade moderator. Please don't message me regarding trade threads, you will be ignored!

  6. #231
    Sergeant R4zyel's Avatar
    Reputation
    23
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/4
    CoreCoins
    153
    Trade Feedback
    0 (0%)
    Quote Originally Posted by Jadd View Post
    You'll probably find you learnt only half of what you could have when you end up with a half copy-pasted hack.
    As you can see i'm learning by myself, lonely.
    But Culino spends more time in writing the post and understanding my problem than namreeb, no offence.

    i know truth sometimes hurt.

  7. #232
    Elite User CoreCoins User Authenticator enabled namreeb's Avatar
    Reputation
    470
    Join Date
    Sep 2008
    Posts
    876
    Thanks G/R
    4/104
    CoreCoins
    3751
    Trade Feedback
    0 (0%)
    Okay, that's enough mister nice guy. You listen to this you cocky little fcker.

    I did give you your answer you just didn't understand it. I'll try once more. If you still don't get it then I wash my hands of it.

    Quote Originally Posted by namreeb View Post
    I would suggest using the pointer from the code above rather than a null pointer. It absolutely does need that value in vanilla because it will read an array indexed by the opcode of the message for the handler.
    That is the answer to your problem. Maybe you have some other problem in that delphi code and maybe you don't, but you cannot pass null for 'this'. Here is the HexRays output for the ProcessMessage function:

    Code:
    void __thiscall NetClient::ProcessMessage(NetClient *this, int tickCount, CDataStore *dataStore)
    {
      void (__fastcall *handler)(int, int, int, CDataStore *); // [email protected]
      CDataStore *packet; // [email protected]
      int opCode; // [email protected]
      NetClient *this_; // [email protected]
    
      packet = dataStore;
      this_ = this;
      ++s_statsDotMessagesReceived;
      CDataStore::Get16(dataStore, (__int16 *)&dataStore + 1);
      opCode = HIWORD(dataStore);
      (*((void (__thiscall **)(NetClient *, _DWORD))this_->VMT + 16))(this_, HIWORD(dataStore));
      handler = this_->m_handlers[opCode];
      if ( handler )
        handler(this_->m_deleteMe[opCode], opCode, tickCount, packet);
      else
        packet->VMT->Reset(packet);
    }
    Pay extra close attention to this line:

    Code:
      handler = this_->m_handlers[opCode];
    The offset into a NetClient instance of m_handlers[] is 0x74. If you pass null for 'this', it will attempt to access an array beginning at the literal address 0x00000074. This will result in an access violation and a crash. It may even crash sooner from the VMT call on the line above. I cba checking.

    Now please google translate this, ask someone who understands english, maybe take a day or two to read it out loud slowly. Whatever you need to do to understand before you come back here and cry about my giving you wrong information.

    Quote Originally Posted by R4zyel View Post
    i know truth sometimes hurt.
    Oh sweet irony.

    Now kindly fck off pls. Thanks.
    Last edited by namreeb; 06-23-2015 at 11:07 AM.

  8. #233
    Elite User CoreCoins User Authenticator enabled namreeb's Avatar
    Reputation
    470
    Join Date
    Sep 2008
    Posts
    876
    Thanks G/R
    4/104
    CoreCoins
    3751
    Trade Feedback
    0 (0%)
    I was asked privately to show my C# implementation for CDataStore. Instead I will give some nice copy-pasta.

    Comments on my design decisions or coding style will be ignored.

    Code:
    using System;
    using System.Runtime.InteropServices;
    using System.Text;
    using ClassicWowHack.Game.Objects;
    using ClassicWowHack.Misc;
    using ClassicWowHack.Native;
    
    namespace ClassicWowHack.Packet
    {
        class CDataStore
        {
            #region Properties
            public readonly bool Complete = true;
            public readonly IntPtr UnmanagedPtr;
            private readonly bool _deallocate;
    
            public IntPtr Data
            {
                get { return Marshal.ReadIntPtr(UnmanagedPtr, 0x4); }
                protected set { Marshal.WriteIntPtr(UnmanagedPtr, 0x4, value); }
            }
    
            public int Base
            {
                get { return Marshal.ReadInt32(UnmanagedPtr, 0x8); }
                protected set { Marshal.WriteInt32(UnmanagedPtr, 0x8, value); }
            }
    
            public int Capacity
            {
                get { return Marshal.ReadInt32(UnmanagedPtr, 0xC); }
                protected set { Marshal.WriteInt32(UnmanagedPtr, 0xC, value); }
            }
    
            public int BytesWritten
            {
                get { return Marshal.ReadInt32(UnmanagedPtr, 0x10); }
                protected set { Marshal.WriteInt32(UnmanagedPtr, 0x10, value); }
            }
    
            public int BytesRead
            {
                get { return Marshal.ReadInt32(UnmanagedPtr, 0x14); }
                protected set { Marshal.WriteInt32(UnmanagedPtr, 0x14, value); }
            }
    
            public OpCode OpCode
            {
                get { return (OpCode)Marshal.ReadInt16(Data); }
                set { Marshal.WriteInt32(Data, (short) value); }
            }
            #endregion
    
            public CDataStore(IntPtr unmanagedPtr)
            {
                UnmanagedPtr = unmanagedPtr;
                _deallocate = false;
            }
    
            private const int StructSize = 0x18;
    
            public CDataStore(int bytesRequested)
            {
                UnmanagedPtr = Marshal.AllocHGlobal(StructSize);
                Data = Marshal.AllocHGlobal(bytesRequested);
    
                OpCode = OpCode.MSG_NULL_ACTION;
                Capacity = bytesRequested;
                BytesRead = Base = 0;
                BytesWritten = 4;
                _deallocate = true;
            }
    
            public static CDataStore Copy(IntPtr dataStorePtr, bool resetRead = true)
            {
                return Copy(new CDataStore(dataStorePtr), resetRead);
            }
    
            public static CDataStore Copy(CDataStore dataStore, bool resetRead = true)
            {
                var ret = new CDataStore(dataStore.Capacity == -1 ? dataStore.BytesWritten : dataStore.Capacity);
    
                var data = new byte[ret.Capacity];
    
                if (dataStore.Data != IntPtr.Zero)
                    Marshal.Copy(dataStore.Data, data, 0, dataStore.BytesWritten);
    
                Marshal.Copy(data, 0, ret.Data, data.Length);
    
                ret.Base = dataStore.Base;
                ret.BytesRead = resetRead ? 0 : dataStore.BytesRead;
                ret.BytesWritten = dataStore.BytesWritten;
    
                return ret;
            }
    
            ~CDataStore()
            {
                if (!_deallocate)
                    return;
    
                Marshal.FreeHGlobal(Data);
                Data = IntPtr.Zero;
                Marshal.FreeHGlobal(UnmanagedPtr);
            }
    
            #region Write Functions
            public void Write(byte val)
            {
                Marshal.WriteByte(Data, BytesWritten, val);
    
                BytesWritten += 1;
            }
    
            public void Write(short val)
            {
                Marshal.WriteInt16(Data, BytesWritten, val);
    
                BytesWritten += 2;
            }
    
            public void Write(ushort val)
            {
                Write((short) val);
            }
    
            public void Write(int val)
            {
                Marshal.WriteInt32(Data, BytesWritten, val);
                
                BytesWritten += 4;
            }
    
            public void Write(uint val)
            {
                Write((int) val);
            }
    
            public void Write(long val)
            {
                Marshal.WriteInt64(Data, BytesWritten, val);
    
                BytesWritten += 8;
            }
    
            public void Write(ulong val)
            {
                Write((long)val);
            }
    
            public void Write(float val)
            {
                var destination = new IntPtr(Data.ToInt32() + BytesWritten);
                var tmp = new[] {val};
                Marshal.Copy(tmp, 0, destination, 1);
    
                BytesWritten += 4;
            }
    
            public void Write(double val)
            {
                var destination = new IntPtr(Data.ToInt32() + BytesWritten);
                var tmp = new[] {val};
                Marshal.Copy(tmp, 0, destination, 1);
    
                BytesWritten += 8;
            }
    
            public void Write(byte[] val)
            {
                var destination = new IntPtr(Data.ToInt32() + BytesWritten);
                Marshal.Copy(val, 0, destination, val.Length);
    
                BytesWritten += val.Length;
            }
    
            public void Write(string val, bool unicode = false)
            {
                var destination = new IntPtr(Data.ToInt32() + BytesWritten);
    
                if (unicode)
                {
                    Marshal.Copy(val.ToCharArray(), 0, destination, val.ToCharArray().Length);
                    BytesWritten += val.Length*2;
                }
                else
                {
                    var encodedBytes = Encoding.ASCII.GetBytes(val);
    
                    Marshal.Copy(encodedBytes, 0, destination, encodedBytes.Length);
                    BytesWritten += val.Length;
    
                    Write((byte) 0);
                }
            }
            #endregion
    
            #region Read Functions
            public T Read<T>()
            {
                object ret;
                var tType = typeof (T);
                var address = new IntPtr(Data.ToInt32() + BytesRead);
    
                // Handle types that don't have a real typecode
                if (tType == typeof (IntPtr))
                {
                    ret = Marshal.ReadIntPtr(address);
                    BytesRead += 4;
                    return (T) ret;
                }
    
                int size;
    
                switch (Type.GetTypeCode(tType))
                {
                    case TypeCode.Boolean:
                    case TypeCode.Byte:
                        ret = Marshal.ReadByte(address);
                        size = 1;
                        break;
                    case TypeCode.Char:
                        ret = (char) Marshal.ReadByte(address);
                        size = 1;
                        break;
    
                    case TypeCode.Int16:
                        ret = Marshal.ReadInt16(address);
                        size = 2;
                        break;
    
                    case TypeCode.UInt16:
                        ret = (ushort) Marshal.ReadInt16(address);
                        size = 2;
                        break;
    
                    case TypeCode.Int32:
                        ret = Marshal.ReadInt32(address);
                        size = 4;
                        break;
    
                    case TypeCode.UInt32:
                        ret = (uint) Marshal.ReadInt32(address);
                        size = 4;
                        break;
    
                    case TypeCode.Int64:
                        ret = Marshal.ReadInt64(address);
                        size = 8;
                        break;
    
                    case TypeCode.UInt64:
                        ret = (ulong) Marshal.ReadInt64(address);
                        size = 8;
                        break;
    
                    case TypeCode.Single:
                        float[] tmp = new float[1];
                        Marshal.Copy(address, tmp, 0, 1);
                        size = 4;
                        ret = tmp[0];
                        break;
    
                    case TypeCode.Double:
                        double[] tmp2 = new double[1];
                        Marshal.Copy(address, tmp2, 0, 1);
                        ret = tmp2[0];
                        size = 8;
                        break;
    
                    default:
                        throw new ArgumentOutOfRangeException(tType.FullName + " is not supported with this method.");
                }
    
                BytesRead += size;
    
                return (T)ret;
            }
    
            public byte[] Read(int length)
            {
                if (BytesRead + length > Capacity)
                    throw new OverflowException("CPacket: Read overflow");
    
                byte[] ret = new byte[length];
                Marshal.Copy(new IntPtr(Data.ToInt32() + BytesRead), ret, 0, length);
    
                BytesRead += length;
    
                return ret;
            }
    
            public string ReadAnsiString()
            {
                IntPtr stringPtr = new IntPtr(Data.ToInt32() + BytesRead);
                string ret = Marshal.PtrToStringAnsi(stringPtr);
    
                BytesRead += ret.Length + 1;
    
                return ret;
            }
    
            public string ReadUnicodeString()
            {
                var stringPtr = new IntPtr(Data.ToInt32() + BytesRead);
                string ret = Marshal.PtrToStringUni(stringPtr);
    
                if (ret == null)
                    return string.Empty;
    
                BytesRead += (ret.Length + 1)*2;
    
                return ret;
            }
            #endregion
    
            public override string ToString()
            {
                var ret = OpCode.ToString();
    
                for (var i = 0; i < BytesWritten; i++)
                    ret += " 0x" + Marshal.ReadByte(Data, i).ToString("X2");
    
                return ret;
            }
        }
    
        class MovementPacket : CDataStore
        {
            #region Complete
            /// <summary>
            /// Whether this packet was created by us.  Only these packets are capable of being
            /// checked for well-formness.
            /// </summary>
            private readonly bool _ourPacket;
    
            private bool _flagsSet;
            private bool _timeSet;
            private bool _xSet;
            private bool _ySet;
            private bool _zSet;
            private bool _orientationSet;
            private bool _transportGuidSet;
            private bool _transportXSet;
            private bool _transportYSet;
            private bool _transportZSet;
            private bool _transportOrientationSet;
            private bool _pitchSet;
            private bool _fallTimeSet;
            private bool _fallVelocitySet;
            private bool _fallSinAngleSet;
            private bool _fallCosAngleSet;
            private bool _fallLateralSpeedSet;
            private bool _splineSet;
    
            public new bool Complete
            {
                get
                {
                    if (!_ourPacket)
                        return true;
    
                    if (!_flagsSet || !_timeSet || !_xSet || !_ySet || !_zSet || !_orientationSet || !_fallTimeSet)
                        return false;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport) && 
                        (!_transportGuidSet || !_transportXSet || !_transportYSet || !_transportZSet || !_transportOrientationSet))
                        return false;
    
                    if (Flags.HasFlag(MovementFlags.Swimming) && !_pitchSet)
                        return false;
    
                    if (Flags.HasFlag(MovementFlags.Falling) &&
                        (!_fallVelocitySet || !_fallSinAngleSet || !_fallCosAngleSet || !_fallLateralSpeedSet))
                        return false;
    
                    if (Flags.HasFlag(MovementFlags.SplineElevation) && !_splineSet)
                        return false;
    
                    return true;
                }
            }
            #endregion
    
            public MovementPacket(IntPtr unmanagedPtr) : base(unmanagedPtr) {}
    
            public MovementPacket(MovementFlags flags) : base(BufferSize(flags))
            {
                Flags = flags;
                BytesWritten = Capacity;
    
                _ourPacket = true;
    
                _flagsSet = true;
                _timeSet = false;
                _xSet = _ySet = _zSet = _orientationSet = false;
    
                _transportGuidSet = false;
                _transportXSet = _transportYSet = _transportZSet = false;
                _transportOrientationSet = false;
    
                _pitchSet = false;
    
                _fallTimeSet = false;
                _fallVelocitySet = false;
                _fallSinAngleSet = false;
                _fallCosAngleSet = false;
                _fallLateralSpeedSet = false;
    
                _splineSet = false;
            }
    
            private static int BufferSize(MovementFlags flags)
            {
                var ret = 0x20;
    
                if (flags.HasFlag(MovementFlags.OnTransport))
                    ret += 0x18;
                if (flags.HasFlag(MovementFlags.Swimming))
                    ret += 0x4;
                if (flags.HasFlag(MovementFlags.Falling))
                    ret += 0x10;
                if (flags.HasFlag(MovementFlags.SplineElevation))
                    ret += 0x4;
    
                return ret;
            }
    
            private const int TransportSize = 24;
            private const int SwimmingSize = 4;
            private const int FallingSize = 16;
    
            public MovementFlags Flags
            {
                get
                {
                    MovementFlags ret;
    
                    try
                    {
                        ret = (MovementFlags)Marshal.ReadInt32(Data, 4);
                    }
                    catch (Exception e)
                    {
                        Logging.Write("MovementPacket.Flags Exception: " + e);
                        return MovementFlags.None;
                    }
    
                    return ret;
                }
                set
                {
                    _flagsSet = true;
                    Marshal.WriteInt32(Data, 4, (int) value);
                }
            }
    
            public uint Time
            {
                get { return (uint) Marshal.ReadInt32(Data, 8); }
                set
                {
                    _timeSet = true;
                    Marshal.WriteInt32(Data, 8, (int) value);
                }
            }
    
            #region Position
            public float X
            {
                get 
                {
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0xC), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    _xSet = true;
                    var ins = new[] {value};
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0xC), 1);
                }
            }
    
            public float Y
            {
                get
                {
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x10), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    _ySet = true;
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x10), 1);
                }
            }
    
            public float Z
            {
                get
                {
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x14), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    _zSet = true;
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x14), 1);
                }
            }
    
            public Point3 Position
            {
                get { return new Point3 {X = X, Y = Y, Z = Z}; }
                set
                {
                    X = value.X;
                    Y = value.Y;
                    Z = value.Z;
                }
            }
    
            public float Orientation
            {
                get
                {
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x18), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    _orientationSet = true;
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x18), 1);
                }
            }
            #endregion
    
            #region OnTransport
            public ulong TransportGuid
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    return (ulong)Marshal.ReadInt64(Data, 0x1C);
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    _transportGuidSet = true;
    
                    Marshal.WriteInt64(Data, 0x1C, (long) value);
                }
            }
    
            public float TransportX
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x24), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    _transportXSet = true;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x24), 1);
                }
            }
    
            public float TransportY
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x28), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    _transportYSet = true;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x28), 1);
                }
            }
    
            public float TransportZ
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x2C), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    _transportZSet = true;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x2C), 1);
                }
            }
    
            public Point3 TransportPosition
            {
                get { return new Point3 { X = X, Y = Y, Z = Z }; }
                set
                {
                    TransportX = value.X;
                    TransportY = value.Y;
                    TransportZ = value.Z;
                }
            }
    
            public float TransportOrientation
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + 0x30), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.OnTransport))
                        throw new ArgumentOutOfRangeException("Not on transport");
    
                    _transportOrientationSet = true;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + 0x30), 1);
                }
            }
            #endregion
    
            #region Swimming
            public float Pitch
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.Swimming))
                        throw new ArgumentOutOfRangeException("Not swimming");
    
                    var offset = Flags.HasFlag(MovementFlags.OnTransport) ? 0x34 : 0x1C;
    
                    var ret = new float[1];
    
                    Marshal.Copy(new IntPtr(Data.ToInt32() + offset), ret, 0, 1);
    
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.Swimming))
                        throw new ArgumentOutOfRangeException("Not swimming");
    
                    _pitchSet = true;
    
                    var offset = Flags.HasFlag(MovementFlags.OnTransport) ? 0x34 : 0x1C;
    
                    var ins = new [] {value};
    
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + offset), 1);
                }
            }
            #endregion
    
            public uint FallTime
            {
                get
                {
                    var offset = 0x1C;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    return (uint)Marshal.ReadInt32(Data, offset);
                }
                set
                {
                    _fallTimeSet = true;
    
                    var offset = 0x1C;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    Marshal.WriteInt32(Data, offset, (int)value);
                }
            }
    
            #region Falling
            public float FallVelocity
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    var offset = 0x20;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + offset), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    _fallVelocitySet = true;
    
                    var offset = 0x20;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + offset), 1);
                }
            }
    
            public float FallSinAngle
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    var offset = 0x24;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + offset), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    _fallSinAngleSet = true;
    
                    var offset = 0x24;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + offset), 1);
                }
            }
    
            public float FallCosAngle
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    var offset = 0x28;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + offset), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    _fallCosAngleSet = true;
    
                    var offset = 0x28;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + offset), 1);
                }
            }
    
            public float FallLateralSpeed
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    var offset = 0x2C;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ret = new float[1];
                    Marshal.Copy(new IntPtr(Data.ToInt32() + offset), ret, 0, 1);
                    return ret[0];
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.Falling))
                        throw new ArgumentOutOfRangeException("Not falling");
    
                    _fallLateralSpeedSet = true;
    
                    var offset = 0x2C;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
    
                    var ins = new[] { value };
                    Marshal.Copy(ins, 0, new IntPtr(Data.ToInt32() + offset), 1);
                }
            }
            #endregion
    
            #region SplineElevation
            public int UnknownSpline
            {
                get
                {
                    if (!Flags.HasFlag(MovementFlags.SplineElevation))
                        throw new ArgumentOutOfRangeException("Spline elevation missing");
    
                    var offset = 0x20;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
                    if (Flags.HasFlag(MovementFlags.Falling))
                        offset += FallingSize;
    
                    return Marshal.ReadInt32(Data, offset);
                }
                set
                {
                    if (!Flags.HasFlag(MovementFlags.SplineElevation))
                        throw new ArgumentOutOfRangeException("Spline elevation missing");
    
                    _splineSet = true;
    
                    var offset = 0x20;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        offset += TransportSize;
                    if (Flags.HasFlag(MovementFlags.Swimming))
                        offset += SwimmingSize;
                    if (Flags.HasFlag(MovementFlags.Falling))
                        offset += FallingSize;
    
                    Marshal.WriteInt32(Data, offset, value);
                }
            }
            #endregion
    
            public override string ToString()
            {
                try
                {
                    long perfCount, perfFreq;
                    Win32.QueryPerformanceCounter(out perfCount);
                    Win32.QueryPerformanceFrequency(out perfFreq);
    
                    double scalar = 1000.0 / (double)perfFreq;
                    double time = scalar * (double)perfCount;
    
                    var ret = string.Format("{0} MoveFlags: {1} Time: {2} (Current system tick count = {8}, perf: {9}) Position ({3}, {4}, {5}, {6}) Fall Time: {7}",
                                            OpCode, Flags, Time, X, Y, Z, Orientation, FallTime, Environment.TickCount, time);
    
                    if (Flags.HasFlag(MovementFlags.Falling))
                        ret += " Fall velocity: " + FallVelocity;
    
                    if (Flags.HasFlag(MovementFlags.OnTransport))
                        ret += " Transport GUID: 0x" + TransportGuid.ToString("X");
    
                    return ret;
                }
                catch (Exception e)
                {
                    Logging.Write("MovementPacket Exception: " + e + " Data: 0x" + Data.ToString("X"));
                    return string.Empty;
                }
            }
        }
    }

  9. #234
    Member Edak's Avatar
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    1
    Thanks G/R
    0/0
    CoreCoins
    0
    Trade Feedback
    0 (0%)
    Quote Originally Posted by Jadd View Post
    Code:
    namespace Offsets
    {
    	namespace General
    	{
    		DWORD_PTR
    			IsInGame                   = 0x00B4B424, // 1.12.1.5875 (Byte)
    	}
    	
    	namespace Camera
    	{
    		DWORD_PTR
    			CameraPtr                  = 0x0074B2BC, // 1.12.1.5875
    			CameraPtrOffset            = 0x000065B8, // 1.12.1.5875
    			CameraPosition             = 0x00000008, // 1.12.1.5875 (CVec3)
    			CameraFollowingGUID        = 0x00000088; // 1.12.1.5875 (GUID)
    	}
    
    	namespace ObjectManager
    	{
    		DWORD_PTR
    			ObjectDescriptors          = 0x00000008, // 1.12.1.5875
    			ObjectMovementData         = 0x00000118, // 1.12.1.5875 (UInt)
    			ObjectMovementDataPosition = 0x00000010, // 1.12.1.5875 (CVec3)
    			ObjectMovementDataRotation = 0x0000001C, // 1.12.1.5875 (Float)
    			ObjectMovementDataState    = 0x000000A0, // 1.12.1.5875 (UInt)
    			ObjectMovementDataFlags    = 0x00000040, // 1.12.1.5875 (UInt)
    			ObjectMovementDataRunSpeed = 0x0000008C, // 1.12.1.5875 (Float)
    			PlayerObjectTracking       = 0x00002EB0; // 1.12.1.5875 (Byte)
    	}
    		
    	namespace Hacks
    	{
    		DWORD_PTR
    			SuperFly                   = 0x006341BC, // 1.12.1.5875 (Array) - On: { 0x90, 0x90 } - Off: { 0x74, 0x25 }
    			NoFallDamage               = 0x007C63DA, // 1.12.1.5875 (Array) - On: { 0x31, 0xC9, 0x90 } - Off: { 0x8B, 0x4F, 0x78 }
    			AntiJump                   = 0x007C625F, // 1.12.1.5875 (Array) - On: { 0xEB } - Off: { 0x75 }
    			AntiMove                   = 0x00615CF5, // 1.12.1.5875 (Array) - On: { 0xFE } - Off: { 0xF8 }
    			AntiRoot                   = 0x006163DB, // 1.12.1.5875 (Array) - On: { 0xEB, 0xF9 } - Off: { 0x8A, 0x47 }
    			InfiniteJump               = 0x007C625E, // 1.12.1.5875 (Array) - On: { 0x10 } - Off: { 0x30 }
    			JumpGravity                = 0x007C6272, // 1.12.1.5875 (Float)
    			JumpGravityWater           = 0x007C6269, // 1.12.1.5875 (Float)
    			WallClimb                  = 0x0080DFFC, // 1.12.1.5875 (Float)
    			HeartbeatInterval          = 0x00615BA7; // 1.12.1.5875 (UInt)  - Speedhack anti-disconnect
    	}
    }

    Code:
    0x0074B2BC -> 0x49D85708
    
    0x49D85708+0x000065B8 = 0x49D8BCC0
    
    0x49D8BCC0 = ???
    Am I missing something here?

    I'm trying to get the Camera position/view matrix
    Last edited by Edak; 09-04-2015 at 09:32 PM.

  10. #235
    Sergeant R4zyel's Avatar
    Reputation
    23
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    12/4
    CoreCoins
    153
    Trade Feedback
    0 (0%)
    Has anybody achieved to register ASM functions in Vanilla through "lua_loadbuffer" "lua_pushclosure" etc?

    Vanilla uses LUA 5.0, and many shit is unsupported, nor there're any guides in google nor in ownedcore, what a pitty.

  11. #236
    Banned luckruns0ut's Avatar
    Reputation
    20
    Join Date
    Dec 2014
    Posts
    33
    Thanks G/R
    5/8
    CoreCoins
    15
    Trade Feedback
    0 (0%)
    Quote Originally Posted by Edak View Post
    Code:
    0x0074B2BC -> 0x49D85708
    
    0x49D85708+0x000065B8 = 0x49D8BCC0
    
    0x49D8BCC0 = ???
    Am I missing something here?

    I'm trying to get the Camera position/view matrix


    I've got the same problem - Can someone confirm these addresses are correct? Maybe I'm just using them wrong which is more likely...

    SCamera *pCam = (SCamera*)((*(DWORD*)0x0074B2BC) + 0x000065B8);

  12. #237
    Active Member CoreCoins User Creepwalker's Avatar
    Reputation
    36
    Join Date
    Oct 2008
    Posts
    197
    Thanks G/R
    3/2
    CoreCoins
    1144
    Trade Feedback
    0 (0%)
    Does anyone happen to have the correct lua_getstate, the previous one posted that was pulled from WoWSharp does not work

  13. #238
    Contributor miceiken's Avatar
    Reputation
    195
    Join Date
    Dec 2007
    Posts
    396
    Thanks G/R
    4/5
    CoreCoins
    128
    Trade Feedback
    0 (0%)
    Quote Originally Posted by Edak View Post
    Code:
    0x0074B2BC -> 0x49D85708
    
    0x49D85708+0x000065B8 = 0x49D8BCC0
    
    0x49D8BCC0 = ???
    Am I missing something here?

    I'm trying to get the Camera position/view matrix
    Quote Originally Posted by luckruns0ut View Post
    I've got the same problem - Can someone confirm these addresses are correct? Maybe I'm just using them wrong which is more likely...

    SCamera *pCam = (SCamera*)((*(DWORD*)0x0074B2BC) + 0x000065B;
    Code:
                internal static uint WorldFrame = 0x00B4B2BC;
                internal static uint ActiveCamera = 0x65B8;
    *(CGCamera**)((*(IntPtr*)Pointers.Drawing.WorldFrame) + (int)Pointers.Drawing.ActiveCamera)
    Quote Originally Posted by Creepwalker View Post
    Does anyone happen to have the correct lua_getstate, the previous one posted that was pulled from WoWSharp does not work
    I have it at
    internal static uint LuaState = 0x00CEEF74;
    not sure if it is correct
    Last edited by miceiken; 09-21-2015 at 07:08 PM.

  14. #239
    Banned luckruns0ut's Avatar
    Reputation
    20
    Join Date
    Dec 2014
    Posts
    33
    Thanks G/R
    5/8
    CoreCoins
    15
    Trade Feedback
    0 (0%)
    [WoW] 1.12.1.5875 Info Dump Thread-d0211c6dafdcede95594b6df7145a373-jpg

    sorted
    Last edited by luckruns0ut; 09-25-2015 at 10:05 AM.

  15. #240
    Elite User CoreCoins User Authenticator enabled namreeb's Avatar
    Reputation
    470
    Join Date
    Sep 2008
    Posts
    876
    Thanks G/R
    4/104
    CoreCoins
    3751
    Trade Feedback
    0 (0%)
    CWorld::Intersect = 0x672170. The prototype is this:

    bool __fastcall CWorld::Intersect(const C3Vector *p1, const C3Vector *p2, int ignored, C3Vector *intersectPoint, float *dist, unsigned int queryFlags)

 

 

Similar Threads

  1. [WoW][3.3.5.12340] Info Dump Thread
    By Nesox in forum WoW Memory Editing
    Replies: 82
    Last Post: 11-02-2014, 04:11 PM
  2. [WoW][4.0.3.13329] Info Dump Thread
    By TOM_RUS in forum WoW Memory Editing
    Replies: 73
    Last Post: 02-06-2011, 05:37 AM
  3. [WoW][4.0.1.13164] Info Dump Thread
    By Seifer in forum WoW Memory Editing
    Replies: 29
    Last Post: 01-18-2011, 08:14 AM
  4. [WoW][4.0.1.13205] Info Dump Thread
    By DrGonzo in forum WoW Memory Editing
    Replies: 12
    Last Post: 11-11-2010, 01:34 PM
  5. [WoW][3.3.3.11723] Info Dump Thread
    By miceiken in forum WoW Memory Editing
    Replies: 2
    Last Post: 03-27-2010, 03:42 PM
All times are GMT -5. The time now is 05:41 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search