Experimental SELF decryption support

This SELF decryption feature is not portable and its code looks really
ugly. It is experimental and is meant to save time to developers when
doing tests with SELF files. Besides that, it works (under Windows). :-)

How to use it:
1. Place "scetool.exe" (and "zlib1.dll") into the main rpcs3 folder.

2. Obtain a LEGAL copy of the SELF decryption keys and place them in a
folder named "data" next to the main executable in a format that is
readable for "scetool.exe". That is, following files should be present:
data/keys
data/ldr_curves
data/vsh_curves

(See screenshot in the comments)

NOTE: These are the steps to enable SELF decryption and it applies to
future commits regarding this matter. We do NOT take any responsibility
about the way you obtain the keys or (until we include SELF decryption
into our code) the actions "scetool.exe" (or "zlib1.dll") perform.
This commit is contained in:
Alexandro Sánchez Bach 2013-10-14 21:40:44 +02:00
parent 5874a5683e
commit c1565e55e5
3 changed files with 30 additions and 8 deletions

2
.gitignore vendored
View File

@ -22,6 +22,7 @@
*.log
*.exe
*.dll
*.elf
*.lastbuildstate
*.unsuccessfulbuild
@ -39,4 +40,5 @@
/bin/VertexProgram.txt
/bin/BreakPoints.dat
/bin/textures
/bin/data/
rpcs3/git-version.h

View File

@ -322,7 +322,7 @@ void Emulator::LoadPoints(const wxString& path)
if(version != bpdb_version ||
(sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != f.Length())
{
ConLog.Error("'%s' is borken", path);
ConLog.Error("'%s' is broken", path);
return;
}

View File

@ -60,8 +60,8 @@ MainFrame::MainFrame()
menu_boot.Append(id_boot_game, "Boot game");
menu_boot.AppendSeparator();
menu_boot.Append(id_boot_elf, "Boot Elf");
//menu_boot.Append(id_boot_self, "Boot Self");
menu_boot.Append(id_boot_elf, "Boot ELF");
menu_boot.Append(id_boot_self, "Boot SELF");
menu_sys.Append(id_sys_pause, "Pause")->Enable(false);
menu_sys.Append(id_sys_stop, "Stop\tCtrl + S")->Enable(false);
@ -188,14 +188,14 @@ void MainFrame::BootElf(wxCommandEvent& WXUNUSED(event))
return;
}
ConLog.Write("Elf: booting...");
ConLog.Write("ELF: booting...");
Emu.Stop();
Emu.SetPath(ctrl.GetPath());
Emu.Load();
ConLog.Write("Elf: boot done.");
ConLog.Write("ELF: boot done.");
}
void MainFrame::BootSelf(wxCommandEvent& WXUNUSED(event))
@ -221,8 +221,28 @@ void MainFrame::BootSelf(wxCommandEvent& WXUNUSED(event))
Emu.Stop();
Emu.SetPath(ctrl.GetPath());
if (!wxFileExists("scetool.exe"))
{
ConLog.Error("Could not load SELF file: scetool.exe is missing");
return;
}
if (!wxFileExists("data/keys") ||
!wxFileExists("data/ldr_curves") ||
!wxFileExists("data/vsh_curves"))
{
ConLog.Error("Could not load SELF file: Key files are missing");
return;
}
//(TODO: This is not portable. I should feel bad for this)
wxString cmd = "scetool.exe -d";
cmd += " " + ctrl.GetPath();
cmd += " " + ctrl.GetPath()+".elf";
system(cmd.mb_str());
Emu.SetPath(ctrl.GetPath()+".elf");
Emu.Load();
if (!wxRemoveFile(ctrl.GetPath()+".elf"))
ConLog.Warning("Could not delete the decrypted ELF file");
ConLog.Write("SELF: boot done.");
}
@ -323,11 +343,11 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_keyboard_handler->Append("Null");
cbox_keyboard_handler->Append("Windows");
//cbox_pad_handler->Append("DirectInput");
//cbox_keyboard_handler->Append("DirectInput");
cbox_mouse_handler->Append("Null");
cbox_mouse_handler->Append("Windows");
//cbox_pad_handler->Append("DirectInput");
//cbox_mouse_handler->Append("DirectInput");
chbox_gs_vsync->SetValue(Ini.GSVSyncEnable.GetValue());