Xbox debug connection.
Inheritance: IDisposable
コード例 #1
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		static LowLevel.HResult RebaseModule(Xbox xbox, string path, byte[] rebased_dll, ref uint base_address, uint reloc_alloc_count)
		{
			if (xbox != null && !ValidateBaseAddress(xbox, base_address))
				throw new ArgumentOutOfRangeException("base_address", "Specific base address is out of range");

			return RebaseModule(path, rebased_dll, (uint)rebased_dll.Length, ref base_address, reloc_alloc_count);
		}
コード例 #2
0
ファイル: XboxMemory.cs プロジェクト: CodeAsm/open-sauce
 /// <summary>
 /// Creates a new memory stream using a client connection to a debug xbox.
 /// </summary>
 /// <param name="client">Connection to use.</param>
 public XboxMemoryStream(Xbox client)
 {
     Xbox = client;
     if (client == null || !client.Connected)
         throw new NoConnectionException();
     position = 0x10000; // start at a valid memory address
 }
コード例 #3
0
ファイル: XboxFileSystem.cs プロジェクト: CodeAsm/open-sauce
        /// <summary>
        /// Creates a new file stream using a client connection to a debug xbox.
        /// </summary>
        /// <param name="xbox">Connection to use.</param>
        /// <param name="fileName">Name of the file to expose stream to.</param>
        /// <param name="mode">File create disposition.</param>
        public XboxFileStream(Xbox xbox, string fileName, FileMode mode)
        {
            this.Xbox = xbox;
            if (xbox == null || !xbox.Connected)
                throw new NoConnectionException("Must connect first.");

            FileName = fileName;
            position = 0;
            xbox.CreateFile(fileName, mode);
        }
コード例 #4
0
ファイル: XboxFileSystem.cs プロジェクト: CodeAsm/open-sauce
        public XboxFileStream(Xbox client, string fileName)
        {
            this.Xbox = client;
            if (client == null)
                throw new NoConnectionException("Must connect first.");

            this.FileName = fileName;
            position = 0;
            client.CreateFile(fileName, FileMode.Create);   // creates the file by default
        }
コード例 #5
0
ファイル: XboxDll.cs プロジェクト: yumiris/OpenSauce
 static void SetBreakpointOff(Xbox xbox)
 {
     xbox.RemoveBreakPoint(k_breakpoint_address);
     xbox.Continue();
 }
コード例 #6
0
ファイル: XboxKernel.cs プロジェクト: nolenfelten/Blam_BSP
 /// <summary>
 /// Contains everything needed to communicate with the Xbox kernel.
 /// </summary>
 /// <param name="xbox">Connection to use.</param>
 public XboxKernel(Xbox xbox)
 {
     Xbox = xbox;
     if (xbox == null)
         throw new NoConnectionException("Requires debug connection.");
     xbox.ConnectionCheck();
     try
     {
         InitializeKernelExports();
     }
     catch
     {
         SaveAsFile();
         throw new ApiException("Failed to obtain kernel exports.  The kernel has been saved to your computer for further examination.");
     }
 }
コード例 #7
0
ファイル: XboxDll.cs プロジェクト: yumiris/OpenSauce
 static void SetBreakpointOn(Xbox xbox)
 {
     xbox.SetBreakPoint(k_breakpoint_address);
     System.Threading.Thread.Sleep(25);
 }
コード例 #8
0
ファイル: RTH.cs プロジェクト: nolenfelten/Blam_BSP
        private static void InitYeloDebug(string IP)
        {
            xboxDebug = new YeloDebug.Xbox();
            // Do we really need a 5 second timeout period? How about half that?
            xboxDebug.Timeout = 2500;

            // If we are presented with an IP, use it
            if (IP.Split('.').Length == 4)
                xboxDebug.ConnectToIP(IP);
            // otherwise, use auto-detect
            else
            {
                System.Collections.Generic.List<DebugConnection> cons = xboxDebug.QueryXboxConnections();
                xboxDebug.Connect(cons[0].Name);
            }
            _debugName = xboxDebug.DebugName;
            _debugIP = xboxDebug.DebugIP.ToString();
        }
コード例 #9
0
ファイル: Xbox.cs プロジェクト: nolenfelten/Blam_BSP
            /// <summary>
            /// Creates a new file stream using a client connection to a debug xbox.
            /// </summary>
            /// <param name="client">Connection to use.</param>
            /// <param name="fileName">Name of the file to expose stream to.</param>
            /// <param name="mode">File create disposition.</param>
            public FileStream(Xbox client, string fileName, FileMode mode)
            {
                this.Client = client;
                if (client == null || !client.Connected)
                    throw new NoConnectionException("Must connect first.");

                FileName = fileName;
                position = 0;
                client.CreateFile(fileName, mode);
            }
コード例 #10
0
ファイル: XboxVideo.cs プロジェクト: CodeAsm/open-sauce
        public XboxVideoStream(Xbox xbox, VideoSize size, VideoQuality quality, VideoPresentationInterval interval)
        {
            Xbox = xbox;
            this.size = size;
            Quality = quality;
            Interval = interval;

            // todo: check memory requirements
            // 152kb (38 4kb pages) for medium size and normal quality
            // 604kb (151 4kb pages) for full size and normal quality

            // calculate width*height*quality+1 and round up to next 4kb page

            //640*480*16

            //throw new OutOfMemoryException("Not enough memory present to initialize the stream.");

        }
コード例 #11
0
ファイル: Program.cs プロジェクト: CodeAsm/open-sauce
        public static void FindXBox(string xbox)
        {
            _xbox = new Xbox();
            AsyncConnect(xbox);
            _xboxLocator.ShowDialog();

            if (XBox.Ping())
            {
                if (_mainWindow == null)
                {
                    _mainWindow = new Main();
                    _mainWindow.ShowDialog();
                    XBox.Disconnect();
                }
            }
            else new Settings().ShowDialog();
        }
コード例 #12
0
ファイル: XboxHistory.cs プロジェクト: CodeAsm/open-sauce
        /// <summary>
        /// Initializes the history page.
        /// </summary>
        public XboxHistory(Xbox xbox)
        {
            Xbox = xbox;
            Xbox.SetMemory(0xB00292D0, ScriptBufferAddress); // set up the script buffer

            if (IsPresent())
            {
                // restore our current allocations
                Xbox.ReloadAllocationTable();

                // check other settings like controller hook etc...
                XInputGetStateAddress = Xbox.GetUInt32(Gamepad.XInputGetState);
                OriginalGamepadCode = Xbox.GetMemory(Gamepad.OriginalCodeBuffer, 10);
            }
            else
            {
                // allocate memory for our history pages
                AllocateHistoryPages(kSize);
                Xbox.SetMemory(kBaseAddress, 0x6F6C6559);   // "Yelo"
            }
        }
コード例 #13
0
ファイル: XboxVideo.cs プロジェクト: CodeAsm/open-sauce
 /// <summary>
 /// Initializes a video stream of optimal settings.
 /// </summary>
 /// <param name="xbox"></param>
 public XboxVideoStream(Xbox xbox)
 {
     Xbox = xbox;
     this.size = VideoSize.Medium;
     Quality = VideoQuality.Regular;
     Interval = VideoPresentationInterval.Two;
 }
コード例 #14
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		static LowLevel.HResult RebaseModule(Xbox xbox, string path, byte[] rebased_dll, ref uint base_address)
		{
			return RebaseModule(xbox, path, rebased_dll, ref base_address, 0);
		}
コード例 #15
0
ファイル: XboxDll.cs プロジェクト: yumiris/OpenSauce
 static bool ValidateBaseAddress(Xbox xbox, uint base_address)
 {
     // 0x20000 to avoid someone overwriting the header
     return(base_address >= 0x20000 && base_address < uint.MaxValue &&
            xbox.IsValidAddress(base_address));
 }
コード例 #16
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		static void SetBreakpointOn(Xbox xbox)
		{
			xbox.SetBreakPoint(k_breakpoint_address);
			System.Threading.Thread.Sleep(25);
		}
コード例 #17
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		static bool ValidateBaseAddress(Xbox xbox, uint base_address)
		{
			// 0x20000 to avoid someone overwriting the header
			return base_address >= 0x20000 && base_address < uint.MaxValue && 
				xbox.IsValidAddress(base_address);
		}
コード例 #18
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		public static bool UnloadModule(Xbox xbox, uint base_address, uint exit_address)
		{
			SetBreakpointOn(xbox);//xbox.Pause();
			xbox.CallAddress(exit_address, false);
			xbox.FreeDebugMemory(base_address);
			SetBreakpointOff(xbox);//xbox.Continue();

			return true;
		}
コード例 #19
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		public static bool RunModule(Xbox xbox, string module_path, ref uint base_address, 
			out uint entry_point, out uint exit_address, out string error_details)
		{
			entry_point = exit_address = uint.MaxValue;
			error_details = null;
			LowLevel.HResult result;

			if (!File.Exists(module_path))
			{
				error_details = "File does not exist!";
				return false;
			}

			byte[] rebased_module;
			result = RebasedModuleBufferAllocate(module_path, out rebased_module, out error_details);

			if (result == LowLevel.HResult.Success)
			{
				try { base_address = xbox.AllocateMemory((uint)rebased_module.Length); }
				catch (Exception ex)
				{
					result = LowLevel.HResult.Unexpected;
					error_details = ex.ToString();
				}

				entry_point = base_address;
				try { result = RebaseModule(xbox, module_path, rebased_module, ref entry_point); }
				catch (Exception ex)
				{
					result = LowLevel.HResult.Unexpected;
					error_details = ex.ToString();
				}
				entry_point += base_address;

				if (result == LowLevel.HResult.Success)
				{
					xbox.Pause();
					xbox.SetMemory(base_address, rebased_module);
					exit_address = xbox.CallAddress(entry_point, true);
					xbox.Continue();
				}
			}

			if(error_details == null)
				error_details = GetResultString(result);

			return result == LowLevel.HResult.Success;
		}
コード例 #20
0
ファイル: XboxDll.cs プロジェクト: CodeAsm/open-sauce
		static void SetBreakpointOff(Xbox xbox)
		{
			xbox.RemoveBreakPoint(k_breakpoint_address);
			xbox.Continue();
		}
コード例 #21
0
ファイル: XboxGamepad.cs プロジェクト: CodeAsm/open-sauce
 public XboxGamepad(Xbox xbox)
 {
     this.Xbox = xbox;
 }
コード例 #22
0
 public XboxGamepad(Xbox xbox)
 {
     this.Xbox = xbox;
 }