Exemplo n.º 1
0
        public void SendReceiveFileTest()
        {
            string tempFile = XboxFileSystem.GetTempFileName();

            byte[] data = new byte[0x100000].FillRandom();
            _xbox.FileSystem.WriteFile(tempFile, data);
            byte[] data2 = _xbox.FileSystem.ReadFile(tempFile);
            Assert.IsTrue(data.IsEqual(data2));
            _xbox.FileSystem.DeleteFile(tempFile);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes access to various Xbox sub-systems.
 /// </summary>
 private void Initialize()
 {
     Memory  = new XboxMemory(this);
     Kernel  = new XboxKernel(this);
     System  = new XboxSystem(this);
     Process = new XboxProcess(this);
     //DebugMonitor = new XboxDebugMonitor(this);
     FileSystem = new XboxFileSystem(this);
     //ConnectionId = Process.Call(Kernel.Exports.PhyGetLinkState, 0).ConnectionId;
     Logger?.Info("All Xbox subsystems have been successfully initialized");
 }
Exemplo n.º 3
0
        /// <summary>
        /// Disconnects from the Xbox.
        /// </summary>
        public void Disconnect()
        {
            Memory?.Dispose();
            Memory       = null;
            Kernel       = null;
            System       = null;
            Process      = null;
            DebugMonitor = null;
            FileSystem   = null;
            ConnectionId = 0;

            CommandSession?.Dispose();
            CommandSession = null;
            NotificationSession?.Dispose();
            NotificationSession = null;
        }
Exemplo n.º 4
0
        public void FileStreamTest()
        {
            byte[] data = new byte[0x10000].FillRandom();

            string tempFile = XboxFileSystem.GetTempFileName();

            using (XboxFileStream fs = new XboxFileStream(_xbox, tempFile))
            {
                fs.Write(data, 0, data.Length);
                fs.Position = 0;
                byte[] data2 = new byte[data.Length];
                fs.Read(data2, 0, data2.Length);
                Assert.IsTrue(data.IsEqual(data2));
            }
            _xbox.FileSystem.DeleteFile(tempFile);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            string ipString = "";

            if (args.Length == 1)
            {
                ipString = args[0];
            }

            IPAddress ip = null;

            while (ip == null)
            {
                if (IPAddress.TryParse(ipString, out ip))
                {
                    break;
                }
                else
                {
                    if (ipString != "")
                    {
                        Console.Error.WriteLine($"Unable to parse {ipString} as an IP Address");
                    }

                    Console.Write("Enter Xbox IP: ");
                    ipString = Console.ReadLine();
                }
            }

            var xbox = new Xbox(new ConsoleLogger());

            xbox.Connect(ip, ViridiX.Linguist.Network.XboxConnectionOptions.PerformanceMode);
            xbox.CommandSession.SendBufferSize    = 80192;
            xbox.CommandSession.ReceiveBufferSize = 80192;
            xbfs = xbox.FileSystem;

            var localRoot = Path.Combine(Directory.GetCurrentDirectory(), ip.ToString());

            foreach (var drive in xbfs.DriveLetters)
            {
                DownloadDrive(drive, localRoot);
            }

            Console.WriteLine("Done");
            Console.ReadLine();
        }