Update readme, fix some stuff

This commit is contained in:
Li 2023-06-10 20:20:11 +12:00
parent f087076653
commit c837fddb9f
8 changed files with 62 additions and 38 deletions

View File

@ -6,10 +6,7 @@ using LibChovy.VersionKey;
using System.Text;
using Vita.ContentManager;
using PspCrypto;
using Li.Utilities;
using System.Security.Cryptography;
using static PspCrypto.SceNpDrm;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace ChovySign_CLI
{
@ -197,7 +194,7 @@ namespace ChovySign_CLI
parameters.Clear();
return 0;
}
/*
public static void generateRif(byte[] idps, byte[] actBuf, byte[] versionKey, int versionKeyType, ulong accountId, string contentId)
{
byte[] vkey2 = new byte[versionKey.Length];
@ -246,7 +243,7 @@ namespace ChovySign_CLI
rifUtil.WritePadding(0xFF, 0x28);
}
}
*/
public static int Main(string[] args)
{
if (args.Length == 0)
@ -372,19 +369,16 @@ namespace ChovySign_CLI
generateKeysTxt();
if (drmInfo is null) return Error("no versionkey was found, exiting", 6);
//Console.WriteLine("Version Key: " + BitConverter.ToString(drmInfo.VersionKey).Replace("-", "") + ", " + drmInfo.KeyIndex);
if (pbpMode is null) return Error("no pbp mode was set, exiting", 7);
if (pbpMode == PbpMode.PSP && drmInfo.KeyIndex != 2)
return Error("KeyType is "+drmInfo.KeyIndex+", but PBP mode is PSP, you cant do that .. please use a type 2 versionkey.", 8);
if (pbpMode == PbpMode.POPS && drmInfo.KeyIndex != 1)
return Error("KeyType is " + drmInfo.KeyIndex + ", but PBP mode is POPS, you cant do that .. please use a type 1 versionkey.", 8);
int targetKeyIndex = (pbpMode == PbpMode.PSP) ? 2 : 1;
if (drmInfo.KeyIndex != targetKeyIndex)
{
SceNpDrm.sceNpDrmTransformVersionKey(drmInfo.VersionKey, drmInfo.KeyIndex, 2);
drmInfo.KeyIndex = targetKeyIndex;
}
if (rifFile is null)
return Error("Rif is not set, use --rif to specify base game RIF", 8);
if (rifFile is null) return Error("Rif is not set, use --rif to specify base game RIF", 8);
ChovySign csign = new ChovySign();
csign.RegisterCallback(onProgress);

View File

@ -29,6 +29,7 @@ namespace ChovySign_GUI.Global
}
public event EventHandler<EventArgs>? Finished;
protected virtual void OnFinished(EventArgs e)
{
if (Finished is not null)
@ -47,19 +48,18 @@ namespace ChovySign_GUI.Global
if(Parameters is null) { await MessageBox.Show(currentWindow, "ChovySignParameters was null, cannot start!", "Invalid Parameters", MessageBoxButtons.Ok); return; }
await Task.Run(() => {
try
{
try
{
await Task.Run(() => {
chovySign.Go(Parameters);
}
catch (Exception e)
{
Dispatcher.UIThread.Post(() => { _ = MessageBox.Show(currentWindow, "Error building: " + e.Message + "\n\nSTACKTRACE: " + e.StackTrace, "ERROR", MessageBoxButtons.Ok); });
}
});
});
}
catch (Exception ex)
{
await MessageBox.Show(currentWindow, "Error building: " + ex.Message + "\n\nSTACKTRACE: " + ex.StackTrace, "ERROR", MessageBoxButtons.Ok);
return;
}
OnFinished(new EventArgs());
this.goButton.IsEnabled = true;
}

View File

@ -70,8 +70,10 @@ namespace ChovySign_GUI.Ps1
// read settings from settings tab.
if (SettingsTab.Settings.DevkitMode) popsParameters.Account = new Account(0);
popsParameters.CrackMethod = SettingsTab.Settings.LibcryptMode;
SettingsReader.BackupsFolder = SettingsTab.Settings.CmaDirectory;
popsParameters.CreatePsvImg = SettingsTab.Settings.PackagePsvimg;
progressStatus.Parameters = popsParameters;

View File

@ -67,8 +67,9 @@ namespace ChovySign_GUI.Psp
pspParameters.Compress = isoSelector.Compress;
// read settings from settings tab.
if (SettingsTab.Settings.DevkitMode) pspParameters.Account = new Account(0);
pspParameters.Account.Devkit = SettingsTab.Settings.DevkitMode;
SettingsReader.BackupsFolder = SettingsTab.Settings.CmaDirectory;
pspParameters.CreatePsvImg = SettingsTab.Settings.PackagePsvimg;
progressStatus.Parameters = pspParameters;
}

View File

@ -13,12 +13,30 @@ namespace ChovySign_GUI.Settings
internal bool disableEvents = false;
private string? promptMsg = null;
private bool defaultSetting = false;
internal override void init()
{
bool? isToggleChecked = ChovyConfig.CurrentConfig.GetBool(ConfigKey);
if (isToggleChecked is null) isToggleChecked = false;
if(isToggleChecked is null) isToggleChecked = defaultSetting;
this.disableEvents = true;
configCheckbox.IsChecked = isToggleChecked;
this.disableEvents = false;
}
public bool Default
{
get
{
return defaultSetting;
}
set
{
defaultSetting = value;
if (ChovyConfig.CurrentConfig.GetBool(ConfigKey) is null)
this.IsToggled = defaultSetting;
}
}
public string Label
{

View File

@ -16,14 +16,17 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Settings:ConfigToggle Name="devkitAccount" ConfigKey="USE_DEVKIT_ACCOUNT_ID" Label="Devkit Mode (Use 0x0000000000000000 Account ID)"
Prompt="This option will force the CMA Account ID to be all 0's&#x0a;Which is how it is on Devkit, Testkit and IDU Firmware&#x0a;Enabling this if you have a retail firmware will result in the games just *not* showing up&#x0a;&#x0a;If you DON'T know what this means, DON'T enable this.&#x0a;do you want to continue?"
HorizontalAlignment="Stretch" Grid.Row="0"/>
<Settings:ConfigPath Name="cmaDirectory" ConfigKey="USE_CMA_DIRECTORY" IsDirectory="True" Label="Output Folder:" HorizontalAlignment="Stretch" Grid.Row="1"/>
<Settings:ConfigToggle Name="packagePsvimg" ConfigKey="USE_CMA_PSVIMG" Label="Use Content Manager (Package to PSVIMG)" Default="true" HorizontalAlignment="Stretch" Grid.Row="1"/>
<Settings:ConfigDropDown Name="libCryptMode" ConfigKey="USE_LIBCRYPT_METHOD" Label="LibCrypt Method:" HorizontalAlignment="Stretch" Grid.Row="2"/>
<Settings:ConfigPath Name="cmaDirectory" ConfigKey="USE_CMA_DIRECTORY" IsDirectory="True" Label="Output Folder:" HorizontalAlignment="Stretch" Grid.Row="2"/>
<Settings:ConfigDropDown Name="libCryptMode" ConfigKey="USE_LIBCRYPT_METHOD" Label="LibCrypt Method:" HorizontalAlignment="Stretch" Grid.Row="3"/>
</Grid>
</Grid>

View File

@ -7,7 +7,7 @@ namespace ChovySign_GUI.Settings
{
public partial class SettingsTab : UserControl
{
public static SettingsTab Settings;
public static SettingsTab? Settings;
public LibCryptMethod LibcryptMode
{
@ -37,6 +37,13 @@ namespace ChovySign_GUI.Settings
return devkitAccount.IsToggled;
}
}
public bool PackagePsvimg
{
get
{
return packagePsvimg.IsToggled;
}
}
public SettingsTab()

View File

@ -11,24 +11,23 @@ atleast one of these are free in *most* regions;
however failing that, you can also use a PSP DLC license-
-- if you don't have a hacked PSVita:
Copy the game to your PC using Content Manager,
Copy the offical game to your PC using Content Manager,
open chovy-sign2 and click the "Get Keys" button
select "EBOOT.PBP" method, click on the game
select "EBOOT.PBP" method,
select the offical game;
click on select "Content Manager" backup
(note: there may be some issues if you try this while having DLC for the game installed ...)
you should see the RIF and KEY fields populate, and your good to go!
-- If you have a hacked PSVita:
note: you can still use the unhacked vita method if you would like
(i.e if your only wanting to make PSP games, or are using PETZ SADDLE CLUB, LOCOROCO MIDNIGHT CARNIVAL or APE QUEST STARTER PACK)
note2: bubbles created using the hacked vita method will still *work* on any unhacked vita,
using the same PSN Account; however it requires a hacked vita to *obtain* some of the files,
that are required for this method;
the main advantage to doing it this way is you can use any psp license to create both ps1 and psp bubbles;
you will need:
- Your ConsoleID/IDPS, Yoti has a tool to dump this availible [here](https://github.com/Yoti/psv_idpsdump/releases/)
- Your Consoles activation data file (located at tm0:/npdrm/act.dat)