diff --git a/README.md b/README.md
index 523724f..886d4af 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,30 @@
# ZUGABE
+
+**This is obsolete. Please use [finalhe by soarqin](https://github.com/soarqin/finalhe).**
+
This tool automates much of the installation of h-encore.
-[](http://www.repostatus.org/#active)
+## About
+This tool automates the install process of thefl0w's h-encore exploit for PS Vita, at least everything that can be done on the PC.
+Since I can't code in C or C++, I was unable to use OpenCMA as a backend, so I used QCMA. It's automatically downloaded and does not require to be installed.
+Configuration of QCMA is done via registry edits. The application also detects existing QCMA installations and restores the original settings after the exploit was installed.
-## Features
-- Automatically download required tools and files
-- Use already downloaded files, not requiring another download
-- Guide users through the installation
+**Attention: This tool only supports connection of the PSVita using Wi-Fi, therefore it's currently only compatible with PSVita/PSTV on Firmware 3.68!**
## Usage
Download from the releases section, extract it and run the executable.
-It's heavily based on TheFlow's own usage guide, just automating as many things as possible. Therefore it should work on all vita systems. This tool was tested on a PSVita 1000.
## Building
-Visual Studio 2017 Community Edition was tested. Might work in other IDEs as well.
+Build using Visual Studio 2017, this was tested. Other C# IDEs might work as well.
## Todo
-- Automate entering the AID
-- Mac/Linux Compatibilty
-- full Automation without needing qcma
+- Mac/Linux compatibility
- Fix bugs (you tell me!)
## Thanks
- thefl0w for h-encore and all their work in the vita scene
- yifanlu for psvimgtools and all their other work in the vita scene
- - mmozeiko for psvimgtools
- - noahc3 for auto-h-encore and therefore showing me how to make ZUGABE better.
+ - mmozeiko for pkg2zip
+ - noahc3 for auto-h-encore
+ - xxyz for pngshot
- All the contributors of the vita hacking scene
diff --git a/download-resources/Qcma.zip b/download-resources/Qcma.zip
new file mode 100644
index 0000000..3f963ed
Binary files /dev/null and b/download-resources/Qcma.zip differ
diff --git a/download-resources/create.bat b/download-resources/create.bat
new file mode 100644
index 0000000..e8ea66f
--- /dev/null
+++ b/download-resources/create.bat
@@ -0,0 +1,6 @@
+cd %~dp0
+
+..\psvimg-create -n app -K %1 app PCSG90096/app
+..\psvimg-create -n appmeta -K %1 appmeta PCSG90096/appmeta
+..\psvimg-create -n license -K %1 license PCSG90096/license
+..\psvimg-create -n savedata -K %1 savedata PCSG90096/savedata
\ No newline at end of file
diff --git a/download-resources/qcma.reg b/download-resources/qcma.reg
new file mode 100644
index 0000000..c0c07cd
Binary files /dev/null and b/download-resources/qcma.reg differ
diff --git a/h-encore-auto/App.xaml b/h-encore-auto/App.xaml
index 7fb5fd7..2f27785 100644
--- a/h-encore-auto/App.xaml
+++ b/h-encore-auto/App.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:h_encore_auto"
- StartupUri="MainWindow.xaml">
+ StartupUri="AutoMode.xaml">
diff --git a/h-encore-auto/AutoMode.xaml b/h-encore-auto/AutoMode.xaml
new file mode 100644
index 0000000..54627cc
--- /dev/null
+++ b/h-encore-auto/AutoMode.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/h-encore-auto/AutoMode.xaml.cs b/h-encore-auto/AutoMode.xaml.cs
new file mode 100644
index 0000000..e8d44e1
--- /dev/null
+++ b/h-encore-auto/AutoMode.xaml.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Windows;
+using System.Windows.Input;
+using System.Threading;
+
+namespace h_encore_auto
+{
+ ///
+ /// Interaction logic for AutoMode.xaml
+ ///
+ public partial class AutoMode : Window
+ {
+ public AutoMode()
+ {
+ InitializeComponent();
+
+ if (Directory.Exists(Ref.tempDir))
+ Util.DeleteDirectory(Ref.tempDir);
+
+ InitTimer();
+ }
+
+ private void buttonStart_Click(object sender, RoutedEventArgs e)
+ {
+ Directory.CreateDirectory(Ref.tempDir);
+ buttonStart.IsEnabled = false;
+ buttonClose.IsEnabled = false;
+ barWorking.Visibility = Visibility.Visible;
+
+ new Thread(() =>
+ {
+ Thread.CurrentThread.IsBackground = true;
+
+ Process[] pname = Process.GetProcessesByName("qcma");
+ if (pname.Length != 0)
+ {
+ foreach (var proc in pname)
+ {
+ proc.Kill();
+ }
+ MessageBox.Show("QCMA was closed, since this application has to interact with it.");
+ }
+
+ Process process = new Process();
+ ProcessStartInfo startInfo = new ProcessStartInfo();
+ ProcessStartInfo startInfoOut = new ProcessStartInfo();
+
+ startInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ startInfo.FileName = "cmd.exe";
+ startInfo.WorkingDirectory = Ref.tempDir;
+
+ startInfoOut.WindowStyle = ProcessWindowStyle.Hidden;
+ startInfoOut.FileName = "cmd.exe";
+ startInfoOut.WorkingDirectory = Ref.tempDir;
+
+ // 7ZIP Download and extraction
+ Util.dlFile(Ref.url7zr, "7zr.exe");
+ Util.dlFile(Ref.url7za, "7z-extra.7z");
+
+ startInfo.Arguments = "/C 7zr.exe x 7z-extra.7z";
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ //Rest of the tool downloads
+ Util.dlFile(Ref.urlPsvimg, "psvimgtools.zip");
+ Util.dlFile(Ref.urlPkg, "pkg2zip.zip");
+ Util.dlFile(Ref.urlEnc, "h-encore.zip");
+ Util.dlFile(Ref.urlEntry, "entryPoint.pkg");
+ Util.dlFile(Ref.urlQcma, "qcma.zip");
+ Util.dlFile(Ref.urlReg, "qcma.reg");
+
+ string text = File.ReadAllText(Ref.pathImportReg);
+ text = text.Replace("REPLACE", Ref.pathQcmaRes);
+ File.WriteAllText(Ref.pathImportReg, text);
+ text = text.Replace("\\", "/");
+ File.WriteAllText(Ref.pathImportReg, text);
+ text = text.Replace("HKEY_CURRENT_USER/Software/codestation/qcma", @"HKEY_CURRENT_USER\Software\codestation\qcma");
+ File.WriteAllText(Ref.pathImportReg, text);
+
+ startInfo.Arguments = "/C " + Ref.path7z + " x " + Ref.pathPsvimg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ startInfo.Arguments = "/C " + Ref.path7z + " x " + Ref.pathPkg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ startInfo.Arguments = "/C " + Ref.path7z + " x " + Ref.pathEnc;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ Util.dlFile(Ref.urlCreateBat, "h-encore\\create.bat");
+
+ startInfo.Arguments = "/C " + Ref.path7z + " x " + Ref.pathQcma;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ startInfo.Arguments = "/C " + Ref.tempDir + "pkg2zip.exe -x " + Ref.pathEntry;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ Util.CopyDir(Ref.tempDir + "app\\PCSG90096\\", Ref.tempDir + "h-encore\\app\\ux0_temp_game_PCSG90096_app_PCSG90096\\",true);
+ File.Copy(Ref.tempDir + "app\\PCSG90096\\sce_sys\\package\\temp.bin", Ref.tempDir + @"h-encore\license\ux0_temp_game_PCSG90096_license_app_PCSG90096\6488b73b912a753a492e2714e9b38bc7.rif");
+
+ startInfoOut.RedirectStandardOutput = true;
+ startInfoOut.UseShellExecute = false;
+ startInfoOut.Arguments = @"/C reg query HKEY_CURRENT_USER\Software\codestation\qcma & echo 0";
+ process.StartInfo = startInfoOut;
+ process.Start();
+ string stdout = process.StandardOutput.ReadToEnd();
+ process.WaitForExit();
+
+ if (stdout == "0")
+ {
+ Ref.isQcmaConfigFound = false;
+
+ startInfo.Arguments = @"/C reg import " + Ref.pathImportReg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+ }
+
+ else
+ {
+ Ref.isQcmaConfigFound = true;
+
+ startInfo.Arguments = @"/C reg export HKEY_CURRENT_USER\Software\codestation\qcma " + Ref.pathBackupReg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ startInfo.Arguments = @" /C reg import " + Ref.pathImportReg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+ }
+
+ Ref.isRegModified = true;
+
+ startInfo.Arguments = @"/C " + Ref.pathQcmaExtracted + "qcma.exe";
+ process.StartInfo = startInfo;
+ process.Start();
+
+ stage = 1;
+
+ }).Start();
+ }
+
+ private void Grid_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ try
+ {
+ DragMove();
+ }
+ catch { }
+ }
+
+ private void buttonClose_Click(object sender, RoutedEventArgs e)
+ {
+ Util.Cleanup();
+ }
+
+ private int stage = 0;
+ private System.Windows.Forms.Timer timer1;
+ public void InitTimer()
+ {
+ timer1 = new System.Windows.Forms.Timer();
+ timer1.Tick += new EventHandler(timer1_Tick);
+ timer1.Interval = 1000; // in miliseconds
+ timer1.Start();
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ var guide = new VitaGuide();
+ if (stage == 1)
+ {
+ for (; ; )
+ {
+ stage = 0;
+ Ref.isSecondGuide = false;
+ guide.ShowDialog();
+ Ref.isSecondGuide = true;
+
+ if (Util.IsDirectoryEmpty(Ref.pathQcmaRes + "PSVita\\APP\\"))
+ {
+ MessageBox.Show("Required folder not found. \nMake sure you did everything correctly and follow the steps again.");
+ }
+ else
+ {
+ stage = 2;
+ break;
+ }
+ }
+ }
+ if (stage == 2)
+ {
+ stage = 0;
+ new Thread(() =>
+ {
+ Thread.CurrentThread.IsBackground = true;
+
+ Process process = new Process();
+ ProcessStartInfo startInfo = new ProcessStartInfo();
+ ProcessStartInfo startInfoOut = new ProcessStartInfo();
+
+ startInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ startInfo.FileName = "cmd.exe";
+ startInfo.WorkingDirectory = Ref.tempDir + "h-encore";
+
+ Ref.shortAID = new DirectoryInfo(Directory.GetDirectories(Ref.pathQcmaRes + "PSVita\\APP\\")[0]).Name;
+
+ Ref.longAID = Util.GetEncKey(Ref.shortAID);
+
+ startInfo.Arguments = "/C create.bat " + Ref.longAID;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+
+ Util.CopyDir(Ref.tempDir + "h-encore\\PCSG90096\\", Ref.pathQcmaRes + "PSVita\\APP\\" + Ref.shortAID + "\\PCSG90096\\", true);
+
+ stage = 3;
+ }).Start();
+ }
+ if (stage == 3)
+ {
+ stage = 0;
+ guide.ShowDialog();
+
+ MessageBox.Show("If not already done, wait until your Vita has copied over the exploit, then press OK.");
+
+ Util.Cleanup();
+ }
+ }
+ }
+}
diff --git a/h-encore-auto/MainWindow.xaml b/h-encore-auto/MainWindow.xaml
deleted file mode 100644
index 3941468..0000000
--- a/h-encore-auto/MainWindow.xaml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/h-encore-auto/MainWindow.xaml.cs b/h-encore-auto/MainWindow.xaml.cs
deleted file mode 100644
index c292bb5..0000000
--- a/h-encore-auto/MainWindow.xaml.cs
+++ /dev/null
@@ -1,331 +0,0 @@
-using System.Windows;
-using System.Net;
-using System.IO;
-using System.Threading;
-using System.ComponentModel;
-using System;
-using System.Windows.Threading;
-using System.Diagnostics;
-using Essy.Tools.InputBox;
-using Microsoft.Win32;
-
-namespace h_encore_auto
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
-
- if (Directory.Exists(Ref.tempDir))
- {
- Util.DeleteDirectory(Ref.tempDir);
- }
-
- createTemp();
- }
-
- public void createTemp()
- {
- if (tempCreated == false)
- {
- Directory.CreateDirectory(Ref.tempDir);
- tempCreated = true;
- }
- }
-
- string ProgramFilesx86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
- string ProgramFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
- bool tempCreated = false;
- string longAID = null;
- string shortAID = null;
-
- private void buttonGo_Click(object sender, RoutedEventArgs e)
- {
- if (boxPath7z.Text == "")
- {
- MessageBox.Show("A path missing!");
- }
- else if (boxPathEntry.Text == "")
- {
- MessageBox.Show("A path missing!");
- }
- else if (boxPathEnc.Text == "")
- {
- MessageBox.Show("A path missing!");
- }
- else if (boxPathPkg.Text == "")
- {
- MessageBox.Show("A path missing!");
- }
- else if (boxPathPsvimg.Text == "")
- {
- MessageBox.Show("A path missing!");
- }
- else
- {
- MessageBox.Show("This will probably take some time. Sit back and wait for further message boxes.");
-
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = Ref.tempDir;
-
- startInfo.Arguments = "/C " + boxPath7z.Text + " x " + boxPathPsvimg.Text;
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = "/C " + boxPath7z.Text + " x " + boxPathPkg.Text;
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = "/C " + boxPath7z.Text + " x " + boxPathEnc.Text;
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = "/C " + Ref.tempDir + "pkg2zip.exe" + " -x " + boxPathEntry.Text;
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = "/C xcopy /E /Y /I " + Ref.tempDir + @"app\PCSG90096\ " + Ref.tempDir + @"h-encore\app\ux0_temp_game_PCSG90096_app_PCSG90096\";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = "/C xcopy /E /Y /I " + Ref.tempDir + @"app\PCSG90096\sce_sys\package\temp.bin " + Ref.tempDir + @"h-encore\license\ux0_temp_game_PCSG90096_license_app_PCSG90096\6488b73b912a753a492e2714e9b38bc7.rif*";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- try
- {
- string path = Ref.tempDir + "app\\PCSG90096\\resource\\";
- foreach (string k in Ref.trims)
- {
- Util.DeleteDirectory(path + k);
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("Unexpected Exception: " + ex.Message);
- return;
- }
-
- for (; ; )
- {
- Process[] pname = Process.GetProcessesByName("qcma");
- if (pname.Length == 0)
- {
- if (MessageBox.Show("QCMA not detected. Please start it now. Download it?", "QCMA error", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- Process.Start("https://codestation.github.io/qcma/");
- MessageBox.Show("Retrying...");
- }
- else
- MessageBox.Show("Retrying...");
- }
- else
- {
- break;
- }
- }
- for (; ; )
- {
- MessageBox.Show("In the QCMA settings, set the option \"Use this version for updates\" to \"FW 0.00 (Always up-to-date)\".");
- MessageBox.Show("Launch Content Manager on your PS Vita and connect it to your computer, where you then need to select PC -> PS Vita System.\nAfter that you select Applications. If you see an error message about System Software, you should simply reboot your device to solve it\n(if this doesn't solve, then put your device into airplane mode and reboot).");
- if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\PS Vita\"))
- {
- MessageBox.Show("A folder will open, which should now contain another folder named with 16 characters of jumbled letters and numbers.\nCopy this folder name and insert it in the next step.");
- Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\PS Vita\APP\");
- shortAID = InputBox.ShowInputBox("Enter the 16-character folder name.");
- }
- else
- {
- MessageBox.Show("A folder named after your Account ID was created inside your \"PS Vita\\APP\\\"\nUse the settings of QCMA to find it.\nCopy the folder name and insert it in the next step.");
- shortAID = InputBox.ShowInputBox("Enter the 16-character folder name.");
- }
- if (MessageBox.Show("Press yes to continue, no to redo the last step.", "Continue?", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- break;
- }
- }
-
- longAID = Util.GetEncKey(shortAID);
-
- startInfo.WorkingDirectory = Ref.tempDir + "h-encore";
-
- startInfo.Arguments = @"/C ..\psvimg-create -n app -K " + longAID + " PCSG90096/app";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = @"/C ..\psvimg-create -n appmeta -K " + longAID + " PCSG90096/appmeta";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = @"/C ..\psvimg-create -n license -K " + longAID + " PCSG90096/license";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- startInfo.Arguments = @"/C ..\psvimg-create -n savedata -K " + longAID + " PCSG90096/savedata";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\PS Vita\"))
- {
- MessageBox.Show("Two folders will now open.\nCopy the contained folder called \"PCSG90096\" to the \"PS Vita/APP/xxxxxxxxxxxxxxxx/\" folder.\nThen refresh the databse of QCMA by right-clicking the icon and selecting it.");
- Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\PS Vita\APP\");
- Process.Start(Ref.tempDir + @"h-encore\");
- }
- else
- {
- MessageBox.Show("A folder will now open.\nCopy the contained folder called \"PCSG90096\" to your \"PS Vita/APP/xxxxxxxxxxxxxxxx/\" folder.\nThen refresh the databse of QCMA by right-clicking the icon and selecting it.");
- Process.Start(Ref.tempDir + @"h-encore\");
- }
- MessageBox.Show("Ready? Have you copied the folder and refreshed the database?");
- MessageBox.Show("Now copy h-encore to your Vita using the content manager.");
- MessageBox.Show("Launch h-encore to exploit your device (if a message about trophies appears, simply click yes). \nThe screen should first flash white, then purple, and finally\nopen a menu called h-encore bootstrap menu where you can download VitaShell and install HENkaku.");
- if (MessageBox.Show("For more info and how to remove the trophy warning please visit TheFlow's official page for the exploit.", "Info", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
- {
- Process.Start("https://codestation.github.io/qcma/");
- }
-
- Util.cleanup();
- }
- }
-
- private void buttonZipDL_Click(object sender, RoutedEventArgs e)
- {
- Util.dlFile(Ref.url7zr, "7zr.exe");
- Util.dlFile(Ref.url7za, "7z-extra.7z");
-
- Process process = new Process();
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.WindowStyle = ProcessWindowStyle.Hidden;
- startInfo.FileName = "cmd.exe";
- startInfo.WorkingDirectory = Ref.tempDir;
-
- startInfo.Arguments = "/C 7zr.exe x 7z-extra.7z";
- process.StartInfo = startInfo;
- process.Start();
- process.WaitForExit();
-
- boxPath7z.Text = Ref.tempDir + "7za.exe";
- }
-
- private void buttonPsvimgDL_Click(object sender, RoutedEventArgs e)
- {
- Util.dlFile(Ref.urlPsvimg, "psvimgtools.zip");
-
- boxPathPsvimg.Text = Ref.tempDir + "psvimgtools.zip";
- }
-
- private void buttonPkgDL_Click(object sender, RoutedEventArgs e)
- {
- Util.dlFile(Ref.urlPkg, "pkg2zip.zip");
-
- boxPathPkg.Text = Ref.tempDir + "pkg2zip.zip";
- }
-
- private void buttonEncDL_Click(object sender, RoutedEventArgs e)
- {
- Util.dlFile(Ref.urlEnc, "h-encore.zip");
-
- boxPathEnc.Text = Ref.tempDir + "h-encore.zip";
- }
-
- private void buttonEntryDL_Click(object sender, RoutedEventArgs e)
- {
- MessageBox.Show("This will take a while, please be patient.");
-
- Util.dlFile(Ref.urlEntry, "entryPoint.pkg");
-
- boxPathEntry.Text = Ref.tempDir + "entryPoint.pkg";
- }
-
- private void button7zFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.DefaultExt = ".exe";
- dlg.Filter = "Executables (.exe)|*.exe";
-
- bool? result = dlg.ShowDialog();
-
- if (result == true)
- {
- string path = dlg.FileName;
- boxPath7z.Text = path;
- }
- }
-
- private void buttonPsvimgFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.DefaultExt = ".zip";
- dlg.Filter = "ZIP Archives (.zip)|*.zip";
-
- bool? result = dlg.ShowDialog();
-
- if (result == true)
- {
- string path = dlg.FileName;
- boxPathPsvimg.Text = path;
- }
- }
-
- private void buttonPkgFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.DefaultExt = ".zip";
- dlg.Filter = "ZIP Archives (.zip)|*.zip";
-
- bool? result = dlg.ShowDialog();
-
- if (result == true)
- {
- string path = dlg.FileName;
- boxPathPkg.Text = path;
- }
- }
-
- private void buttonEncFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.DefaultExt = ".zip";
- dlg.Filter = "ZIP Archives (.zip)|*.zip";
-
- bool? result = dlg.ShowDialog();
-
- if (result == true)
- {
- string path = dlg.FileName;
- boxPathEnc.Text = path;
- }
- }
- private void buttonEntryFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.DefaultExt = ".zip";
- dlg.Filter = "PSVita PKG Archives (.pkg)|*.pkg";
-
- bool? result = dlg.ShowDialog();
-
- if (result == true)
- {
- string path = dlg.FileName;
- boxPathEntry.Text = path;
- }
- }
- }
-}
diff --git a/h-encore-auto/Util.cs b/h-encore-auto/Util.cs
index e2b1b38..dcfdc52 100644
--- a/h-encore-auto/Util.cs
+++ b/h-encore-auto/Util.cs
@@ -1,15 +1,18 @@
-using System;
-using System.Net;
-using System.Net.Http;
+using System;
+using System.Net;
+using System.Net.Http;
using System.IO;
using System.Windows.Markup;
using System.Windows;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
namespace h_encore_auto
{
public class Util
{
- private static WebClient web = new WebClient();
+ private static WebClient web = new WebClient();
private static HttpClient http = new HttpClient();
public static string GetEncKey(string aid)
@@ -22,7 +25,7 @@ namespace h_encore_auto
}
catch (Exception)
{
- MessageBox.Show("Failed to get the CMA encryption key. Make sure your internet is connected and/or retry.");
+ MessageBox.Show("Failed to get the CMA encryption key. Make sure your internet is connected and retry.");
return "";
}
}
@@ -55,11 +58,97 @@ namespace h_encore_auto
client.DownloadFile(url, Ref.tempDir + filename);
}
}
- public static void cleanup()
+ public static void Cleanup()
{
- Util.DeleteDirectory(Ref.tempDir);
- MessageBox.Show("Done.");
- System.Environment.Exit(0);
+ Process[] pname = Process.GetProcessesByName("qcma");
+ if (pname.Length != 0)
+ {
+ foreach (var proc in pname)
+ {
+ proc.Kill();
+ }
+ }
+
+ Process process = new Process();
+ ProcessStartInfo startInfo = new ProcessStartInfo();
+ ProcessStartInfo startInfoOut = new ProcessStartInfo();
+ startInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ startInfo.FileName = "cmd.exe";
+ startInfo.WorkingDirectory = Ref.tempDir;
+
+ if (Ref.isRegModified == true)
+ {
+ startInfo.Arguments = @"/C reg delete HKEY_CURRENT_USER\Software\codestation\qcma /f";
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+ }
+
+ if (Ref.isQcmaConfigFound == true)
+ {
+ startInfo.Arguments = @"/C reg import " + Ref.pathBackupReg;
+ process.StartInfo = startInfo;
+ process.Start();
+ process.WaitForExit();
+ }
+
+ if (Directory.Exists(Ref.tempDir))
+ {
+ DeleteDirectory(Ref.tempDir);
+ }
+
+ Environment.Exit(0);
+ }
+ public static bool IsDirectoryEmpty(string path)
+ {
+ IEnumerable items = Directory.EnumerateFileSystemEntries(path);
+ using (IEnumerator en = items.GetEnumerator())
+ {
+ return !en.MoveNext();
+ }
+ }
+
+ public static string GetLang()
+ {
+ CultureInfo ci = CultureInfo.InstalledUICulture;
+
+ return ci.TwoLetterISOLanguageName;
+ }
+
+ public static void CopyDir(string sourceDirName, string destDirName, bool copySubDirs)
+ {
+ // Get the subdirectories for the specified directory.
+ DirectoryInfo dir = new DirectoryInfo(sourceDirName);
+
+ if (!dir.Exists)
+ {
+ throw new DirectoryNotFoundException("Source directory does not exist or could not be found: " + sourceDirName);
+ }
+
+ DirectoryInfo[] dirs = dir.GetDirectories();
+ // If the destination directory doesn't exist, create it.
+ if (!Directory.Exists(destDirName))
+ {
+ Directory.CreateDirectory(destDirName);
+ }
+
+ // Get the files in the directory and copy them to the new location.
+ FileInfo[] files = dir.GetFiles();
+ foreach (FileInfo file in files)
+ {
+ string temppath = Path.Combine(destDirName, file.Name);
+ file.CopyTo(temppath, false);
+ }
+
+ // If copying subdirectories, copy them and their contents to new location.
+ if (copySubDirs)
+ {
+ foreach (DirectoryInfo subdir in dirs)
+ {
+ string temppath = Path.Combine(destDirName, subdir.Name);
+ CopyDir(subdir.FullName, temppath, copySubDirs);
+ }
+ }
}
}
}
\ No newline at end of file
diff --git a/h-encore-auto/VitaGuide.xaml b/h-encore-auto/VitaGuide.xaml
new file mode 100644
index 0000000..a2564d1
--- /dev/null
+++ b/h-encore-auto/VitaGuide.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/h-encore-auto/VitaGuide.xaml.cs b/h-encore-auto/VitaGuide.xaml.cs
new file mode 100644
index 0000000..66184bd
--- /dev/null
+++ b/h-encore-auto/VitaGuide.xaml.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+namespace h_encore_auto
+{
+ ///
+ /// Interaction logic for VitaGuide.xaml
+ ///
+ public partial class VitaGuide : Window
+ {
+ int currImg;
+
+ string[] currText = lang.GuideText(Util.GetLang());
+
+ public VitaGuide()
+ {
+ InitializeComponent();
+
+ if (Ref.isSecondGuide == true)
+ currImg = 15;
+ else
+ currImg = 1;
+
+ imgFrame.Source = new BitmapImage(new Uri("/img/" + currImg + ".png", UriKind.Relative));
+ textField.Text = currText[currImg - 1];
+ buttonDone.Visibility = Visibility.Hidden;
+ }
+
+ private void buttonFwd_Click(object sender, RoutedEventArgs e)
+ {
+ currImg++;
+ imgFrame.Source = new BitmapImage(new Uri("/img/" + currImg + ".png", UriKind.Relative));
+ textField.Text = currText[currImg - 1];
+ buttonBck.IsEnabled = true;
+
+ if (currImg == 14 || currImg == 26)
+ {
+ buttonFwd.IsEnabled = false;
+ buttonDone.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ buttonFwd.IsEnabled = true;
+ }
+ }
+
+ private void buttonBck_Click(object sender, RoutedEventArgs e)
+ {
+ currImg--;
+ imgFrame.Source = new BitmapImage(new Uri("/img/" + currImg + ".png", UriKind.Relative));
+ buttonFwd.IsEnabled = true;
+ textField.Text = currText[currImg - 1];
+
+ if (currImg == 1 || currImg == 15)
+ {
+ buttonBck.IsEnabled = false;
+ }
+ else
+ {
+ buttonBck.IsEnabled = true;
+ }
+ }
+ }
+}
diff --git a/h-encore-auto/h-encore-auto.csproj b/h-encore-auto/h-encore-auto.csproj
index 8b750a4..4155c40 100644
--- a/h-encore-auto/h-encore-auto.csproj
+++ b/h-encore-auto/h-encore-auto.csproj
@@ -8,7 +8,7 @@
{9F8577B2-16A2-4147-B264-308B68679F78}
WinExe
h_encore_auto
- h-encore-auto
+ ZUGABE
v4.5.2
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
@@ -53,10 +53,10 @@
4
false
+
+ icon.ico
+
-
- ..\packages\Essy.Tools.InputBox.1.0.0\lib\net20\InputBox.dll
-
@@ -79,20 +79,27 @@
MSBuild:Compile
Designer
+
+ AutoMode.xaml
+
+
-
- MSBuild:Compile
+
+ VitaGuide.xaml
+
+
Designer
+ MSBuild:Compile
App.xaml
Code
-
- MainWindow.xaml
- Code
-
+
+ Designer
+ MSBuild:Compile
+
@@ -131,6 +138,43 @@
false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/h-encore-auto/icon.ico b/h-encore-auto/icon.ico
new file mode 100644
index 0000000..b93cb05
Binary files /dev/null and b/h-encore-auto/icon.ico differ
diff --git a/h-encore-auto/img/1.png b/h-encore-auto/img/1.png
new file mode 100644
index 0000000..51dab39
Binary files /dev/null and b/h-encore-auto/img/1.png differ
diff --git a/h-encore-auto/img/10.png b/h-encore-auto/img/10.png
new file mode 100644
index 0000000..b25b3f9
Binary files /dev/null and b/h-encore-auto/img/10.png differ
diff --git a/h-encore-auto/img/11.png b/h-encore-auto/img/11.png
new file mode 100644
index 0000000..6a94d25
Binary files /dev/null and b/h-encore-auto/img/11.png differ
diff --git a/h-encore-auto/img/12.png b/h-encore-auto/img/12.png
new file mode 100644
index 0000000..65bd5f4
Binary files /dev/null and b/h-encore-auto/img/12.png differ
diff --git a/h-encore-auto/img/13.png b/h-encore-auto/img/13.png
new file mode 100644
index 0000000..c136ddd
Binary files /dev/null and b/h-encore-auto/img/13.png differ
diff --git a/h-encore-auto/img/14.png b/h-encore-auto/img/14.png
new file mode 100644
index 0000000..e3f7a35
Binary files /dev/null and b/h-encore-auto/img/14.png differ
diff --git a/h-encore-auto/img/15.png b/h-encore-auto/img/15.png
new file mode 100644
index 0000000..51dab39
Binary files /dev/null and b/h-encore-auto/img/15.png differ
diff --git a/h-encore-auto/img/16.png b/h-encore-auto/img/16.png
new file mode 100644
index 0000000..ec3357a
Binary files /dev/null and b/h-encore-auto/img/16.png differ
diff --git a/h-encore-auto/img/17.png b/h-encore-auto/img/17.png
new file mode 100644
index 0000000..62a374a
Binary files /dev/null and b/h-encore-auto/img/17.png differ
diff --git a/h-encore-auto/img/18.png b/h-encore-auto/img/18.png
new file mode 100644
index 0000000..c136ddd
Binary files /dev/null and b/h-encore-auto/img/18.png differ
diff --git a/h-encore-auto/img/19.png b/h-encore-auto/img/19.png
new file mode 100644
index 0000000..e3f7a35
Binary files /dev/null and b/h-encore-auto/img/19.png differ
diff --git a/h-encore-auto/img/2.png b/h-encore-auto/img/2.png
new file mode 100644
index 0000000..ec3357a
Binary files /dev/null and b/h-encore-auto/img/2.png differ
diff --git a/h-encore-auto/img/20.png b/h-encore-auto/img/20.png
new file mode 100644
index 0000000..7e57203
Binary files /dev/null and b/h-encore-auto/img/20.png differ
diff --git a/h-encore-auto/img/21.png b/h-encore-auto/img/21.png
new file mode 100644
index 0000000..e6371ad
Binary files /dev/null and b/h-encore-auto/img/21.png differ
diff --git a/h-encore-auto/img/22.png b/h-encore-auto/img/22.png
new file mode 100644
index 0000000..da8d046
Binary files /dev/null and b/h-encore-auto/img/22.png differ
diff --git a/h-encore-auto/img/23.png b/h-encore-auto/img/23.png
new file mode 100644
index 0000000..fd84a77
Binary files /dev/null and b/h-encore-auto/img/23.png differ
diff --git a/h-encore-auto/img/24.png b/h-encore-auto/img/24.png
new file mode 100644
index 0000000..d74c69c
Binary files /dev/null and b/h-encore-auto/img/24.png differ
diff --git a/h-encore-auto/img/25.png b/h-encore-auto/img/25.png
new file mode 100644
index 0000000..226d399
Binary files /dev/null and b/h-encore-auto/img/25.png differ
diff --git a/h-encore-auto/img/3.png b/h-encore-auto/img/3.png
new file mode 100644
index 0000000..62a374a
Binary files /dev/null and b/h-encore-auto/img/3.png differ
diff --git a/h-encore-auto/img/4.png b/h-encore-auto/img/4.png
new file mode 100644
index 0000000..2eb8f2e
Binary files /dev/null and b/h-encore-auto/img/4.png differ
diff --git a/h-encore-auto/img/5.png b/h-encore-auto/img/5.png
new file mode 100644
index 0000000..4047703
Binary files /dev/null and b/h-encore-auto/img/5.png differ
diff --git a/h-encore-auto/img/6.png b/h-encore-auto/img/6.png
new file mode 100644
index 0000000..a645cad
Binary files /dev/null and b/h-encore-auto/img/6.png differ
diff --git a/h-encore-auto/img/7.png b/h-encore-auto/img/7.png
new file mode 100644
index 0000000..d6f3f57
Binary files /dev/null and b/h-encore-auto/img/7.png differ
diff --git a/h-encore-auto/img/8.png b/h-encore-auto/img/8.png
new file mode 100644
index 0000000..84d1363
Binary files /dev/null and b/h-encore-auto/img/8.png differ
diff --git a/h-encore-auto/img/9.PNG b/h-encore-auto/img/9.PNG
new file mode 100644
index 0000000..a066530
Binary files /dev/null and b/h-encore-auto/img/9.PNG differ
diff --git a/h-encore-auto/img/ajax-loader.gif b/h-encore-auto/img/ajax-loader.gif
new file mode 100644
index 0000000..3288d10
Binary files /dev/null and b/h-encore-auto/img/ajax-loader.gif differ
diff --git a/h-encore-auto/img/icon.ico b/h-encore-auto/img/icon.ico
new file mode 100644
index 0000000..b93cb05
Binary files /dev/null and b/h-encore-auto/img/icon.ico differ
diff --git a/h-encore-auto/lang.cs b/h-encore-auto/lang.cs
new file mode 100644
index 0000000..58923be
--- /dev/null
+++ b/h-encore-auto/lang.cs
@@ -0,0 +1,42 @@
+namespace h_encore_auto
+{
+ class lang
+ {
+ public static string[] GuideText(string lang)
+ {
+ if (lang == "en")
+ return guideEN;
+ else
+ return guideEN;
+ }
+
+ private static readonly string[] guideEN= new string[] {
+ "1. On your Vita, open the Content Manager. Make sure your Vita and PC are in the same Network!",
+ "2. Select \"Copy Content\"",
+ "3. If it tries to connect, cancel it.",
+ "4. Select \"PC\"",
+ "5. Select \"Wi-Fi\"",
+ "6. Select \"Register Device\"",
+ "7. Your Computer should show up. Select it.",
+ "8. Enter the code shown or your computer.",
+ "8. Enter the code shown or your computer.",
+ "8. Enter the code shown or your computer.",
+ "9. It should tell you that the device was registered successfully.",
+ "10. After clicking next, please wait.",
+ "11. Select \"PC -> PS Vita System\"",
+ "12. Select \"Applications\"",
+ "1. On your Vita, open the Content Manager. Make sure your Vita and PC are in the same Network!",
+ "2. Select \"Copy Content\"",
+ "3. Wait for it to connect.",
+ "4. Select \"PC -> PS Vita System\"",
+ "5. Select \"Applications\"",
+ "6. Select \"PS Vita\"",
+ "7. Tick \"h-encore\" and click \"copy\". Wait for it to complete and close Content Manager.",
+ "8. Start the new \"h-encore\" bubble.",
+ "9. Select \"Install HENkaku\"",
+ "10. Select \"Download VitaShell\"",
+ "11. Finally, exit.",
+ "Done. Keep in mind that you have to launch h-encore every time you reboot the Vita. \nWhen launched, just press Exit again. This reapplies the exploit."
+ };
+ }
+}
diff --git a/h-encore-auto/packages.config b/h-encore-auto/packages.config
index e4f14b1..65fbff3 100644
--- a/h-encore-auto/packages.config
+++ b/h-encore-auto/packages.config
@@ -1,5 +1,4 @@
-
\ No newline at end of file
diff --git a/h-encore-auto/ref.cs b/h-encore-auto/ref.cs
index 37b205e..f1fde76 100644
--- a/h-encore-auto/ref.cs
+++ b/h-encore-auto/ref.cs
@@ -1,4 +1,5 @@
-using System.IO;
+using System;
+using System.IO;
namespace h_encore_auto
{
@@ -11,21 +12,33 @@ namespace h_encore_auto
public static readonly string urlEntry = "http://ares.dl.playstation.net/cdn/JP0741/PCSG90096_00/xGMrXOkORxWRyqzLMihZPqsXAbAXLzvAdJFqtPJLAZTgOcqJobxQAhLNbgiFydVlcmVOrpZKklOYxizQCRpiLfjeROuWivGXfwgkq.pkg";
public static readonly string url7zr = "https://www.7-zip.org/a/7zr.exe";
public static readonly string url7za = "https://www.7-zip.org/a/7z1805-extra.7z";
+ public static readonly string urlQcma = "https://raw.githubusercontent.com/fyr77/ZUGABE/master/download-resources/Qcma.zip";
+ public static readonly string urlReg = "https://raw.githubusercontent.com/fyr77/ZUGABE/master/download-resources/qcma.reg";
+ public static readonly string urlCreateBat = "https://raw.githubusercontent.com/fyr77/ZUGABE/master/download-resources/create.bat";
+
+ public static readonly string pathCurrPic = "img/1.png";
public static readonly string tempDir = Path.GetTempPath() + @"encore_temp\";
- public static readonly string[] trims = new string[] {
- "movie\\",
- "image\\bg\\",
- "image\\ev\\",
- "image\\icon\\",
- "image\\stitle\\",
- "image\\tachie\\",
- "sound\\bgm\\",
- "sound\\se\\",
- "sound\\sec\\",
- "sound\\voice\\",
- "text\\01\\"
- };
+ public static bool isSecondGuide = false;
+
+ public static bool isQcmaConfigFound = false;
+
+ public static readonly string ProgramFilesx86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
+ public static readonly string ProgramFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
+ public static string longAID = null;
+ public static string shortAID = null;
+ public static readonly string path7z = tempDir + "7za.exe";
+ public static readonly string pathPsvimg = tempDir + "psvimgtools.zip";
+ public static readonly string pathPkg = tempDir + "pkg2zip.zip";
+ public static readonly string pathEnc = tempDir + "h-encore.zip";
+ public static readonly string pathEntry = tempDir + "entryPoint.pkg";
+ public static readonly string pathQcma = tempDir + "qcma.zip";
+ public static readonly string pathQcmaExtracted = tempDir + "Qcma\\";
+ public static readonly string pathBackupReg = tempDir + "backup.reg";
+ public static readonly string pathImportReg = tempDir + "qcma.reg";
+ public static readonly string pathQcmaRes = tempDir + "QcmaRes\\";
+
+ public static bool isRegModified = false;
}
}