/// <summary> /// Saves xbox kernel as local file on pc. /// </summary> public void SaveAsFile() { Xbox.ConnectionCheck(); //dumps kernel byte[] KrnlDump = Xbox.GetMemory(Base, Size); //saves kernel FileStream fs = new FileStream(Xbox.Version + " Kernel v" + Xbox.KernelVersion + " " + Xbox.Modules[0].TimeStamp.ToString().Replace(':', '.').Replace('/', '.') + " (UTC) .exe", FileMode.Create); fs.Write(KrnlDump, 0, KrnlDump.Length); fs.Close(); }
/// <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."); } }