Start work on POPS.

This commit is contained in:
Bluzume 2020-08-24 04:29:07 +12:00 committed by GitHub
parent 148152705d
commit 927ebb3e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 2490 additions and 361 deletions

View File

@ -1,140 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CHOVY</RootNamespace>
<AssemblyName>CHOVY-SIGN</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="DiscUtils, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Discutils.0.11.0.2\lib\net40\DiscUtils.dll</HintPath>
</Reference>
<Reference Include="DiscUtils.Common, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Discutils.0.11.0.2\lib\net40\DiscUtils.Common.dll</HintPath>
</Reference>
<Reference Include="DotNetZip, Version=1.13.4.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CHOVY.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CHOVY.Designer.cs">
<DependentUpon>CHOVY.cs</DependentUpon>
</Compile>
<Compile Include="CHOVYCmaSelector.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CHOVYCmaSelector.Designer.cs">
<DependentUpon>CHOVYCmaSelector.cs</DependentUpon>
</Compile>
<Compile Include="cmakeys.cs" />
<Compile Include="param.cs" />
<Compile Include="pbp.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PSVIMGBuilder.cs" />
<Compile Include="PSVIMGFileStream.cs" />
<Compile Include="PSVIMGStream.cs" />
<Compile Include="PSVIMGStructs.cs" />
<Compile Include="PSVMDBuilder.cs" />
<EmbeddedResource Include="CHOVY.resx">
<DependentUpon>CHOVY.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CHOVYCmaSelector.resx">
<DependentUpon>CHOVYCmaSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\idkbackground.gif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\umd.gif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Murica.wav" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\MINIS.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ChovyLogo.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CHOVY</RootNamespace>
<AssemblyName>CHOVY-SIGN</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="DiscUtils, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Discutils.0.11.0.2\lib\net40\DiscUtils.dll</HintPath>
</Reference>
<Reference Include="DiscUtils.Common, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Discutils.0.11.0.2\lib\net40\DiscUtils.Common.dll</HintPath>
</Reference>
<Reference Include="DotNetZip, Version=1.13.4.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CHOVY.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CHOVY.Designer.cs">
<DependentUpon>CHOVY.cs</DependentUpon>
</Compile>
<Compile Include="CHOVYCmaSelector.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CHOVYCmaSelector.Designer.cs">
<DependentUpon>CHOVYCmaSelector.cs</DependentUpon>
</Compile>
<Compile Include="CHOVYPopsBuilder.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CHOVYPopsBuilder.Designer.cs">
<DependentUpon>CHOVYPopsBuilder.cs</DependentUpon>
</Compile>
<Compile Include="cmakeys.cs" />
<Compile Include="param.cs" />
<Compile Include="pbp.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PSVIMGBuilder.cs" />
<Compile Include="PSVIMGFileStream.cs" />
<Compile Include="PSVIMGStream.cs" />
<Compile Include="PSVIMGStructs.cs" />
<Compile Include="PSVMDBuilder.cs" />
<EmbeddedResource Include="CHOVY.resx">
<DependentUpon>CHOVY.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CHOVYCmaSelector.resx">
<DependentUpon>CHOVYCmaSelector.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CHOVYPopsBuilder.resx">
<DependentUpon>CHOVYPopsBuilder.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\idkbackground.gif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\umd.gif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Murica.wav" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\MINIS.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ChovyLogo.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
<None Include="Resources\PopsDefaultIcon.png" />
<None Include="Resources\does_not_protect_from_illegal_copies.gif" />
<None Include="Resources\ps1.gif" />
<None Include="Resources\POPS.wav" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,5 +1,6 @@
using CHOVY.Properties;
using DiscUtils.Iso9660;
using Ionic.Zlib;
using Microsoft.Win32;
using Param_SFO;
using PSVIMGTOOLS;
@ -120,8 +121,7 @@ namespace CHOVY
}
private void CHOVY_Load(object sender, EventArgs e)
{
if(ReadSetting("MuteAudio") == "1")
if (ReadSetting("MuteAudio") == "1")
{
MutedAudio = true;
}
@ -145,10 +145,21 @@ namespace CHOVY
this.FREEDOM.Enabled = true;
};
bool isZrif = false;
if(RifPath.Text == "" || !File.Exists(RifPath.Text))
{
MessageBox.Show("INVALID RIF PATH!\nPlease try \"Find from CMA\"", "RIF ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
// Check if valid 'zRIF'
try
{
ZlibStream.UncompressBuffer(Convert.FromBase64String(RifPath.Text));
isZrif = true;
}
catch(Exception)
{
MessageBox.Show("INVALID RIF!\nPlease try \"Find from CMA\"", "RIF ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
if(Versionkey.Text.Length != 32)
{
@ -184,12 +195,16 @@ namespace CHOVY
//Read RIF data
byte[] ContentId = new byte[0x24];
byte[] RifAid = new byte[0x08];
FileStream rif = File.OpenRead(RifPath.Text);
Stream rif = null;
if (!isZrif)
rif = File.OpenRead(RifPath.Text);
else
rif = new MemoryStream(ZlibStream.UncompressBuffer(Convert.FromBase64String(RifPath.Text)));
rif.Seek(0x10, SeekOrigin.Begin);
rif.Read(ContentId, 0x00, 0x24);
rif.Seek(0x08, SeekOrigin.Begin);
rif.Read(RifAid, 0x00, 0x08);
rif.Close();
string ContentID = Encoding.UTF8.GetString(ContentId);
@ -329,8 +344,19 @@ namespace CHOVY
Directory.CreateDirectory(BackupDir);
FileStream licensePsvimg = File.OpenWrite(psvimgFilepath);
licensePsvimg.SetLength(0);
builder = new PSVIMGBuilder(licensePsvimg, CmaKey);
builder.AddFile(RifPath.Text, "ux0:pspemu/temp/game/PSP/LICENSE", "/"+ContentID + ".rif");
if (!isZrif)
{
builder.AddFile(RifPath.Text, "ux0:pspemu/temp/game/PSP/LICENSE", "/" + ContentID + ".rif");
}
else
{
rif.Seek(0x00, SeekOrigin.Begin);
builder.AddFileFromStream(rif, "ux0:pspemu/temp/game/PSP/LICENSE", "/" + ContentID + ".rif");
}
rif.Close();
ContentSize = builder.Finish();
licensePsvimg = File.OpenRead(psvimgFilepath);
@ -471,13 +497,16 @@ namespace CHOVY
string ContentID = pbp.GetContentId(EbootPbp);
PSVIMGFileStream LicenseRif = new PSVIMGFileStream(LicensePsvimg, "/"+ ContentID+ ".rif");
LicenseRif.WriteToFile(Rif);
byte[] LicenseRifBytes = new byte[LicenseRif.Length];
LicenseRif.Read(LicenseRifBytes, 0x00, LicenseRifBytes.Length);
LicenseRif.Close();
LicensePsvimg.Close();
EbootPbp.Close();
GamePsvimg.Close();
byte[] zRifBytes = ZlibStream.CompressBuffer(LicenseRifBytes);
Rif = Convert.ToBase64String(zRifBytes);
WriteSetting("RifPath", Rif);
Versionkey.Text = VerKey;
@ -531,5 +560,26 @@ namespace CHOVY
MessageBox.Show("Enabled Retail Aid,\nAid From RIF Will be used for CMA Backups.", "Dex Aid", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void Ps1Menu_Click(object sender, EventArgs e)
{
if (!MutedAudio)
{
Stream str = Resources.POPS;
SoundPlayer snd = new SoundPlayer(str);
snd.Play();
}
CHOVYPopsBuilder pops = new CHOVYPopsBuilder();
this.Hide();
pops.Show();
pops.FormClosing += Pops_FormClosing;
}
private void Pops_FormClosing(object sender, FormClosingEventArgs e)
{
this.Show();
}
}
}

View File

@ -7,6 +7,7 @@ namespace CHOVY
{
public partial class CHOVYCmaSelector : Form
{
public bool PSGame = false;
public CHOVYCmaSelector(string CMA = "", string AID = "")
{
InitializeComponent();
@ -58,12 +59,16 @@ namespace CHOVY
{
string CmaDir = CMADir.Text;
string Aid = AIDSelector.Text;
string BackupuPath = Path.Combine(CmaDir, "PGAME", Aid);
foreach (string Dir in Directory.GetDirectories(BackupuPath))
string BackupPath;
if(!PSGame)
BackupPath = Path.Combine(CmaDir, "PGAME", Aid);
else
BackupPath = Path.Combine(CmaDir, "PSGAME", Aid);
foreach (string Dir in Directory.GetDirectories(BackupPath))
{
try
{
string SfoPath = Path.Combine(BackupuPath, Dir, "sce_sys", "param.sfo");
string SfoPath = Path.Combine(BackupPath, Dir, "sce_sys", "param.sfo");
FileStream SfoStream = File.OpenRead(SfoPath);
PARAM_SFO sfo = new PARAM_SFO(SfoStream);
string Title = sfo.Title;

562
CHOVY/CHOVYPopsBuilder.Designer.cs generated Normal file
View File

@ -0,0 +1,562 @@
namespace CHOVY
{
partial class CHOVYPopsBuilder
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.Disc4Path = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.browseDisc3 = new System.Windows.Forms.Button();
this.Disc3Path = new System.Windows.Forms.TextBox();
this.browseDisc2 = new System.Windows.Forms.Button();
this.Disc2Path = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.browseDisc1 = new System.Windows.Forms.Button();
this.Disc1Path = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.browseDisc4 = new System.Windows.Forms.Button();
this.Disc5Path = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.browseDisc5 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.RifPath = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.Versionkey = new System.Windows.Forms.TextBox();
this.FindFromCMA = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.gameTitle = new System.Windows.Forms.TextBox();
this.browseIcon = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.BubbleIcon = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.ProgressStatus = new System.Windows.Forms.Label();
this.FREEDOM = new System.Windows.Forms.Button();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.BubbleIcon)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.browseDisc5);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.Disc5Path);
this.groupBox1.Controls.Add(this.browseDisc4);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.Disc4Path);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.browseDisc3);
this.groupBox1.Controls.Add(this.Disc3Path);
this.groupBox1.Controls.Add(this.browseDisc2);
this.groupBox1.Controls.Add(this.Disc2Path);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.browseDisc1);
this.groupBox1.Controls.Add(this.pictureBox1);
this.groupBox1.Controls.Add(this.Disc1Path);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.ForeColor = System.Drawing.Color.Lime;
this.groupBox1.Location = new System.Drawing.Point(317, 87);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(542, 252);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "The PS1 Game.";
//
// Disc4Path
//
this.Disc4Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Disc4Path.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Disc4Path.Enabled = false;
this.Disc4Path.ForeColor = System.Drawing.Color.Lime;
this.Disc4Path.Location = new System.Drawing.Point(115, 162);
this.Disc4Path.Name = "Disc4Path";
this.Disc4Path.Size = new System.Drawing.Size(342, 20);
this.Disc4Path.TabIndex = 20;
this.Disc4Path.TextChanged += new System.EventHandler(this.Disc4Path_TextChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(112, 105);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 13);
this.label3.TabIndex = 19;
this.label3.Text = "Disc #3:";
//
// browseDisc3
//
this.browseDisc3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseDisc3.ForeColor = System.Drawing.Color.Lime;
this.browseDisc3.Location = new System.Drawing.Point(463, 123);
this.browseDisc3.Name = "browseDisc3";
this.browseDisc3.Size = new System.Drawing.Size(60, 22);
this.browseDisc3.TabIndex = 18;
this.browseDisc3.Text = "Browse";
this.browseDisc3.UseVisualStyleBackColor = true;
this.browseDisc3.EnabledChanged += new System.EventHandler(this.browseDisc3_EnabledChanged);
//
// Disc3Path
//
this.Disc3Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Disc3Path.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Disc3Path.Enabled = false;
this.Disc3Path.ForeColor = System.Drawing.Color.Lime;
this.Disc3Path.Location = new System.Drawing.Point(115, 123);
this.Disc3Path.Name = "Disc3Path";
this.Disc3Path.Size = new System.Drawing.Size(342, 20);
this.Disc3Path.TabIndex = 17;
this.Disc3Path.TextChanged += new System.EventHandler(this.Disc3Path_TextChanged);
//
// browseDisc2
//
this.browseDisc2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseDisc2.ForeColor = System.Drawing.Color.Lime;
this.browseDisc2.Location = new System.Drawing.Point(463, 82);
this.browseDisc2.Name = "browseDisc2";
this.browseDisc2.Size = new System.Drawing.Size(60, 22);
this.browseDisc2.TabIndex = 16;
this.browseDisc2.Text = "Browse";
this.browseDisc2.UseVisualStyleBackColor = true;
this.browseDisc2.EnabledChanged += new System.EventHandler(this.browseDisc2_EnabledChanged);
//
// Disc2Path
//
this.Disc2Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Disc2Path.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Disc2Path.Enabled = false;
this.Disc2Path.ForeColor = System.Drawing.Color.Lime;
this.Disc2Path.Location = new System.Drawing.Point(115, 82);
this.Disc2Path.Name = "Disc2Path";
this.Disc2Path.Size = new System.Drawing.Size(342, 20);
this.Disc2Path.TabIndex = 15;
this.Disc2Path.TextChanged += new System.EventHandler(this.Disc2Path_TextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(112, 66);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 13);
this.label2.TabIndex = 14;
this.label2.Text = "Disc #2:";
//
// browseDisc1
//
this.browseDisc1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseDisc1.ForeColor = System.Drawing.Color.Lime;
this.browseDisc1.Location = new System.Drawing.Point(463, 43);
this.browseDisc1.Name = "browseDisc1";
this.browseDisc1.Size = new System.Drawing.Size(60, 22);
this.browseDisc1.TabIndex = 13;
this.browseDisc1.Text = "Browse";
this.browseDisc1.UseVisualStyleBackColor = true;
this.browseDisc1.EnabledChanged += new System.EventHandler(this.browseDisc1_EnabledChanged);
//
// Disc1Path
//
this.Disc1Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Disc1Path.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Disc1Path.ForeColor = System.Drawing.Color.Lime;
this.Disc1Path.Location = new System.Drawing.Point(115, 43);
this.Disc1Path.Name = "Disc1Path";
this.Disc1Path.Size = new System.Drawing.Size(342, 20);
this.Disc1Path.TabIndex = 7;
this.Disc1Path.TextChanged += new System.EventHandler(this.Disc1Path_TextChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(112, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Disc #1:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(112, 146);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 13);
this.label4.TabIndex = 21;
this.label4.Text = "Disc #4:";
//
// browseDisc4
//
this.browseDisc4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseDisc4.ForeColor = System.Drawing.Color.Lime;
this.browseDisc4.Location = new System.Drawing.Point(463, 162);
this.browseDisc4.Name = "browseDisc4";
this.browseDisc4.Size = new System.Drawing.Size(60, 22);
this.browseDisc4.TabIndex = 22;
this.browseDisc4.Text = "Browse";
this.browseDisc4.UseVisualStyleBackColor = true;
this.browseDisc4.EnabledChanged += new System.EventHandler(this.browseDisc4_EnabledChanged);
//
// Disc5Path
//
this.Disc5Path.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Disc5Path.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Disc5Path.Enabled = false;
this.Disc5Path.ForeColor = System.Drawing.Color.Lime;
this.Disc5Path.Location = new System.Drawing.Point(115, 201);
this.Disc5Path.Name = "Disc5Path";
this.Disc5Path.Size = new System.Drawing.Size(342, 20);
this.Disc5Path.TabIndex = 23;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(112, 185);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(47, 13);
this.label5.TabIndex = 24;
this.label5.Text = "Disc #5:";
//
// browseDisc5
//
this.browseDisc5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseDisc5.ForeColor = System.Drawing.Color.Lime;
this.browseDisc5.Location = new System.Drawing.Point(463, 198);
this.browseDisc5.Name = "browseDisc5";
this.browseDisc5.Size = new System.Drawing.Size(60, 22);
this.browseDisc5.TabIndex = 25;
this.browseDisc5.Text = "Browse";
this.browseDisc5.UseVisualStyleBackColor = true;
this.browseDisc5.EnabledChanged += new System.EventHandler(this.browseDisc5_EnabledChanged);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 233);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(107, 13);
this.label6.TabIndex = 26;
this.label6.Text = "Bin/Cue Disc Images";
//
// label7
//
this.label7.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
this.label7.AutoSize = true;
this.label7.ForeColor = System.Drawing.Color.Lime;
this.label7.Location = new System.Drawing.Point(6, 21);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(27, 13);
this.label7.TabIndex = 2;
this.label7.Text = "RIF:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.FindFromCMA);
this.groupBox2.Controls.Add(this.Versionkey);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.RifPath);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.ForeColor = System.Drawing.Color.Lime;
this.groupBox2.Location = new System.Drawing.Point(239, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(694, 54);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Keys to the Kingdom";
//
// RifPath
//
this.RifPath.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.RifPath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.RifPath.ForeColor = System.Drawing.Color.Lime;
this.RifPath.Location = new System.Drawing.Point(39, 19);
this.RifPath.Name = "RifPath";
this.RifPath.Size = new System.Drawing.Size(225, 20);
this.RifPath.TabIndex = 3;
//
// label8
//
this.label8.AccessibleRole = System.Windows.Forms.AccessibleRole.None;
this.label8.AutoSize = true;
this.label8.ForeColor = System.Drawing.Color.Lime;
this.label8.Location = new System.Drawing.Point(270, 21);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(63, 13);
this.label8.TabIndex = 4;
this.label8.Text = "VersionKey:";
//
// Versionkey
//
this.Versionkey.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Versionkey.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Versionkey.ForeColor = System.Drawing.Color.Lime;
this.Versionkey.Location = new System.Drawing.Point(338, 19);
this.Versionkey.Name = "Versionkey";
this.Versionkey.Size = new System.Drawing.Size(225, 20);
this.Versionkey.TabIndex = 5;
//
// FindFromCMA
//
this.FindFromCMA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.FindFromCMA.ForeColor = System.Drawing.Color.Lime;
this.FindFromCMA.Location = new System.Drawing.Point(569, 16);
this.FindFromCMA.Name = "FindFromCMA";
this.FindFromCMA.Size = new System.Drawing.Size(109, 23);
this.FindFromCMA.TabIndex = 6;
this.FindFromCMA.Text = "Find from CMA";
this.FindFromCMA.UseVisualStyleBackColor = true;
this.FindFromCMA.Click += new System.EventHandler(this.FindFromCMA_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.label10);
this.groupBox3.Controls.Add(this.textBox1);
this.groupBox3.Controls.Add(this.label9);
this.groupBox3.Controls.Add(this.browseIcon);
this.groupBox3.Controls.Add(this.gameTitle);
this.groupBox3.Controls.Add(this.BubbleIcon);
this.groupBox3.ForeColor = System.Drawing.Color.Lime;
this.groupBox3.Location = new System.Drawing.Point(260, 358);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(645, 161);
this.groupBox3.TabIndex = 4;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Bubble Info";
//
// gameTitle
//
this.gameTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.gameTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.gameTitle.ForeColor = System.Drawing.Color.Lime;
this.gameTitle.Location = new System.Drawing.Point(114, 37);
this.gameTitle.MaxLength = 80;
this.gameTitle.Multiline = true;
this.gameTitle.Name = "gameTitle";
this.gameTitle.Size = new System.Drawing.Size(516, 64);
this.gameTitle.TabIndex = 8;
this.gameTitle.Text = "Epic PS1 Game!";
//
// browseIcon
//
this.browseIcon.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.browseIcon.ForeColor = System.Drawing.Color.Lime;
this.browseIcon.Location = new System.Drawing.Point(570, 120);
this.browseIcon.Name = "browseIcon";
this.browseIcon.Size = new System.Drawing.Size(60, 22);
this.browseIcon.TabIndex = 26;
this.browseIcon.Text = "Browse";
this.browseIcon.UseVisualStyleBackColor = true;
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(114, 21);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(30, 13);
this.label9.TabIndex = 27;
this.label9.Text = "Title:";
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBox1.ForeColor = System.Drawing.Color.Lime;
this.textBox1.Location = new System.Drawing.Point(114, 120);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(450, 20);
this.textBox1.TabIndex = 28;
this.textBox1.Text = "(none)";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(114, 104);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(105, 13);
this.label10.TabIndex = 29;
this.label10.Text = "Bubble Icon (80x80):";
//
// BubbleIcon
//
this.BubbleIcon.BackgroundImage = global::CHOVY.Properties.Resources.PopsDefaultIcon;
this.BubbleIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.BubbleIcon.Location = new System.Drawing.Point(16, 37);
this.BubbleIcon.Name = "BubbleIcon";
this.BubbleIcon.Size = new System.Drawing.Size(80, 80);
this.BubbleIcon.TabIndex = 0;
this.BubbleIcon.TabStop = false;
//
// pictureBox2
//
this.pictureBox2.Location = new System.Drawing.Point(12, 3);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(204, 602);
this.pictureBox2.TabIndex = 1;
this.pictureBox2.TabStop = false;
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = global::CHOVY.Properties.Resources.does_not_protect_from_illegal_copies;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBox1.Location = new System.Drawing.Point(7, 79);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(103, 103);
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(260, 553);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(564, 23);
this.progressBar1.TabIndex = 5;
//
// ProgressStatus
//
this.ProgressStatus.AutoSize = true;
this.ProgressStatus.ForeColor = System.Drawing.Color.Lime;
this.ProgressStatus.Location = new System.Drawing.Point(257, 537);
this.ProgressStatus.Name = "ProgressStatus";
this.ProgressStatus.Size = new System.Drawing.Size(59, 13);
this.ProgressStatus.TabIndex = 6;
this.ProgressStatus.Text = "Progress %";
//
// FREEDOM
//
this.FREEDOM.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.FREEDOM.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.FREEDOM.Location = new System.Drawing.Point(830, 553);
this.FREEDOM.Name = "FREEDOM";
this.FREEDOM.Size = new System.Drawing.Size(75, 23);
this.FREEDOM.TabIndex = 16;
this.FREEDOM.Text = "FREEDOM";
this.FREEDOM.UseVisualStyleBackColor = true;
this.FREEDOM.EnabledChanged += new System.EventHandler(this.FREEDOM_EnabledChanged);
//
// label11
//
this.label11.AutoSize = true;
this.label11.ForeColor = System.Drawing.Color.Lime;
this.label11.Location = new System.Drawing.Point(835, 595);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(113, 13);
this.label11.TabIndex = 17;
this.label11.Text = "SilicaAndPina, dots_tb";
//
// label12
//
this.label12.AutoSize = true;
this.label12.ForeColor = System.Drawing.Color.Lime;
this.label12.Location = new System.Drawing.Point(222, 595);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(123, 13);
this.label12.TabIndex = 18;
this.label12.Text = "Made possible by CBPS.";
//
// CHOVYPopsBuilder
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(960, 617);
this.Controls.Add(this.label12);
this.Controls.Add(this.label11);
this.Controls.Add(this.FREEDOM);
this.Controls.Add(this.ProgressStatus);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.groupBox1);
this.Name = "CHOVYPopsBuilder";
this.Text = "CHOVY-POPS-SIGN";
this.Load += new System.EventHandler(this.CHOVYPopsBuilder_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.BubbleIcon)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox Disc1Path;
private System.Windows.Forms.TextBox Disc4Path;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button browseDisc3;
private System.Windows.Forms.TextBox Disc3Path;
private System.Windows.Forms.Button browseDisc2;
private System.Windows.Forms.TextBox Disc2Path;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button browseDisc1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button browseDisc5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox Disc5Path;
private System.Windows.Forms.Button browseDisc4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox Versionkey;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox RifPath;
private System.Windows.Forms.Button FindFromCMA;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.PictureBox BubbleIcon;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button browseIcon;
private System.Windows.Forms.TextBox gameTitle;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label ProgressStatus;
private System.Windows.Forms.Button FREEDOM;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
}
}

299
CHOVY/CHOVYPopsBuilder.cs Normal file
View File

@ -0,0 +1,299 @@
using Ionic.Zlib;
using Microsoft.Win32;
using PSVIMGTOOLS;
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace CHOVY
{
public partial class CHOVYPopsBuilder : Form
{
public CHOVYPopsBuilder()
{
InitializeComponent();
}
public string ReadSetting(string Setting)
{
string Value = "";
try
{
RegistryKey key;
key = Registry.CurrentUser.CreateSubKey(@"Software\CHOVYProject\Chovy-Pops-Sign");
Value = key.GetValue(Setting).ToString();
key.Close();
}
catch (Exception) { return ""; }
return Value;
}
public void WriteSetting(string Setting, string Value)
{
try
{
RegistryKey key;
key = Registry.CurrentUser.CreateSubKey(@"Software\CHOVYProject\Chovy-Pops-Sign");
key.SetValue(Setting, Value);
key.Close();
}
catch (Exception) { }
}
private void Disc1Path_TextChanged(object sender, EventArgs e)
{
if(Disc1Path.Text != "")
{
Disc2Path.Enabled = true;
browseDisc2.Enabled = true;
}
else
{
Disc2Path.Text = "";
Disc2Path.Enabled = false;
browseDisc2.Enabled = false;
}
}
private void Disc2Path_TextChanged(object sender, EventArgs e)
{
if (Disc2Path.Text != "")
{
Disc3Path.Enabled = true;
browseDisc3.Enabled = true;
}
else
{
Disc3Path.Text = "";
Disc3Path.Enabled = false;
browseDisc3.Enabled = false;
}
}
private void Disc3Path_TextChanged(object sender, EventArgs e)
{
if (Disc3Path.Text != "")
{
Disc4Path.Enabled = true;
browseDisc4.Enabled = true;
}
else
{
Disc4Path.Text = "";
Disc4Path.Enabled = false;
browseDisc4.Enabled = false;
}
}
private void Disc4Path_TextChanged(object sender, EventArgs e)
{
if (Disc4Path.Text != "")
{
Disc5Path.Enabled = true;
browseDisc5.Enabled = true;
}
else
{
Disc5Path.Text = "";
Disc5Path.Enabled = false;
browseDisc5.Enabled = false;
}
}
private void FindFromCMA_Click(object sender, EventArgs e)
{
this.Hide();
string cmaDir = "";
string accountId = "0000000000000000";
try
{
//try qcma
cmaDir = Registry.CurrentUser.OpenSubKey(@"Software\codestation\qcma").GetValue("appsPath").ToString();
accountId = Registry.CurrentUser.OpenSubKey(@"Software\codestation\qcma").GetValue("lastAccountId").ToString();
}
catch (Exception)
{
try
{
//try sony cma
cmaDir = Registry.CurrentUser.OpenSubKey(@"Software\Sony Corporation\Content Manager Assistant\Settings").GetValue("ApplicationHomePath").ToString();
}
catch (Exception)
{
try
{
//try devkit cma
cmaDir = Registry.CurrentUser.OpenSubKey(@"Software\SCE\PSP2\Services\Content Manager Assistant for PlayStation(R)Vita DevKit\Settings").GetValue("ApplicationHomePath").ToString();
}
catch (Exception)
{
try
{
string DefaultDir = Path.Combine(Environment.GetEnvironmentVariable("HOMEDRIVE"), Environment.GetEnvironmentVariable("HOMEPATH"), "Documents", "PS Vita");
if (Directory.Exists(DefaultDir))
{
cmaDir = DefaultDir;
}
}
catch (Exception)
{
//Do nothing
}
}
}
}
CHOVYCmaSelector ccs = new CHOVYCmaSelector(cmaDir, accountId);
ccs.PSGame = true;
ccs.FormClosing += Ccs_FormClosing;
ccs.ShowDialog();
}
private void Ccs_FormClosing(object sender, FormClosingEventArgs e)
{
CHOVYCmaSelector ccs = (CHOVYCmaSelector)sender;
string CmaDir = ccs.GetCmaDir();
string CmaAid = ccs.GetCmaAid();
string Backup = ccs.GetSelectedBackup();
WriteSetting("CmaDir", CmaDir);
if (Backup == "")
{
return;
}
string BackupPath = Path.Combine(CmaDir, "PGAME", CmaAid, Backup, "game", "game.psvimg");
if (!File.Exists(BackupPath))
{
MessageBox.Show("Could not find \n" + BackupPath + "\n Perhaps backup failed?", "License Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
ccs.Hide();
this.Show();
this.Focus();
return;
}
byte[] AID = BitConverter.GetBytes(Convert.ToInt64(CmaAid, 16));
Array.Reverse(AID);
byte[] Key = CmaKeys.GenerateKey(AID);
PSVIMGStream GamePsvimg = new PSVIMGStream(File.OpenRead(BackupPath), Key);
BackupPath = Path.Combine(CmaDir, "PGAME", CmaAid, Backup, "license", "license.psvimg");
if (!File.Exists(BackupPath))
{
MessageBox.Show("Could not find \n" + BackupPath + "\n Perhaps backup failed?", "License Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
ccs.Hide();
this.Show();
this.Focus();
return;
}
PSVIMGStream LicensePsvimg = new PSVIMGStream(File.OpenRead(BackupPath), Key);
string Rif = Path.Combine(Application.StartupPath, "GAME.RIF");
PSVIMGFileStream EbootPbp = new PSVIMGFileStream(GamePsvimg, "/EBOOT.PBP");
byte[] VersionKey = pbp.GetVersionKeyPs1(EbootPbp);
string VerKey = BitConverter.ToString(VersionKey).Replace("-", "");
WriteSetting("VersionKey", VerKey);
string ContentID = pbp.GetContentId(EbootPbp);
PSVIMGFileStream LicenseRif = new PSVIMGFileStream(LicensePsvimg, "/" + ContentID + ".rif");
byte[] LicenseRifBytes = new byte[LicenseRif.Length];
LicenseRif.Read(LicenseRifBytes, 0x00, LicenseRifBytes.Length);
LicenseRif.Close();
LicensePsvimg.Close();
EbootPbp.Close();
GamePsvimg.Close();
byte[] zRifBytes = ZlibStream.CompressBuffer(LicenseRifBytes);
Rif = Convert.ToBase64String(zRifBytes);
WriteSetting("RifPath", Rif);
Versionkey.Text = VerKey;
RifPath.Text = Rif;
ccs.Hide();
this.Show();
this.Focus();
MessageBox.Show("KEYS HAVE BEEN EXTRACTED FROM CMA, YOU MAY NOW LIBERATE YOURSELF", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void browseDisc1_EnabledChanged(object sender, EventArgs e)
{
Color green = Color.Lime;
Color black = Color.Black;
bool enabled = this.browseDisc1.Enabled;
this.browseDisc1.ForeColor = enabled ? green : black;
this.browseDisc1.BackColor = enabled ? black : green;
}
private void browseDisc2_EnabledChanged(object sender, EventArgs e)
{
Color green = Color.Lime;
Color black = Color.Black;
bool enabled = this.browseDisc2.Enabled;
this.browseDisc2.ForeColor = enabled ? green : black;
this.browseDisc2.BackColor = enabled ? black : green;
}
private void browseDisc3_EnabledChanged(object sender, EventArgs e)
{
Color green = Color.Lime;
Color black = Color.Black;
bool enabled = this.browseDisc3.Enabled;
this.browseDisc3.ForeColor = enabled ? green : black;
this.browseDisc3.BackColor = enabled ? black : green;
}
private void browseDisc4_EnabledChanged(object sender, EventArgs e)
{
Color green = Color.Lime;
Color black = Color.Black;
bool enabled = this.browseDisc4.Enabled;
this.browseDisc4.ForeColor = enabled ? green : black;
this.browseDisc4.BackColor = enabled ? black : green;
}
private void browseDisc5_EnabledChanged(object sender, EventArgs e)
{
Color green = Color.Lime;
Color black = Color.Black;
bool enabled = this.browseDisc5.Enabled;
this.browseDisc5.ForeColor = enabled ? green : black;
this.browseDisc5.BackColor = enabled ? black : green;
}
private void FREEDOM_EnabledChanged(object sender, EventArgs e)
{
Color red = Color.FromArgb(192, 0, 0);
Color black = Color.Black;
bool enabled = this.FREEDOM.Enabled;
this.FREEDOM.ForeColor = enabled ? red : black;
this.FREEDOM.BackColor = enabled ? black : red;
}
private void CHOVYPopsBuilder_Load(object sender, EventArgs e)
{
Disc1Path.Enabled = true;
browseDisc1.Enabled = true;
Disc2Path.Enabled = false;
browseDisc2.Enabled = false;
Disc3Path.Enabled = false;
browseDisc3.Enabled = false;
Disc4Path.Enabled = false;
browseDisc4.Enabled = false;
Disc5Path.Enabled = false;
browseDisc5.Enabled = false;
}
}
}

120
CHOVY/CHOVYPopsBuilder.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -36,8 +36,6 @@
this.FindFromCMA = new System.Windows.Forms.Button();
this.ISOPath = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.PsmChan = new System.Windows.Forms.PictureBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.BrowseButton = new System.Windows.Forms.Button();
@ -47,19 +45,22 @@
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.CompressPBP = new System.Windows.Forms.CheckBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.label6 = new System.Windows.Forms.Label();
this.Ps1Menu = new System.Windows.Forms.Button();
this.DexAidEnabler = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PsmChan)).BeginInit();
this.PsmChan = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.DexAidEnabler)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PsmChan)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.Chartreuse;
this.label1.ForeColor = System.Drawing.Color.Lime;
this.label1.Location = new System.Drawing.Point(6, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
@ -90,7 +91,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.Chartreuse;
this.label2.ForeColor = System.Drawing.Color.Lime;
this.label2.Location = new System.Drawing.Point(268, 19);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(63, 13);
@ -122,34 +123,13 @@
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.Chartreuse;
this.label3.ForeColor = System.Drawing.Color.Lime;
this.label3.Location = new System.Drawing.Point(74, 38);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(60, 13);
this.label3.TabIndex = 8;
this.label3.Text = "ISO Image:";
//
// pictureBox2
//
this.pictureBox2.BackgroundImage = global::CHOVY.Properties.Resources.UMD;
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBox2.Location = new System.Drawing.Point(15, 31);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(53, 43);
this.pictureBox2.TabIndex = 9;
this.pictureBox2.TabStop = false;
//
// PsmChan
//
this.PsmChan.BackgroundImage = global::CHOVY.Properties.Resources.idkbackground;
this.PsmChan.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.PsmChan.Location = new System.Drawing.Point(3, 3);
this.PsmChan.Name = "PsmChan";
this.PsmChan.Size = new System.Drawing.Size(123, 297);
this.PsmChan.TabIndex = 5;
this.PsmChan.TabStop = false;
this.PsmChan.Click += new System.EventHandler(this.PsmChan_Click);
//
// label4
//
this.label4.AutoSize = true;
@ -257,6 +237,16 @@
this.CompressPBP.Text = "Compress PBP";
this.CompressPBP.UseVisualStyleBackColor = true;
//
// pictureBox2
//
this.pictureBox2.BackgroundImage = global::CHOVY.Properties.Resources.UMD;
this.pictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.pictureBox2.Location = new System.Drawing.Point(15, 31);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(53, 43);
this.pictureBox2.TabIndex = 9;
this.pictureBox2.TabStop = false;
//
// label6
//
this.label6.AutoSize = true;
@ -267,6 +257,19 @@
this.label6.TabIndex = 18;
this.label6.Text = "100% percent free!\r\n";
//
// Ps1Menu
//
this.Ps1Menu.BackgroundImage = global::CHOVY.Properties.Resources.ps1;
this.Ps1Menu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.Ps1Menu.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.Ps1Menu.ForeColor = System.Drawing.Color.Lime;
this.Ps1Menu.Location = new System.Drawing.Point(748, 95);
this.Ps1Menu.Name = "Ps1Menu";
this.Ps1Menu.Size = new System.Drawing.Size(75, 71);
this.Ps1Menu.TabIndex = 20;
this.Ps1Menu.UseVisualStyleBackColor = true;
this.Ps1Menu.Click += new System.EventHandler(this.Ps1Menu_Click);
//
// DexAidEnabler
//
this.DexAidEnabler.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -277,12 +280,24 @@
this.DexAidEnabler.TabStop = false;
this.DexAidEnabler.Click += new System.EventHandler(this.DexAidEnabler_Click);
//
// PsmChan
//
this.PsmChan.BackgroundImage = global::CHOVY.Properties.Resources.idkbackground;
this.PsmChan.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.PsmChan.Location = new System.Drawing.Point(3, 3);
this.PsmChan.Name = "PsmChan";
this.PsmChan.Size = new System.Drawing.Size(123, 297);
this.PsmChan.TabIndex = 5;
this.PsmChan.TabStop = false;
this.PsmChan.Click += new System.EventHandler(this.PsmChan_Click);
//
// CHOVY
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(843, 302);
this.Controls.Add(this.Ps1Menu);
this.Controls.Add(this.DexAidEnabler);
this.Controls.Add(this.label6);
this.Controls.Add(this.groupBox2);
@ -299,13 +314,13 @@
this.Text = "CHOVY-SIGN";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CHOVY_FormClosing);
this.Load += new System.EventHandler(this.CHOVY_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PsmChan)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.DexAidEnabler)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PsmChan)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -333,6 +348,7 @@
private System.Windows.Forms.CheckBox CompressPBP;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.PictureBox DexAidEnabler;
private System.Windows.Forms.Button Ps1Menu;
}
}

View File

@ -262,6 +262,23 @@ namespace PSVIMGTOOLS
byte[] paddingData = new byte[paddingLen];
memset(paddingData, paddingByte, paddingLen);
dst.Write(paddingData, 0x00, paddingData.Length);
}
private byte[] getHeader(SceIoStat stats, string ParentPath, string PathRel)
{
using (MemoryStream Header = new MemoryStream())
{
writeInt64(Header, DateTime.UtcNow.Ticks); // SysTime
writeInt64(Header, 0); // Flags
writeSceIoStat(Header, stats);
writeStringWithPadding(Header, ParentPath, 256); // Parent Path
writeUInt32(Header, 1); //unk_16C
writeStringWithPadding(Header, PathRel, 256); //Relative Path
writePadding(Header, 0x78, 904); //'x'
writeString(Header, PSVIMGConstants.PSVIMG_HEADER_END); //EndOfHeader
Header.Seek(0x00, SeekOrigin.Begin);
return Header.ToArray();
}
}
private byte[] getHeader(string FilePath, string ParentPath, string PathRel)
{
@ -437,6 +454,33 @@ namespace PSVIMGTOOLS
finished = true;
}).Start();
}
public void AddFileFromStream(Stream FileData, string ParentPath, string PathRel)
{
long sz = Convert.ToInt64(FileData.Length);
SceIoStat stats = new SceIoStat();
stats.Mode |= Modes.File;
stats.Size = Convert.ToUInt64(FileData.Length);
stats.Mode |= Modes.GroupRead;
stats.Mode |= Modes.GroupWrite;
stats.Mode |= Modes.OthersRead;
stats.Mode |= Modes.OthersWrite;
stats.Mode |= Modes.UserRead;
stats.Mode |= Modes.UserWrite;
stats.CreationTime = dateTimeToSceDateTime(DateTime.Now);
stats.AccessTime = dateTimeToSceDateTime(DateTime.Now);
stats.ModificaionTime = dateTimeToSceDateTime(DateTime.Now);
writeBlock(getHeader(stats, ParentPath, PathRel));
writeStream(FileData);
writeBlock(getPadding(sz));
writeBlock(getTailer());
contentSize += sz;
}
public void AddFile(string FilePath, string ParentPath, string PathRel)
{

View File

@ -19,7 +19,7 @@ namespace CHOVY.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -70,6 +70,16 @@ namespace CHOVY.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap does_not_protect_from_illegal_copies {
get {
object obj = ResourceManager.GetObject("does_not_protect_from_illegal_copies", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -99,6 +109,35 @@ namespace CHOVY.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream POPS {
get {
return ResourceManager.GetStream("POPS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap PopsDefaultIcon {
get {
object obj = ResourceManager.GetObject("PopsDefaultIcon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ps1 {
get {
object obj = ResourceManager.GetObject("ps1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -118,14 +118,17 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="idkbackground" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\idkbackground.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="does_not_protect_from_illegal_copies" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\does_not_protect_from_illegal_copies.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UMD" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\umd.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Murica" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Murica.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="ps1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ps1.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="POPS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\POPS.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="MINIS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MINIS.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -133,4 +136,13 @@
<data name="ChovyLogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ChovyLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="idkbackground" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\idkbackground.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Murica" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Murica.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="PopsDefaultIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\PopsDefaultIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
CHOVY/Resources/POPS.wav Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
CHOVY/Resources/ps1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,4 +1,6 @@
using PSVIMGTOOLS;
using Org.BouncyCastle.Bcpg.OpenPgp;
using Org.BouncyCastle.Crypto.Paddings;
using PSVIMGTOOLS;
using System;
using System.Diagnostics;
using System.IO;
@ -19,7 +21,7 @@ namespace CHOVY
int pad_size;
}
// PSP
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int kirk_init();
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
@ -27,10 +29,26 @@ namespace CHOVY
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int sceDrmBBMacUpdate(MAC_KEY *mkey, byte[] buf, int size);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int sceDrmBBMacFinal2(MAC_KEY* mkey, byte[] outp, byte[] vkey);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int bbmac_getkey(MAC_KEY *mkey, byte[] bbmac, byte[] vkey);
// PS1
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int process_pgd(byte[] pgd_buf, int pgd_size, int pgd_flag);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int process_pgd_file(string pgd_file);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern byte[] pdg_open(byte[] pgd_buf, int pgd_size, int pgd_flag);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int encrypt_pgd(byte[] data, int data_size, int block_size, int key_index, int drm_type, int flag, byte[] key, byte[] pgd_data);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int decrypt_pgd(byte[] pgd_data, int pgd_size, int flag, byte[] key);
// PSVita
[DllImport("CHOVY.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int chovy_gen(string ebootpbp, UInt64 AID, string outscefile);
public static Process GenPbpFromIso(string ISOPath, string OutputPBP, string ContentId, string VersionKey, bool compress, string bootup="")
{
string SignNpArgs = "-pbp ";
@ -65,6 +83,79 @@ namespace CHOVY
src.Read(intBuf, 0x00, 0x04);
return BitConverter.ToUInt32(intBuf, 0);
}
private static Int32 readInt32(Stream src)
{
byte[] intBuf = new byte[0x4];
src.Read(intBuf, 0x00, 0x04);
return BitConverter.ToInt32(intBuf, 0);
}
public static byte[] DecryptPSISOHeader(Stream pbp)
{
pbp.Seek(0x24, SeekOrigin.Begin);
Int64 PSISOOffset = Convert.ToInt64(readUInt32(pbp));
pbp.Seek(PSISOOffset, SeekOrigin.Begin);
byte[] pgd = new byte[0x100000];
pbp.Seek(0x400, SeekOrigin.Current);
pbp.Read(pgd, 0, pgd.Length);
int fz = process_pgd(pgd, pgd.Length, 2);
if(fz < 0)
{
throw new Exception("Failed to decrypt!");
}
else
{
return pgd;
}
}
public unsafe static byte[] GetVersionKeyPs1(Stream pbp)
{
kirk_init();
pbp.Seek(0x24, SeekOrigin.Begin);
Int64 PSISOOffset = Convert.ToInt64(readUInt32(pbp));
pbp.Seek(PSISOOffset, SeekOrigin.Begin);
pbp.Seek(0x400, SeekOrigin.Current);
pbp.Seek(0x4, SeekOrigin.Current);
int key_index, drm_type;
key_index = readInt32(pbp);
drm_type = readInt32(pbp);
pbp.Seek(PSISOOffset + 0x400, SeekOrigin.Begin);
byte[] pgd_buf = new byte[0x70];
pbp.Read(pgd_buf, 0x00, pgd_buf.Length);
byte[] VER_KEY_ENC = new byte[0x10];
pbp.Read(VER_KEY_ENC, 0x00, VER_KEY_ENC.Length);
MAC_KEY mkey;
byte[] VERSION_KEY = new byte[0x10];
int mac_type;
if (drm_type == 1)
{
mac_type = 1;
if (key_index > 1)
{
mac_type = 3;
}
}
else
{
mac_type = 2;
}
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd_buf, 0x70);
bbmac_getkey(&mkey, VER_KEY_ENC, VERSION_KEY);
return VERSION_KEY;
}
public unsafe static byte[] GetVersionKey(Stream pbp)
{
MAC_KEY mkey;

View File

@ -31,40 +31,40 @@
<ProjectGuid>{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>KIRK</RootNamespace>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='CHOVY|Win32'">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='CHOVY|x64'">
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -162,8 +162,12 @@
<ClCompile Include="amctrl.c" />
<ClCompile Include="bn.c" />
<ClCompile Include="crypto.c" />
<ClCompile Include="dnas.c" />
<ClCompile Include="ec.c" />
<ClCompile Include="edata.c" />
<ClCompile Include="kirk_engine.c" />
<ClCompile Include="pgd.c" />
<ClCompile Include="utils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="amctrl.h" />
@ -171,6 +175,7 @@
<ClInclude Include="ecdsa.h" />
<ClInclude Include="kirk_engine.h" />
<ClInclude Include="psp_headers.h" />
<ClInclude Include="utils.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -33,6 +33,18 @@
<ClCompile Include="kirk_engine.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="edata.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pgd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dnas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="utils.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="kirk_engine.h">
@ -50,5 +62,8 @@
<ClInclude Include="psp_headers.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="utils.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -322,7 +322,7 @@ __declspec(dllexport) int sceDrmBBMacFinal2(MAC_KEY *mkey, u8 *out, u8 *vkey)
memcpy(kirk_buf, out, 0x10);
}
retv = 0;
retv = 0;
for(i=0; i<0x10; i++){
if(kirk_buf[i]!=tmp[i]){
retv = 0x80510300;

182
KIRK/dnas.c Normal file
View File

@ -0,0 +1,182 @@
/*
* dnas.c -- Reverse engineering of iofilemgr_dnas.prx
* written by tpu.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kirk_engine.h"
#include "crypto.h"
#include "psp_headers.h"
#include "amctrl.h"
/*************************************************************/
typedef struct {
unsigned __int8 key[16]; // 00: used to decrypt data content.
unsigned __int32 version; // 10: always 00
unsigned __int32 data_size; // 14
unsigned __int32 block_size; // 18
unsigned __int32 data_offset; // 1C
unsigned __int8 unk_20[16];
}PGD_DESC;
typedef struct {
PGD_DESC pgdesc;
unsigned __int32 key_index; // 0x30
unsigned __int8 pgd_key[16]; // 0x34
unsigned __int32 flag; // 0x44
unsigned __int32 flag_open; // 0x48
unsigned __int32 pgd_offset; // 0x4C
int seek_offset; // 0x50
unsigned __int32 data_offset; // 0x54
unsigned __int32 table_offset;// 0x58
unsigned __int32 unk_5c;
unsigned __int32 unk_60;
}PspIoHookParam;
unsigned __int8 dnas_key1A90[] = {0xED,0xE2,0x5D,0x2D,0xBB,0xF8,0x12,0xE5,0x3C,0x5C,0x59,0x32,0xFA,0xE3,0xE2,0x43};
unsigned __int8 dnas_key1AA0[] = {0x27,0x74,0xFB,0xEB,0xA4,0xA0, 1,0xD7,2,0x56,0x9E,0x33,0x8C,0x19,0x57,0x83};
__declspec(dllexport) int process_pgd(unsigned __int8 *pgd_buf, int pgd_size, int pgd_flag)
{
MAC_KEY mkey;
CIPHER_KEY ckey;
unsigned __int8 *fkey, vkey[16];
int key_index, mac_type, cipher_type, drm_type;
int retv, file_size, block_size, data_offset, table_size, align_size;
key_index = *(unsigned __int32*)(pgd_buf+4);
drm_type = *(unsigned __int32*)(pgd_buf+8);
if(drm_type==1){
mac_type = 1;
pgd_flag |= 4;
if(key_index>1){
mac_type = 3;
pgd_flag |= 8;
}
cipher_type = 1;
}else{
mac_type = 2;
cipher_type = 2;
}
// select fixed key
fkey = NULL;
if(pgd_flag&2)
fkey = dnas_key1A90;
if(pgd_flag&1)
fkey = dnas_key1AA0;
if(fkey==NULL){
printf("invalid pgd_flag! %08x\n", pgd_flag);
return -1;
}
// MAC_0x80 check
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd_buf+0x00, 0x80);
retv = sceDrmBBMacFinal2(&mkey, pgd_buf+0x80, fkey);
if(retv){
printf("MAC_80 check failed!: %08x(%d)\n", retv, retv);
return -2;
}
// MAC_0x70
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd_buf+0x00, 0x70);
bbmac_getkey(&mkey, pgd_buf+0x70, vkey);
hex_dump("Get version_key from MAC_70:", vkey, 16);
// decrypt PGD_DESC
sceDrmBBCipherInit(&ckey, cipher_type, 2, pgd_buf+0x10, vkey, 0);
sceDrmBBCipherUpdate(&ckey, pgd_buf+0x30, 0x30);
sceDrmBBCipherFinal(&ckey);
hex_dump("PGD header", pgd_buf, 0x90);
file_size = *(unsigned __int32*)(pgd_buf+0x44);
block_size = *(unsigned __int32*)(pgd_buf+0x48);
data_offset = *(unsigned __int32*)(pgd_buf+0x4c);
file_size = (file_size+15)&~15;
align_size = (file_size+block_size-1)&~(block_size-1);
table_size = align_size/block_size;
table_size *= 16;
if(file_size+table_size>pgd_size){
printf("invalid pgd data!\n");
return -3;
}
// table MAC check
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd_buf+data_offset+file_size, table_size);
retv = sceDrmBBMacFinal(&mkey, pgd_buf+0x60, vkey);
if(retv){
printf("MAC_table check failed!: %08x(%d)\n", retv, retv);
return -4;
}
// decrypt data
sceDrmBBCipherInit(&ckey, cipher_type, 2, pgd_buf+0x30, vkey, 0);
sceDrmBBCipherUpdate(&ckey, pgd_buf+0x90, file_size);
sceDrmBBCipherFinal(&ckey);
hex_dump("PGD data", pgd_buf+0x90, (file_size>0x100)? 0x100 : file_size);
file_size = *(unsigned __int32*)(pgd_buf+0x44);
return file_size;
}
int decrypt_pgd(unsigned __int8 *pgd_buf, int pgd_size, int pgd_flag, unsigned __int8 *pgd_vkey);
__declspec(dllexport) int process_pgd_file(char *pgd_file)
{
unsigned __int8 *data_buf, *pgd_buf;
char fname[256];
int retv, data_size, pgd_size, pgd_flag;
data_buf = load_file(pgd_file, &data_size);
if(data_buf==NULL){
printf("Open input file <%s> error!\n", pgd_file);
return -1;
}
if(data_size<0x90){
free(data_buf);
return -1;
}
if(*(unsigned __int32*)(data_buf+0)==0x44475000){
pgd_buf = data_buf;
pgd_size = data_size;
}else if(*(unsigned __int32*)(data_buf+0x90)==0x44475000){
pgd_buf = data_buf+0x90;
pgd_size = data_size-0x90;
}else{
free(data_buf);
return -1;
}
printf("\nProcess %s ...\n", pgd_file);
// 0x40xxxxxx : 2
// 0x44xxxxxx : 1
// default as 2
pgd_flag = 2;
retv = decrypt_pgd(pgd_buf, pgd_size, pgd_flag, NULL);
if(retv>0){
sprintf(fname, "%s.decrypt", pgd_file);
write_file(fname, pgd_buf+0x90, retv);
printf("Save %s ...\n", fname);
}
free(data_buf);
return 0;
}

157
KIRK/edata.c Normal file
View File

@ -0,0 +1,157 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kirk_engine.h"
#include "amctrl.h"
#include "crypto.h"
#include "ecdsa.h"
unsigned __int8 pubkey_edat_x[20] = {0x1F,0x07,0x2B,0xCC,0xC1,0x62,0xF2,0xCF,0xAE,0xA0,0xE7,0xF4,0xCD,0xFD,0x9C,0xAE,0xC6,0xC4,0x55,0x21};
unsigned __int8 pubkey_edat_y[20] = {0x53,0x01,0xF4,0xE3,0x70,0xC3,0xED,0xE2,0xD4,0xF5,0xDB,0xC3,0xA7,0xDE,0x8C,0xAA,0xE8,0xAD,0x5B,0x7D};
unsigned __int8 edat_aeskey[16] = {0xBA,0x87,0xE4,0xAB,0x2C,0x60,0x5F,0x59,0xB8,0x3B,0xDB,0xA6,0x82,0xFD,0xAE,0x14};
extern ECDSA_PARAM ecdsa_app;
extern unsigned __int8 priv_key_edata[];
int verbose = 0;
/*************************************************************/
int edata_check_ecdsa(unsigned __int8 *edata_buf)
{
unsigned __int8 sha1_hash[20];
int retv;
printf("EDATA ID: %s\n", (char*)(edata_buf+0x10));
ecdsa_set_curve(&ecdsa_app);
ecdsa_set_pub(pubkey_edat_x, pubkey_edat_y);
SHA1(edata_buf, 0x58, sha1_hash);
retv = ecdsa_verify(sha1_hash, edata_buf+0x58, edata_buf+0x6c);
if(retv==0){
//printf("ECDSA verify passed!\n");
}else{
printf("edata_check_ecdsa: ECDSA verify failed!\n");
}
return retv;
}
int edata_sign_free(unsigned __int8 *edata_buf, unsigned __int8 *pgd_key)
{
MAC_KEY mkey;
AES_ctx aes;
unsigned __int8 sha1_hash[20], license_key[16];
int flag, i;
printf("re-sign EDATA ...\n");
flag = *(unsigned __int8*)(edata_buf+15);
// get license_key
if(flag&1){
sceDrmBBMacInit(&mkey, 3);
sceDrmBBMacUpdate(&mkey, edata_buf, 0x80);
bbmac_getkey(&mkey, edata_buf+0x80, license_key);
if(verbose) hex_dump("license key", license_key, 16);
}
// change to use free license
*(unsigned __int32*)(edata_buf+8) = 0x01000000;
// build ecdsa
ecdsa_set_curve(&ecdsa_app);
ecdsa_set_priv(priv_key_edata);
SHA1(edata_buf, 0x58, sha1_hash);
ecdsa_sign(sha1_hash, edata_buf+0x58, edata_buf+0x6c, NULL);
// build BBMAC
if(flag&1){
sceDrmBBMacInit(&mkey, 3);
sceDrmBBMacUpdate(&mkey, edata_buf, 0x80);
sceDrmBBMacFinal(&mkey, edata_buf+0x80, license_key);
bbmac_build_final2(3, edata_buf+0x80);
}
// build PGD key
sceNpDrmGetFixedKey(pgd_key, (char*)(edata_buf+16), 0x01000000);
if(verbose) hex_dump("get_fixed_key", pgd_key, 16);
if(flag&1){
for(i=0; i<16; i++){
pgd_key[i] ^= license_key[i];
}
}
AES_set_key(&aes, edat_aeskey, 128);
AES_decrypt(&aes, pgd_key, pgd_key);
if(verbose) hex_dump("new PGD key", pgd_key, 16);
return 0;
}
/*************************************************************/
int decrypt_pgd(unsigned __int8 *pgd_buf, int pgd_size, int pgd_flag, unsigned __int8 *pgd_vkey);
int encrypt_pgd(unsigned __int8 *pgd_buf, int pgd_flag, unsigned __int8 *vkey);
int free_edata(char *edata_name)
{
unsigned __int8 *edata_buf;
unsigned __int32 *hd;
unsigned __int8 pgd_key[16];
int retv, edata_size, pgd_offset;
edata_buf = load_file(edata_name, &edata_size);
if(edata_buf==NULL){
printf("Open input file <%s> error!\n", edata_name);
return -1;
}
hd = (unsigned __int32*)edata_buf;
if(hd[0]!=0x50535000 || hd[1]!=0x54414445){
free(edata_buf);
return -1;
}
printf("\nProcess %s ...\n", edata_name);
retv = edata_check_ecdsa(edata_buf);
if(retv)
return retv;
edata_sign_free(edata_buf, pgd_key);
// PGD
pgd_offset = *(unsigned __int32*)(edata_buf+0x0c);
pgd_offset &= 0x00ffffff;
retv = decrypt_pgd(edata_buf+pgd_offset, edata_size-pgd_offset, 2, NULL);
if(retv<0){
printf("pgd_decrypt failed! %08x(%d)\n", retv, retv);
return -1;
}
retv = encrypt_pgd(edata_buf+pgd_offset, 2, pgd_key);
if(retv<0){
printf("pgd_encrypt failed! %08x(%d)\n", retv, retv);
return -1;
}
write_file(edata_name, edata_buf, edata_size);
printf("write %s\n\n", edata_name);
return 0;
}

View File

@ -465,7 +465,7 @@ int sceUtilsBufferCopyWithRange(void* outbuff, int outsize, void* inbuff, int in
break;
case KIRK_CMD_ENCRYPT_IV_0: return kirk_CMD4(outbuff, inbuff, insize); break;
case KIRK_CMD_DECRYPT_IV_0: return kirk_CMD7(outbuff, inbuff, insize); break;
case KIRK_CMD_PRIV_SIG_CHECK: return kirk_CMD10(inbuff, insize); break;
case KIRK_CMD_PRIV_SIGN_CHECK: return kirk_CMD10(inbuff, insize); break;
case KIRK_CMD_SHA1_HASH: return kirk_CMD11(outbuff, inbuff, insize); break;
}
return -1;

View File

@ -54,16 +54,24 @@ typedef struct
u32 data_size; //0
} KIRK_SHA1_HEADER; //4
//mode passed to sceUtilsBufferCopyWithRange
// sceUtilsBufferCopyWithRange modes
#define KIRK_CMD_DECRYPT_PRIVATE 1
#define KIRK_CMD_2 2
#define KIRK_CMD_3 3
#define KIRK_CMD_ENCRYPT_IV_0 4
#define KIRK_CMD_ENCRYPT_IV_FUSE 5
#define KIRK_CMD_ENCRYPT_IV_USER 6
#define KIRK_CMD_DECRYPT_IV_0 7
#define KIRK_CMD_DECRYPT_IV_FUSE 8
#define KIRK_CMD_DECRYPT_IV_USER 9
#define KIRK_CMD_PRIV_SIG_CHECK 10
#define KIRK_CMD_PRIV_SIGN_CHECK 10
#define KIRK_CMD_SHA1_HASH 11
#define KIRK_CMD_ECDSA_GEN_KEYS 12
#define KIRK_CMD_ECDSA_MULTIPLY_POINT 13
#define KIRK_CMD_PRNG 14
#define KIRK_CMD_15 15
#define KIRK_CMD_ECDSA_SIGN 16
#define KIRK_CMD_ECDSA_VERIFY 17
//"mode" in header
#define KIRK_MODE_CMD1 1

295
KIRK/pgd.c Normal file
View File

@ -0,0 +1,295 @@
// Copyright (C) 2013 tpu
// Copyright (C) 2015 Hykem <hykem@hotmail.com>
// Licensed under the terms of the GNU GPL, version 3
// http://www.gnu.org/licenses/gpl-3.0.txt
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kirk_engine.h"
#include "crypto.h"
#include "amctrl.h"
/*************************************************************/
typedef struct {
unsigned char vkey[16];
int open_flag;
int key_index;
int drm_type;
int mac_type;
int cipher_type;
int data_size;
int align_size;
int block_size;
int block_nr;
int data_offset;
int table_offset;
unsigned char* buf;
} PGD_HEADER;
/*
typedef struct {
PGD_DESC pgdesc;
unsigned __int32 key_index; // 0x30
unsigned __int8 pgd_key[16]; // 0x34
unsigned __int32 flag; // 0x44
unsigned __int32 flag_open; // 0x48
unsigned __int32 pgd_offset; // 0x4C
int seek_offset; // 0x50
unsigned __int32 data_offset; // 0x54
unsigned __int32 table_offset;// 0x58
unsigned __int32 unk_5c;
unsigned __int32 unk_60;
}PspIoHookParam;
*/
unsigned __int8 dnas_key1A90_pgd[] = {0xED,0xE2,0x5D,0x2D,0xBB,0xF8,0x12,0xE5,0x3C,0x5C,0x59,0x32,0xFA,0xE3,0xE2,0x43};
unsigned __int8 dnas_key1AA0_pgd[] = {0x27,0x74,0xFB,0xEB,0xA4,0xA0, 1,0xD7, 2,0x56,0x9E,0x33,0x8C,0x19,0x57,0x83};
__declspec(dllexport) int encrypt_pgd(u8* data, int data_size, int block_size, int key_index, int drm_type, int flag, u8* key, u8* pgd_data)
{
MAC_KEY mkey;
CIPHER_KEY ckey;
// Additional size variables.
int data_offset = 0x90;
int align_size = (data_size + 15) & ~15;
int table_offset = data_offset + align_size;
int block_nr = ((align_size + block_size - 1) & ~(block_size - 1)) / block_size;
int pgd_size = 0x90 + align_size + block_nr * 16;
// Build new PGD header.
u8* pgd = (u8*)malloc(pgd_size);
memset(pgd, 0, pgd_size);
memcpy(pgd + data_offset, data, data_size);
// Set magic PGD.
pgd[0] = 0x00;
pgd[1] = 0x50;
pgd[2] = 0x47;
pgd[3] = 0x44;
// Set key index and drm type.
*(u32*)(pgd + 4) = key_index;
*(u32*)(pgd + 8) = drm_type;
// Select the hashing, crypto and open modes.
int mac_type;
int cipher_type;
int open_flag = flag;
if (drm_type == 1)
{
mac_type = 1;
open_flag |= 4;
if (key_index > 1)
{
mac_type = 3;
open_flag |= 8;
}
cipher_type = 1;
}
else
{
mac_type = 2;
cipher_type = 2;
}
// Select the fixed DNAS key.
u8* fkey = NULL;
if ((open_flag & 0x2) == 0x2)
fkey = dnas_key1A90_pgd;
if ((open_flag & 0x1) == 0x1)
fkey = dnas_key1AA0_pgd;
if (fkey == NULL)
{
printf("PGD: Invalid PGD DNAS flag! %08x\n", flag);
return -1;
}
// Set the decryption parameters in the decrypted header.
*(u32*)(pgd + 0x44) = data_size;
*(u32*)(pgd + 0x48) = block_size;
*(u32*)(pgd + 0x4C) = data_offset;
// Generate random header and data keys.
sceUtilsBufferCopyWithRange(pgd + 0x10, 0x30, 0, 0, KIRK_CMD_PRNG);
// Encrypt the data.
sceDrmBBCipherInit(&ckey, cipher_type, 2, pgd + 0x30, key, 0);
sceDrmBBCipherUpdate(&ckey, pgd + data_offset, align_size);
sceDrmBBCipherFinal(&ckey);
// Build data MAC hash.
int i;
for (i = 0; i < block_nr; i++)
{
int rsize = align_size - i * block_size;
if (rsize > block_size)
rsize = block_size;
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd + data_offset + i * block_size, rsize);
sceDrmBBMacFinal(&mkey, pgd + table_offset + i * 16, key);
}
// Build table MAC hash.
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd + table_offset, block_nr * 16);
sceDrmBBMacFinal(&mkey, pgd + 0x60, key);
// Encrypt the PGD header block (0x30 bytes).
sceDrmBBCipherInit(&ckey, cipher_type, 2, pgd + 0x10, key, 0);
sceDrmBBCipherUpdate(&ckey, pgd + 0x30, 0x30);
sceDrmBBCipherFinal(&ckey);
// Build MAC hash at 0x70 (key hash).
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd + 0x00, 0x70);
sceDrmBBMacFinal(&mkey, pgd + 0x70, key);
// Build MAC hash at 0x80 (DNAS hash).
sceDrmBBMacInit(&mkey, mac_type);
sceDrmBBMacUpdate(&mkey, pgd + 0x00, 0x80);
sceDrmBBMacFinal(&mkey, pgd + 0x80, fkey);
// Copy back the generated PGD file.
memcpy(pgd_data, pgd, pgd_size);
return pgd_size;
}
/*
PGD decrypt function.
*/
__declspec(dllexport) int decrypt_pgd(u8* pgd_data, int pgd_size, int flag, u8* key)
{
int result;
PGD_HEADER PGD[sizeof(PGD_HEADER)];
MAC_KEY mkey;
CIPHER_KEY ckey;
u8* fkey;
// Read in the PGD header parameters.
memset(PGD, 0, sizeof(PGD_HEADER));
PGD->buf = pgd_data;
PGD->key_index = *(u32*)(pgd_data + 4);
PGD->drm_type = *(u32*)(pgd_data + 8);
// Set the hashing, crypto and open modes.
if (PGD->drm_type == 1)
{
PGD->mac_type = 1;
flag |= 4;
if (PGD->key_index > 1)
{
PGD->mac_type = 3;
flag |= 8;
}
PGD->cipher_type = 1;
}
else
{
PGD->mac_type = 2;
PGD->cipher_type = 2;
}
PGD->open_flag = flag;
// Get the fixed DNAS key.
fkey = NULL;
if ((flag & 0x2) == 0x2)
fkey = dnas_key1A90_pgd;
if ((flag & 0x1) == 0x1)
fkey = dnas_key1AA0_pgd;
if (fkey == NULL)
{
printf("PGD: Invalid PGD DNAS flag! %08x\n", flag);
return -1;
}
// Test MAC hash at 0x80 (DNAS hash).
sceDrmBBMacInit(&mkey, PGD->mac_type);
sceDrmBBMacUpdate(&mkey, pgd_data, 0x80);
result = sceDrmBBMacFinal2(&mkey, pgd_data + 0x80, fkey);
if (result)
{
printf("PGD: Invalid PGD 0x80 MAC hash!\n");
return -1;
}
// Test MAC hash at 0x70 (key hash).
sceDrmBBMacInit(&mkey, PGD->mac_type);
sceDrmBBMacUpdate(&mkey, pgd_data, 0x70);
// If a key was provided, check it against MAC 0x70.
if (!isEmpty(key, 0x10))
{
result = sceDrmBBMacFinal2(&mkey, pgd_data + 0x70, key);
if (result)
{
printf("PGD: Invalid PGD 0x70 MAC hash!\n");
return -1;
}
else
{
memcpy(PGD->vkey, key, 16);
}
}
else
{
// Generate the key from MAC 0x70.
bbmac_getkey(&mkey, pgd_data + 0x70, PGD->vkey);
}
// Decrypt the PGD header block (0x30 bytes).
sceDrmBBCipherInit(&ckey, PGD->cipher_type, 2, pgd_data + 0x10, PGD->vkey, 0);
sceDrmBBCipherUpdate(&ckey, pgd_data + 0x30, 0x30);
sceDrmBBCipherFinal(&ckey);
// Get the decryption parameters from the decrypted header.
PGD->data_size = *(u32*)(pgd_data + 0x44);
PGD->block_size = *(u32*)(pgd_data + 0x48);
PGD->data_offset = *(u32*)(pgd_data + 0x4c);
// Additional size variables.
PGD->align_size = (PGD->data_size + 15) & ~15;
PGD->table_offset = PGD->data_offset + PGD->align_size;
PGD->block_nr = (PGD->align_size + PGD->block_size - 1) & ~(PGD->block_size - 1);
PGD->block_nr = PGD->block_nr / PGD->block_size;
if ((PGD->align_size + PGD->block_nr * 16) > pgd_size)
{
printf("ERROR: Invalid PGD data size!\n");
return -1;
}
// Test MAC hash at 0x60 (table hash).
sceDrmBBMacInit(&mkey, PGD->mac_type);
sceDrmBBMacUpdate(&mkey, pgd_data + PGD->table_offset, PGD->block_nr * 16);
result = sceDrmBBMacFinal2(&mkey, pgd_data + 0x60, PGD->vkey);
if (result)
{
printf("ERROR: Invalid PGD 0x60 MAC hash!\n");
return -1;
}
// Decrypt the data.
sceDrmBBCipherInit(&ckey, PGD->cipher_type, 2, pgd_data + 0x30, PGD->vkey, 0);
sceDrmBBCipherUpdate(&ckey, pgd_data + 0x90, PGD->align_size);
sceDrmBBCipherFinal(&ckey);
return PGD->data_size;
}

197
KIRK/utils.c Normal file
View File

@ -0,0 +1,197 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <io.h>
typedef unsigned char u8;
/**************************************************************/
char ownisgraph (u8 c)
{
if ( c >= 0x21 && c <= 0x7e )
return 1;
return 0;
}
void hex_dump(const char *str, void *addr, int size)
{
int i;
u8 *p = (u8*)addr;
if (addr == NULL) {
printf("hexdump: <NULL>\n");
return;
}
if (size == 0) {
printf("hexdump: size 0\n");
return;
}
if(str)
printf("%s:\n", str);
#if 0
printf("Address: ");
i=0; for(;i<16; ++i) {
if (i == 8)
printf("- ");
printf("%02X ", i);
}
i=0; for(;i<16; ++i) {
printf("%1X", i);
}
printf("\n-----------------------------------------------------------------------------\n");
#endif
i=0;
printf("0x%08X ", i);
for(; i<size; ++i) {
if (i != 0 && i % 16 == 0) {
int j;
for(j=16; j>0; --j) {
if(ownisgraph(p[i-j])) {
printf("%c", p[i-j]);
} else {
printf(".");
}
}
printf("\n0x%08X ", i);
}
if (i != 0 && i % 8 == 0 && i % 16 != 0) {
printf("- ");
}
printf("%02X ", p[i]);
}
int rest = (16-(i%16));
rest = rest == 16 ? 0 : rest;
int j; for(j=0; j<rest; j++) {
if (j+(i%16) == 8)
printf(" ");
printf(" ");
}
rest = i % 16;
rest = rest == 0 ? 16 : rest;
for(j=rest; j>0; --j) {
if(ownisgraph(p[i-j])) {
printf("%c", p[i-j]);
} else {
printf(".");
}
}
printf("\n\n");
}
/**************************************************************/
FILE *open_file(char *name, int *size)
{
FILE *fp;
fp = fopen(name, "rb");
if(fp==NULL){
//printf("Open file %s failed!\n", name);
return NULL;
}
fseek(fp, 0, SEEK_END);
*size = ftell(fp);
fseek(fp, 0, SEEK_SET);
return fp;
}
u8 *load_file(char *name, int *size)
{
FILE *fp;
u8 *buf;
fp = open_file(name, size);
if(fp==NULL)
return NULL;
buf = malloc(*size);
fread(buf, *size, 1, fp);
fclose(fp);
return buf;
}
int isEmpty(unsigned char* buf, int buf_size)
{
if (buf != NULL)
{
int i;
for (i = 0; i < buf_size; i++)
{
if (buf[i] != 0) return 0;
}
}
return 1;
}
int write_file(char *file, void *buf, int size)
{
FILE *fp;
int written;
fp = fopen(file, "wb");
if(fp==NULL)
return -1;
written = fwrite(buf, 1, size, fp);
fclose(fp);
return written;
}
/**************************************************************/
void mkdir_p(char *dname)
{
char name[256];
char *p, *cp;
strcpy(name, dname);
cp = name;
while(1){
p = strchr(cp, '/');
if(p==NULL)
p = strchr(cp, '\\');
if(p==NULL)
break;
*p = 0;
//mkdir(name, 0777);
mkdir(name);
*p = '/';
cp = p+1;
};
}
/**************************************************************/

19
KIRK/utils.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef UTILS_H
#define UTILS_H
#include <stdio.h>
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define NELEMS(a) (sizeof(a) / sizeof(a[0]))
void hex_dump(const char *str, void *addr, int size);
FILE *open_file(char *name, int *size);
unsigned __int8 *load_file(char *name, int *size);
int write_file(char *file, void *buf, int size);
int isEmpty(unsigned char* buf, int buf_size);
int walk_dir(char *dname, void *func_ptr, int verbose);
void mkdir_p(char *dname);
#endif

View File

@ -1,163 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="chovy-gen.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="key_vault.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{DCDBF747-DFB6-450E-A403-1C592D20EAEB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CHOVYGEN</RootNamespace>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)CHOVY\bin\$(Configuration)</OutDir>
<TargetName>CHOVY</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IgnoreImportLibrary />
<TargetName>CHOVY</TargetName>
<OutDir>$(SolutionDir)CHOVY\bin\$(Configuration)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ws2_32.lib;libsslMT.lib;Crypt32.lib;libcryptoMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>C:\openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>C:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ws2_32.lib;libsslMT.lib;Crypt32.lib;libcryptoMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="chovy-gen.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="key_vault.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{DCDBF747-DFB6-450E-A403-1C592D20EAEB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CHOVYGEN</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)CHOVY\bin\$(Configuration)</OutDir>
<TargetName>CHOVY</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IgnoreImportLibrary />
<TargetName>CHOVY</TargetName>
<OutDir>$(SolutionDir)CHOVY\bin\$(Configuration)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>C:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ws2_32.lib;libsslMT.lib;Crypt32.lib;libcryptoMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>C:\openssl\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>C:\openssl\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>ws2_32.lib;libsslMT.lib;Crypt32.lib;libcryptoMT.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;CHOVYGEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>