Пример #1
0
        public PUPFile(X360IO IO)
        {
            InitializeComponent();
            Package = new PlaystationUpdatePackage();
            Package.Load(IO);
            lblPkgVersion.Text = string.Format("Update Package Version: 0x{0:X2}", Package.Version);
            lblImgVersion.Text = string.Format("Image Version: 0x{0:X2}", Package.ImageVersion);
            lblFileCount.Text  = string.Format("File Count: {0}", Package.FileCount);
            lblHeaderSize.Text = string.Format("Header Size: 0x{0:X2}", Package.HeaderSize);
            lblDataSize.Text   = string.Format("Data Size: 0x{0:X2}", Package.DataSize);
            txtHeaderHash.Text = Program.BytesToHexString(Package.HeaderHash);
            txtPadding.Text    = Program.BytesToHexString(Package.Padding);
            PlaystationUpdatePackage.FileEntry versionentry = Package.Files.Find(sec => sec.ID == 0x100);
            if (versionentry != null)
            {
                byte[] data    = Package.GetFileData(versionentry);
                string version = Encoding.ASCII.GetString(data);
                lblVersion.Text = "Version: " + version;
            }
            else
            {
                lblVersion.Text = "Version: N/A";
            }

            foreach (PlaystationUpdatePackage.FileEntry entry in Package.Files)
            {
                ListViewItem item     = new ListViewItem(entry.ID.ToString("X2"));
                string       filename = (string)PlaystationUpdatePackage.FileNames[entry.ID];
                if (String.IsNullOrEmpty(filename))
                {
                    filename = string.Format("file_{0:X2}.tar", entry.ID);
                }
                item.SubItems.Add(filename);
                item.SubItems.Add(entry.Size.ToString());
                item.SubItems.Add(entry.Offset.ToString());
                item.SubItems.Add(Program.BytesToHexString(entry.Hash.HMACSHA1));
                item.Tag = entry;
                lvFiles.Items.Add(item);
            }
            tsmiExtractAll.Enabled = true;
        }
Пример #2
0
        public PUPFile(X360IO IO)
        {
            InitializeComponent();
            Package = new PlaystationUpdatePackage();
            Package.Load(IO);
            lblPkgVersion.Text = string.Format("Update Package Version: 0x{0:X2}", Package.Version);
            lblImgVersion.Text = string.Format("Image Version: 0x{0:X2}", Package.ImageVersion);
            lblFileCount.Text = string.Format("File Count: {0}", Package.FileCount);
            lblHeaderSize.Text = string.Format("Header Size: 0x{0:X2}", Package.HeaderSize);
            lblDataSize.Text = string.Format("Data Size: 0x{0:X2}", Package.DataSize);
            txtHeaderHash.Text = Program.BytesToHexString(Package.HeaderHash);
            txtPadding.Text = Program.BytesToHexString(Package.Padding);
            PlaystationUpdatePackage.FileEntry versionentry = Package.Files.Find(sec => sec.ID == 0x100);
            if(versionentry != null)
            {
                byte[] data = Package.GetFileData(versionentry);
                string version = Encoding.ASCII.GetString(data);
                lblVersion.Text = "Version: " + version;
            }
            else
                lblVersion.Text = "Version: N/A";

            foreach(PlaystationUpdatePackage.FileEntry entry in Package.Files)
            {
                ListViewItem item = new ListViewItem(entry.ID.ToString("X2"));
                string filename = (string) PlaystationUpdatePackage.FileNames[entry.ID];
                if (String.IsNullOrEmpty(filename))
                    filename = string.Format("file_{0:X2}.tar", entry.ID);
                item.SubItems.Add(filename);
                item.SubItems.Add(entry.Size.ToString());
                item.SubItems.Add(entry.Offset.ToString());
                item.SubItems.Add(Program.BytesToHexString(entry.Hash.HMACSHA1));
                item.Tag = entry;
                lvFiles.Items.Add(item);
            }
            tsmiExtractAll.Enabled = true;
        }