public static Structures.VectorStructure ReadVector(int adress) { int size = Marshal.SizeOf(typeof(Structures.VectorStructure)); byte[] bytes = new byte[size]; ReadProcessMemory(_processHandle, adress, bytes, size, out _); GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); Structures.VectorStructure theStructure = (Structures.VectorStructure)Marshal.PtrToStructure(handle.AddrOfPinnedObject() , typeof(Structures.VectorStructure)); handle.Free(); return(theStructure); }
public Vector(Structures.VectorStructure vector) { X = vector.X; Y = vector.Y; Z = vector.Z; }