[sources C++ Et C#] Quickboot V1.1


Messages recommandés

Posté(e)

Salut,

Dstruktiv nous offre ses sources Quickboot v1.1 en c++ ou c# (à vous le choix) :

/*QuickBoot v1.1 Xbox 360Coded by DstruktivI was going to snip out a couple of bits of code, namely the simplified drive mounting code as it wasn't mine, but I see someone has kindly already taken the source of this off our "private" ftp and it's now on pastebin as of 24/12/09 and some Spanish Xbox hacking site so may as well make it easy to find... Captain we have a leak.*/#include "stdafx.h"#include <xtl.h>#include <xam.h>#include <iostream>#include <fstream>#include <sys/stat.h>#include "xfilecache.h"#include <string>using std::string;using std::ifstream;using std::ofstream;typedef struct _STRING {    USHORT Length;    USHORT MaximumLength;    PCHAR Buffer;} STRING, *PSTRING;extern "C" int __stdcall ObCreateSymbolicLink( STRING*, STRING*);extern "C" int __stdcall ObDeleteSymbolicLink( STRING* );HRESULT Map( CHAR* szDrive, CHAR* szDevice ){    CHAR * szSourceDevice;    CHAR szDestinationDrive[16];    szSourceDevice = szDevice;    sprintf_s( szDestinationDrive,"\\??\\%s", szDrive );    STRING DeviceName =    {        strlen(szSourceDevice),        strlen(szSourceDevice) + 1,        szSourceDevice    };    STRING LinkName =    {        strlen(szDestinationDrive),        strlen(szDestinationDrive) + 1,        szDestinationDrive    };    return ( HRESULT )ObCreateSymbolicLink( &LinkName, &DeviceName );}HRESULT unMap( CHAR* szDrive ){    CHAR szDestinationDrive[16];    sprintf_s( szDestinationDrive,"\\??\\%s", szDrive );    STRING LinkName =    {        strlen(szDestinationDrive),        strlen(szDestinationDrive) + 1,        szDestinationDrive    };    return ( HRESULT )ObDeleteSymbolicLink( &LinkName );}void launchX(char* xfile){    XFlushUtilityDrive();    XFileCacheInit(XFILECACHE_CLEAR_ALL,0,XFILECACHE_DEFAULT_THREAD,0,1);    XFileCacheShutdown();    XFlushUtilityDrive();    XLaunchNewImage(xfile,0);}bool FileExists(char* strFilename) {  struct stat stFileInfo;  bool returnValue;  int intStat;  intStat = stat(strFilename,&stFileInfo);  if(intStat == 0) {    returnValue = true;  } else {    returnValue = false;  }    return(returnValue);}void debugLog(char* output){    unMap("usb:");    if (Map("usb:","\\Device\\Mass0") == S_OK )    {        ofstream writeLog;        writeLog.open("usb:\\debug.log",ofstream::app);        if (writeLog.is_open())        {          writeLog.write(output,strlen(output));          writeLog.write("\n",1);        }        writeLog.close();    }}VOID __cdecl main(){    char path[512];    if (FileExists("game:\\config.ini"))    {        ifstream config;        config.open ("game:\\config.ini");        if (config.is_open())        {            config.getline (path,512);            config.close();        }    }    else    {        debugLog("Config not found");        debugLog("game:\\config.ini");    }    string pathstr = path;    string pathstr1 = path;    string pathstr2 = path;    if(pathstr.substr(0,3) == "usb")    {        pathstr.insert(3,"0");        pathstr1.insert(3,"1");        pathstr2.insert(3,"2");        char *a;        char *b;        char *c;        a=&pathstr[0];        b=&pathstr1[0];        c=&pathstr2[0];                Map("usb0:","\\Device\\Mass0");        Map("usb1:","\\Device\\Mass1");        Map("usb2:","\\Device\\Mass2");        if(FileExists(a))        {                launchX(a);        }        else if (FileExists()        {                        launchX(;        }        else if (FileExists©)        {                        launchX©;        }        else        {            debugLog("Executable not found on any usb device at specified path:");            debugLog(path);        }    }    else if (FileExists(path))    {        Map("hdd:","\\Device\\Harddisk0\\Partition1");        Map("dvd:","\\Device\\Cdrom0");        launchX(path);    }    else    {        debugLog("Executable not found at specified path:");        debugLog(path);    }}

/*QuickBoot v1.1 PC Tool (Visual C#)Coded by DstruktivBig thanks to DJ Shepherd for X360.dll*/using System;using System.IO;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using X360.STFS;using X360.Other;using X360.IO;namespace QuickBoot{    public partial class QuickBoot : Form    {        public QuickBoot()        {            InitializeComponent();        }        CreateContents xsession = new CreateContents();        bool imageUpdated = false;        string processDir = (System.Environment.CurrentDirectory); //Work around for Windows XP        private void Form1_Load(object sender, EventArgs e)        {            System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();            System.Windows.Forms.ToolTip ToolTip2 = new System.Windows.Forms.ToolTip();            System.Windows.Forms.ToolTip ToolTip3 = new System.Windows.Forms.ToolTip();            System.Windows.Forms.ToolTip ToolTip4 = new System.Windows.Forms.ToolTip();            System.Windows.Forms.ToolTip ToolTip5 = new System.Windows.Forms.ToolTip();            ToolTip1.SetToolTip(this.txtTitle, "Application name that will show in NXE");            ToolTip2.SetToolTip(this.txtDescription, "Application description that will show in NXE");            ToolTip3.SetToolTip(this.txtPath, "Path relative to your Xbox 360 - \"usb:\\\",\"hdd:\\\",\"dvd:\\\" are supported drives. Example: hdd:\\Games\\tekken6\\default.xex");            ToolTip4.SetToolTip(this.imgDash, "Click here to add custom image that will show in NXE. Must be 16KB or less and exactly 64x64 resolution");            ToolTip5.SetToolTip(this.comboBox1, "An Xbox 360 Game will show up under the Xbox 360 Games menu item in the NXE dash, likewise a Game Demo will show up under Game Demos");            comboBox1.SelectedIndex = 0;            DJsIO xIO = new DJsIO("xbox\\default.xex", DJFileMode.Open, EndianType.BigEndian);            string xPath = "xbox\\default.xex";            xPath = xIO.FileNameShort;            if (!xsession.AddFile(xIO, xPath))            {                xIO.Close();                return;            }        }        byte[] ToHex(string xIn)        {            for (int i = 0; i < (xIn.Length % 2); i++)                xIn = "0" + xIn;            List<byte> xReturn = new List<byte>();            for (int i = 0; i < (xIn.Length / 2); i++)                xReturn.Add(Convert.ToByte(xIn.Substring(i * 2, 2), 16));            return xReturn.ToArray();        }        private void btnBuild_Click(object sender, EventArgs e)        {            if (txtTitle.Text == "")            {                MessageBox.Show("Please fill in the title.", "Error");            }            else if (txtDescription.Text == "")            {                MessageBox.Show("Please fill in the description.", "Error");            }            else if (txtPath.Text == "")            {                MessageBox.Show("Please fill in the path.", "Error");            }            else            {                xsession.STFSType = STFSType.Type0;                xsession.HeaderData.Description = txtDescription.Text;                xsession.HeaderData.Title_Display = txtTitle.Text;                PackageType xVal;                if (comboBox1.SelectedIndex == 0)                {                    xVal = PackageType.GamesOnDemand;                }                else                {                    xVal = PackageType.GameDemo;                }                xsession.HeaderData.TitleID = ((uint)3235813785);                xsession.HeaderData.ThisType = xVal;                xsession.HeaderData.Publisher = "F586558";                xsession.HeaderData.Title_Package = "QuickBoot Launcher";                xsession.HeaderData.SeriesID = ToHex("00000000000000000000");                xsession.HeaderData.SeasonID = ToHex("00000000000000000000");                xsession.HeaderData.DeviceID = ToHex("0000000000000000000000000000000000000000");                xsession.HeaderData.IDTransfer = TransferLock.AllowTransfer;                if (!imageUpdated)                {                    Byte[] defaultImage = (Byte[])new ImageConverter().ConvertTo(imgDash.Image, typeof(Byte[]));                    xsession.HeaderData.PackageImageBinary = defaultImage;                    xsession.HeaderData.ContentImageBinary = defaultImage;                }                DJsIO zIO = new DJsIO(processDir + "\\xbox\\config.ini", DJFileMode.Open, EndianType.BigEndian);                string zPath = processDir + "\\xbox\\config.ini";                zPath = zIO.FileNameShort;                if (!xsession.AddFile(zIO, zPath))                {                    zIO.Close();                    return;                }                DJsIO xIO = new DJsIO(DJFileMode.Create, "Select save location...", "", EndianType.BigEndian);                if (!xIO.Accessed)                    return;                LogRecord rec = new LogRecord();                RSAParams xParams;                xParams = new RSAParams(StrongSigned.LIVE);                STFSPackage xy = new STFSPackage(xsession, xParams, xIO, rec);                if (!xy.ParseSuccess)                {                    MessageBox.Show("Error");                    this.Close();                }                txtTitle.Text = "";                txtDescription.Text = "";                txtPath.Text = "";                zIO.Close();                xsession.DeleteFile(zPath);                if (comboBox1.SelectedIndex == 0)                {                    toolStripStatusLabel1.Text = "Container built, copy to: Content\\0000000000000000\\C0DE9999\\00007000";                } else{                    toolStripStatusLabel1.Text = "Container built, copy to: Content\\0000000000000000\\C0DE9999\\00080000";                }            }        }        private void imgDash_Click(object sender, EventArgs e)        {            DJsIO xIO = new DJsIO(DJFileMode.Open, "Open a PNG", "PNG File|*.png", EndianType.BigEndian);            if (!xIO.Accessed)                return;            if (xIO.Length > 0x4000)            {                MessageBox.Show("Error: Image is too big");                return;            }            byte[] x = xIO.ReadStream();            try { Image y = x.BytesToImage(); imgDash.Image = y; }            catch (Exception z) { MessageBox.Show(z.Message); return; }            xsession.HeaderData.PackageImageBinary = x;            xsession.HeaderData.ContentImageBinary = x;        }        private void txtPath_Leave(object sender, EventArgs e)        {            using (StreamWriter config = new StreamWriter(processDir + "\\xbox\\config.ini"))            {                config.WriteLine(txtPath.Text);            }        }        private void imgDash_LoadCompleted(object sender, AsyncCompletedEventArgs e)
       {
           imageUpdated = true;
       }
   }
}

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant