Example #1
0
        // Read QuatTransform
        public QuatTransform ReadQuatTransform(Int64 _QuatTransformAddress)
        {
            QuatTransform QT = new QuatTransform();

            byte[] Buffer = new byte[20];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _QuatTransformAddress, Buffer, 20, out ByteRead);

            Vector4D TransAndScale = new Vector4D();
            Vector4D Rotation      = new Vector4D();

            TransAndScale.X = BitConverter.ToSingle(Buffer, (0 * 4));
            TransAndScale.Y = BitConverter.ToSingle(Buffer, (1 * 4));
            TransAndScale.Z = BitConverter.ToSingle(Buffer, (2 * 4));
            TransAndScale.O = BitConverter.ToSingle(Buffer, (3 * 4));

            Rotation.X = BitConverter.ToSingle(Buffer, (4 * 4));
            Rotation.Y = BitConverter.ToSingle(Buffer, (5 * 4));
            Rotation.Z = BitConverter.ToSingle(Buffer, (6 * 4));
            Rotation.O = BitConverter.ToSingle(Buffer, (7 * 4));

            QT.TransAndScale = TransAndScale;
            QT.Rotation      = Rotation;

            return(QT);
        }
Example #2
0
        // Read Matrix4x4
        public Matrix4x4 ReadMatrix4x4(Int64 _lpBaseAddress)
        {
            Matrix4x4 tmp = new Matrix4x4();

            byte[] Buffer = new byte[64];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, 64, out ByteRead);

            tmp.M11 = BitConverter.ToSingle(Buffer, (0 * 4));
            tmp.M12 = BitConverter.ToSingle(Buffer, (1 * 4));
            tmp.M13 = BitConverter.ToSingle(Buffer, (2 * 4));
            tmp.M14 = BitConverter.ToSingle(Buffer, (3 * 4));

            tmp.M21 = BitConverter.ToSingle(Buffer, (4 * 4));
            tmp.M22 = BitConverter.ToSingle(Buffer, (5 * 4));
            tmp.M23 = BitConverter.ToSingle(Buffer, (6 * 4));
            tmp.M24 = BitConverter.ToSingle(Buffer, (7 * 4));

            tmp.M31 = BitConverter.ToSingle(Buffer, (8 * 4));
            tmp.M32 = BitConverter.ToSingle(Buffer, (9 * 4));
            tmp.M33 = BitConverter.ToSingle(Buffer, (10 * 4));
            tmp.M34 = BitConverter.ToSingle(Buffer, (11 * 4));

            tmp.M41 = BitConverter.ToSingle(Buffer, (12 * 4));
            tmp.M42 = BitConverter.ToSingle(Buffer, (13 * 4));
            tmp.M43 = BitConverter.ToSingle(Buffer, (14 * 4));
            tmp.M44 = BitConverter.ToSingle(Buffer, (15 * 4));
            return(tmp);
        }
Example #3
0
        // Read String
        public string ReadString(Int64 _lpBaseAddress, UInt64 _Size)
        {
            byte[] Buffer = new byte[_Size];
            IntPtr BytesRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, _Size, out BytesRead);

            return(Encoding.UTF8.GetString(Buffer));
        }
Example #4
0
        // Read Int64
        public float ReadFloat(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[sizeof(float)];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, sizeof(float), out ByteRead);

            return(BitConverter.ToSingle(Buffer, 0));
        }
Example #5
0
        // Read UInt64
        public UInt64 ReadUInt64(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[8];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, 8, out ByteRead);

            return(BitConverter.ToUInt64(Buffer, 0));
        }
Example #6
0
        // Read Int32
        public Int32 ReadInt32(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[4];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, 4, out ByteRead);

            return(BitConverter.ToInt32(Buffer, 0));
        }
Example #7
0
        // Read Byte
        public byte ReadByte(Int64 _lpBaseAddress)
        {
            byte[] Buffer = new byte[sizeof(byte)];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, sizeof(byte), out ByteRead);

            return(Buffer[0]);
        }
Example #8
0
        // Read Object
        public object ReadObject(Int64 _lpBaseAddress, uint _Size)
        {
            object[] Buffer = new object[_Size];
            IntPtr   ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _lpBaseAddress, Buffer, _Size, out ByteRead);

            return(Buffer);
        }
Example #9
0
        // Read BoneTransformInfo
        public BoneTransformInfo ReadBoneTransformInfo(Int64 _BoneTransformAddress)
        {
            BoneTransformInfo Info = new BoneTransformInfo();

            Info.Transform = ReadMatrix4x4(_BoneTransformAddress);

            byte[] Buffer = new byte[10];
            IntPtr ByteRead;

            MemLib.ReadProcessMemory(ProcessHandle, _BoneTransformAddress + 0x40, Buffer, 10, out ByteRead);

            // MATRIX4x4 -> START
            //BitConverter.ToSingle(Buffer, (0 * 4)); // BASE
            //BitConverter.ToSingle(Buffer, (1 * 4)); // +0x4
            //BitConverter.ToSingle(Buffer, (2 * 4)); // +0x8
            //BitConverter.ToSingle(Buffer, (3 * 4)); // +0xC
            //BitConverter.ToSingle(Buffer, (4 * 4)); // +0x10
            //BitConverter.ToSingle(Buffer, (5 * 4)); // +0x14
            //BitConverter.ToSingle(Buffer, (6 * 4)); // +0x18
            //BitConverter.ToSingle(Buffer, (7 * 4)); // +0x1C
            //BitConverter.ToSingle(Buffer, (8 * 4)); // +0x20
            //BitConverter.ToSingle(Buffer, (9 * 4)); // +0x24
            //BitConverter.ToSingle(Buffer, (10 * 4)); // +0x28
            //BitConverter.ToSingle(Buffer, (11 * 4)); // +0x2C
            //BitConverter.ToSingle(Buffer, (12 * 4)); // +0x30
            //BitConverter.ToSingle(Buffer, (13 * 4)); // +0x34
            //BitConverter.ToSingle(Buffer, (14 * 4)); // +0x38
            //BitConverter.ToSingle(Buffer, (15 * 4)); // +0x3C
            // MATRIX4x4 -> END

            //Info.Position.X = BitConverter.ToSingle(Buffer, (16 * 4)); // +0x40
            //Info.Position.Y = BitConverter.ToSingle(Buffer, (17 * 4)); // +0x44
            //Info.Position.Z = BitConverter.ToSingle(Buffer, (18 * 4)); // +0x48
            //Info.Position.O = BitConverter.ToSingle(Buffer, (19 * 4)); // +0x4C

            return(Info);
        }