Make chovy-gen a DLL instead of external EXE

This commit is contained in:
SilicaAndPina 2019-10-03 21:50:25 +13:00
parent e327174163
commit 149793617e
15 changed files with 439 additions and 274 deletions

View File

@ -1,48 +1,62 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.76
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CHOVY", "CHOVY\CHOVY.csproj", "{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KIRK", "KIRK\KIRK.vcxproj", "{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x64.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x64.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x86.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x86.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|Any CPU.Build.0 = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x64.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x64.Build.0 = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x86.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x86.Build.0 = Release|Any CPU
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|Any CPU.Build.0 = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x64.ActiveCfg = Debug|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x64.Build.0 = Debug|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x86.ActiveCfg = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x86.Build.0 = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|Any CPU.ActiveCfg = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|Any CPU.Build.0 = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x64.ActiveCfg = Release|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x64.Build.0 = Release|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x86.ActiveCfg = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.76
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CHOVY-GUI", "CHOVY\CHOVY-GUI.csproj", "{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KIRK", "KIRK\KIRK.vcxproj", "{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CHOVY-GEN", "CHOVY-GEN\CHOVY-GEN.vcxproj", "{DCDBF747-DFB6-450E-A403-1C592D20EAEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x64.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x64.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x86.ActiveCfg = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Debug|x86.Build.0 = Debug|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|Any CPU.Build.0 = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x64.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x64.Build.0 = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x86.ActiveCfg = Release|Any CPU
{D46AA2C2-2BDC-45C7-ACA5-D7A2295564E8}.Release|x86.Build.0 = Release|Any CPU
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|Any CPU.Build.0 = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x64.ActiveCfg = Debug|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x64.Build.0 = Debug|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x86.ActiveCfg = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Debug|x86.Build.0 = Debug|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|Any CPU.ActiveCfg = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|Any CPU.Build.0 = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x64.ActiveCfg = Release|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x64.Build.0 = Release|x64
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x86.ActiveCfg = Release|Win32
{C441ACC2-EC4E-424B-AA99-3F5D1A997A4F}.Release|x86.Build.0 = Release|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|Any CPU.ActiveCfg = Debug|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|Any CPU.Build.0 = Debug|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|x64.ActiveCfg = Debug|x64
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|x64.Build.0 = Debug|x64
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|x86.ActiveCfg = Debug|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Debug|x86.Build.0 = Debug|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|Any CPU.ActiveCfg = Release|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|Any CPU.Build.0 = Release|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|x64.ActiveCfg = Release|x64
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|x64.Build.0 = Release|x64
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|x86.ActiveCfg = Release|Win32
{DCDBF747-DFB6-450E-A403-1C592D20EAEB}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
</configuration>

View File

@ -1,123 +1,124 @@
<?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.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</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 Condition="'$(Configuration)|$(Platform)' == 'CHOVY|AnyCPU'">
<OutputPath>bin\CHOVY\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<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="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="psvimgtools.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>
<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 Condition="'$(Configuration)|$(Platform)' == 'CHOVY|AnyCPU'">
<OutputPath>bin\CHOVY\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<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="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="psvimgtools.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>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>

View File

@ -228,14 +228,11 @@ namespace CHOVY
TotalProgress.Style = ProgressBarStyle.Marquee;
Status.Text = "Signing the Declaration of Independance";
Process ChovyGen = pbp.gen__sce_ebootpbp(EbootFile, Aid);
while(!ChovyGen.HasExited)
{
Application.DoEvents();
}
if (!File.Exists(EbootSignature) || ChovyGen.ExitCode != 0)
{
MessageBox.Show("CHOVY-GEN.EXE FAILED!\nArguments:\n" + ChovyGen.StartInfo.Arguments + "\nStdOut:\n" + ChovyGen.StandardOutput.ReadToEnd() + "\nStdErr:\n" + ChovyGen.StandardError.ReadToEnd());
UInt64 IntAid = Convert.ToUInt64(Aid,16);
int ChovyGenRes = pbp.gen__sce_ebootpbp(EbootFile, IntAid, EbootSignature);
if (!File.Exists(EbootSignature) || ChovyGenRes != 0)
{
MessageBox.Show("CHOVY-GEN Failed! Please check CHOVY.DLL exists\nand that the Microsoft Visual C++ 2015 Redistributable Update 3 RC is installed");
enable();
return;
}

View File

@ -208,8 +208,8 @@
this.FREEDOM.TabIndex = 15;
this.FREEDOM.Text = "FREEDOM";
this.FREEDOM.UseVisualStyleBackColor = true;
this.FREEDOM.Click += new System.EventHandler(this.FREEDOM_Click);
this.FREEDOM.EnabledChanged += new System.EventHandler(this.FREEDOM_EnabledChanged);
this.FREEDOM.Click += new System.EventHandler(this.FREEDOM_Click);
//
// groupBox1
//
@ -281,7 +281,7 @@
this.Controls.Add(this.PsmChan);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "CHOVY";
this.Text = "CHOVY";
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();

View File

@ -27,6 +27,8 @@ namespace CHOVY
private unsafe static extern int sceDrmBBMacUpdate(MAC_KEY *mkey, byte[] buf, int size);
[DllImport("KIRK.dll", CallingConvention = CallingConvention.Cdecl)]
private unsafe static extern int bbmac_getkey(MAC_KEY *mkey, byte[] bbmac, byte[] vkey);
[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="")
{
@ -85,19 +87,11 @@ namespace CHOVY
return VERSION_KEY;
}
public static Process gen__sce_ebootpbp(string EbootFile,string AID)
public static int gen__sce_ebootpbp(string EbootFile, UInt64 AID, string OutSceebootpbpFile)
{
Process chovygen = new Process();
chovygen.StartInfo.FileName = Path.Combine(Application.StartupPath, "tools", "chovy-gen.exe");
chovygen.StartInfo.WorkingDirectory = Path.GetDirectoryName(EbootFile);
chovygen.StartInfo.Arguments = AID + " \""+EbootFile+"\"";
chovygen.StartInfo.CreateNoWindow = true;
chovygen.StartInfo.UseShellExecute = false;
chovygen.StartInfo.RedirectStandardOutput = true;
chovygen.StartInfo.RedirectStandardError = true;
chovygen.Start();
return chovygen;
return chovy_gen(EbootFile, AID, OutSceebootpbpFile);
}
public static string GetContentId(string pbpfile)
{
FileStream pbp = File.OpenRead(pbpfile);

View File

@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CHOVY

View File

@ -131,6 +131,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;KIRK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -2,12 +2,12 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>C:\Users\earsy\Documents\Visual Studio 2017\Projects\CHOVEY\CHOVY\bin\Debug\CHOVY.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)CHOVY\bin\$(Configuration)\CHOVY-SIGN.EXE</LocalDebuggerCommand>
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>C:\Users\earsy\Documents\Visual Studio 2017\Projects\CHOVEY\CHOVY\bin\Release\CHOVY-SIGN.exe</LocalDebuggerCommand>
<LocalDebuggerDebuggerType>ManagedOnly</LocalDebuggerDebuggerType>
<LocalDebuggerCommand>$(SolutionDir)CHOVY\bin\$(Configuration)\CHOVY-SIGN.EXE</LocalDebuggerCommand>
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
</PropertyGroup>
</Project>

163
chovy-gen/CHOVY-GEN.vcxproj Normal file
View File

@ -0,0 +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>
</Project>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="key_vault.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="chovy-gen.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommand>$(SolutionDir)CHOVY\bin\$(Configuration)\CHOVY-SIGN.EXE</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>$(SolutionDir)CHOVY\bin\$(Configuration)\CHOVY-SIGN.EXE</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerDebuggerType>Mixed</LocalDebuggerDebuggerType>
</PropertyGroup>
</Project>

View File

@ -1,28 +0,0 @@
TARGET = chovy-gen
OBJS = main.o
LIBS = -lssl -lcrypto -lole32 -lgdi32 -lws2_32
CFLAGS = -s -static -Wall -Wextra -std=c99
all: $(TARGET)
$(TARGET): $(OBJS)
@echo "Creating binary $(TARGET)"
$(CXX) $(OBJS) -o $@ $(LIBS) -static -static-libgcc
%.o: %.cpp
@echo "Compiling $^"
$(CXX) $(CFLAGS) -c $^ -o $@ -static -static-libgcc
clean:
@echo "Removing all the .o files"
@$(RM) $(OBJS)
mrproper: clean
@echo "Removing binary"
@$(RM) $(TARGET)
install: all
@cp $(TARGET) ../bin

View File

@ -2,6 +2,7 @@
// With CBPS help especially: @SiliCart, @nyaaasen, @notzecoxao (and his friends?)
//Check out motoharu's project: https://github.com/motoharu-gosuto/psvcmd56/blob/master/src/CMD56Reversed/F00D/GcAuthMgrService.cpp#L1102
#define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
#include <string.h>
#include <stdio.h>
@ -15,26 +16,26 @@
#include <openssl/ec.h>
#include "key_vault.h"
typedef struct
PACK(typedef struct
{
uint8_t r[0x1c];
uint8_t s[0x1c];
} __attribute__((packed)) ECDSA_SIG_0x1c;
} ECDSA_SIG_0x1c);
typedef struct sce_ebootpbp {
PACK(typedef struct sce_ebootpbp {
uint64_t magic;
uint32_t key_type;// set to 1 (maybe keytype?)
uint32_t type;// 03 - ps1, 02 - psp
char np_title[0x30];
uint8_t np_title[0x30];
uint64_t aid;
uint64_t secure_tick;
uint64_t filesz;
uint64_t sw_ver;
char padding[0xf8];
uint8_t padding[0xf8];
ECDSA_SIG_0x1c ebootpbp_hdr_sig;
ECDSA_SIG_0x1c NPUMDIMG_sig;
ECDSA_SIG_0x1c sceebootpbp_sig;
} __attribute__((packed)) sce_ebootpbp;
} sce_ebootpbp);
typedef struct pbp_hdr {
@ -56,7 +57,7 @@ typedef struct pbp_hdr {
//based motoharu
int can_be_reversed_80C17A(const uint8_t* src, int some_size, uint8_t* iv, uint8_t* src_xored_digest)
__declspec(dllexport) int can_be_reversed_80C17A(const uint8_t* src, int some_size, uint8_t* iv, uint8_t* src_xored_digest)
{
unsigned char src_xored[0x20];
memcpy(src_xored, iv, 0x20);
@ -94,7 +95,7 @@ int can_be_reversed_80C17A(const uint8_t* src, int some_size, uint8_t* iv, uint8
}
int f00d_KIRK0x22(const uint8_t *hash, ECDSA_SIG_0x1c *signature, int key_sel) {
__declspec(dllexport) int f00d_KIRK0x22(const uint8_t *hash, ECDSA_SIG_0x1c *signature, int key_sel) {
uint8_t hmac_in[0x38];
@ -151,7 +152,7 @@ int f00d_KIRK0x22(const uint8_t *hash, ECDSA_SIG_0x1c *signature, int key_sel) {
//Generate R in order to get custom "random number"
BIGNUM *sig_r = BN_new();
EC_POINT_mul(curve, generator, m, NULL, NULL, bn_ctx);
EC_POINT_get_affine_coordinates(curve, generator, sig_r, NULL, bn_ctx);
EC_POINT_get_affine_coordinates_GFp(curve, generator, sig_r, NULL, bn_ctx);
BN_nnmod(sig_r, sig_r, order, bn_ctx);
//Generate M^-1
@ -176,7 +177,7 @@ int f00d_KIRK0x22(const uint8_t *hash, ECDSA_SIG_0x1c *signature, int key_sel) {
BN_bn2bin(sig_r, &signature->r);
BN_bn2bin(sig_s, &signature->s);
ECDSA_SIG_free(sig);
BN_free(sig_s);
//BN_free(sig_s);
ret = 1;
error:
@ -198,39 +199,27 @@ error:
}
static void usage(char *argv[])
{
printf("Project Chovy - __sce_ebootpbp generator by @dots_tb and motoharu\n");
printf("With CBPS help especially: @SiliCart, @nyaaasen, @notzecoxao (and his friends?)\n");
printf("%s <aid> <EBOOT.pbp>\n\n",argv[0]);
}
int main(int argc, const char **argv)
__declspec(dllexport) int chovy_gen(char *ebootpbp, uint64_t signaid, char *outscefile)
{
int ret = 1;
FILE *fin = 0, *fout = 0;
if (argc != 3) {
usage(argv);
return 1;
}
uint8_t *work_buf = (unsigned char*) calloc (1, WORK_BUF_SZ);
sce_ebootpbp *sceebootpbp_file = (unsigned char*) calloc (1, sizeof(sce_ebootpbp));
printf("Input: %s\n", argv[2]);
fin = fopen(argv[2], "rb");
fin = fopen(ebootpbp, "rb");
if (!fin) {
perror("Failed to open input file");
goto error;
}
memcpy(&sceebootpbp_file->magic, "NPUMDSIG", 0x8);
sceebootpbp_file->type = 2;
sceebootpbp_file->key_type = 1;
sceebootpbp_file->aid = __builtin_bswap64(strtoull(argv[1], NULL, 0x10));
sceebootpbp_file->aid = _byteswap_uint64(signaid);
printf("AID set to: %llx\n", sceebootpbp_file->aid);
fseek(fin, 0, SEEK_END);
sceebootpbp_file->filesz = ftell(fin);
@ -243,7 +232,7 @@ int main(int argc, const char **argv)
fseek(fin, 0, SEEK_SET);
fread(work_buf, hdr.icon0_offset, 1,fin);
char work_hash[0x1c];
uint8_t work_hash[0x1c];
SHA256_CTX sha256_ctx;
SHA224_Init(&sha256_ctx);
SHA224_Update(&sha256_ctx, work_buf, hdr.icon0_offset);
@ -252,11 +241,12 @@ int main(int argc, const char **argv)
SHA224_Init(&sha256_ctx);
fseek(fin, hdr.data_psar_offset, SEEK_SET);
size_t size = PSAR_SZ;
int to_read = size > WORK_BUF_SZ ? WORK_BUF_SZ : size;
fread(work_buf, to_read, 1,fin);
fread(work_buf, to_read, 1,fin);
if(memcmp(work_buf, "NPUMDIMG", 0x8) == 0)
memcpy(&sceebootpbp_file->np_title, work_buf + 0x10, sizeof(sceebootpbp_file->np_title));
else {
@ -281,14 +271,13 @@ int main(int argc, const char **argv)
f00d_KIRK0x22(work_hash, &sceebootpbp_file->sceebootpbp_sig, sceebootpbp_file->key_type);
fout = fopen("__sce_ebootpbp", "wb");
fout = fopen(outscefile, "wb");
if (!fout) {
perror("Failed to open output file");
goto error;
}
fwrite(sceebootpbp_file, 1, sizeof(sce_ebootpbp), fout);
printf("Written to: __sce_ebootpbp\n");
ret = 0;
error:
if (fin)
fclose(fin);
@ -296,6 +285,5 @@ error:
fclose(fout);
free(work_buf);
free(sceebootpbp_file);
exit(0);
return 0;
return ret;
}