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); }
/// <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 }
/// <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); }
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 }
static void SetBreakpointOff(Xbox xbox) { xbox.RemoveBreakPoint(k_breakpoint_address); xbox.Continue(); }
/// <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."); } }
static void SetBreakpointOn(Xbox xbox) { xbox.SetBreakPoint(k_breakpoint_address); System.Threading.Thread.Sleep(25); }
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(); }
/// <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); }
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."); }
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(); }
/// <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" } }
/// <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; }
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); }
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)); }
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); }
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; }
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; }
public XboxGamepad(Xbox xbox) { this.Xbox = xbox; }