Permalink
Browse files

Rename CWiiSaveCrypted to WiiSave

  • Loading branch information...
leoetlino committed May 12, 2018
1 parent 5564150 commit 00bc1f28f2f644abac649221c6530501206f91f3
@@ -150,7 +150,7 @@ add_library(core
HW/WiimoteEmu/Encryption.cpp
HW/WiimoteEmu/Speaker.cpp
HW/WiimoteReal/WiimoteReal.cpp
HW/WiiSaveCrypted.cpp
HW/WiiSave.cpp
IOS/Device.cpp
IOS/DeviceStub.cpp
IOS/IOS.cpp
@@ -179,7 +179,7 @@
<ClCompile Include="HW\WiimoteReal\IOWin.cpp" />
<ClCompile Include="HW\WiimoteReal\WiimoteReal.cpp" />
<ClCompile Include="HW\WII_IPC.cpp" />
<ClCompile Include="HW\WiiSaveCrypted.cpp" />
<ClCompile Include="HW\WiiSave.cpp" />
<ClCompile Include="IOS\Device.cpp" />
<ClCompile Include="IOS\DeviceStub.cpp" />
<ClCompile Include="IOS\IOS.cpp" />
@@ -437,7 +437,7 @@
<ClInclude Include="HW\WiimoteEmu\WiimoteHid.h" />
<ClInclude Include="HW\WiimoteReal\WiimoteReal.h" />
<ClInclude Include="HW\WiimoteReal\WiimoteRealBase.h" />
<ClInclude Include="HW\WiiSaveCrypted.h" />
<ClInclude Include="HW\WiiSave.h" />
<ClInclude Include="HW\WII_IPC.h" />
<ClInclude Include="IOS\Device.h" />
<ClInclude Include="IOS\DeviceStub.h" />
@@ -561,7 +561,7 @@
<ClCompile Include="HW\SystemTimers.cpp">
<Filter>HW %28Flipper/Hollywood%29</Filter>
</ClCompile>
<ClCompile Include="HW\WiiSaveCrypted.cpp">
<ClCompile Include="HW\WiiSave.cpp">
<Filter>HW %28Flipper/Hollywood%29</Filter>
</ClCompile>
<ClCompile Include="DSP\DSPAssembler.cpp">
@@ -1242,7 +1242,7 @@
<ClInclude Include="HW\SystemTimers.h">
<Filter>HW %28Flipper/Hollywood%29</Filter>
</ClInclude>
<ClInclude Include="HW\WiiSaveCrypted.h">
<ClInclude Include="HW\WiiSave.h">
<Filter>HW %28Flipper/Hollywood%29</Filter>
</ClInclude>
<ClInclude Include="DSP\DSPAssembler.h">
@@ -1578,4 +1578,4 @@
<ItemGroup>
<Text Include="CMakeLists.txt" />
</ItemGroup>
</Project>
</Project>
@@ -7,7 +7,7 @@
// Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#include "Core/HW/WiiSaveCrypted.h"
#include "Core/HW/WiiSave.h"
#include <cinttypes>
#include <cstddef>
@@ -31,21 +31,21 @@
#include "Common/StringUtil.h"
#include "Common/Swap.h"
const u8 CWiiSaveCrypted::s_sd_key[16] = {0xAB, 0x01, 0xB9, 0xD8, 0xE1, 0x62, 0x2B, 0x08,
0xAF, 0xBA, 0xD8, 0x4D, 0xBF, 0xC2, 0xA5, 0x5D};
const u8 CWiiSaveCrypted::s_md5_blanker[16] = {0x0E, 0x65, 0x37, 0x81, 0x99, 0xBE, 0x45, 0x17,
0xAB, 0x06, 0xEC, 0x22, 0x45, 0x1A, 0x57, 0x93};
const u32 CWiiSaveCrypted::s_ng_id = 0x0403AC68;
const u8 WiiSave::s_sd_key[16] = {0xAB, 0x01, 0xB9, 0xD8, 0xE1, 0x62, 0x2B, 0x08,
0xAF, 0xBA, 0xD8, 0x4D, 0xBF, 0xC2, 0xA5, 0x5D};
const u8 WiiSave::s_md5_blanker[16] = {0x0E, 0x65, 0x37, 0x81, 0x99, 0xBE, 0x45, 0x17,
0xAB, 0x06, 0xEC, 0x22, 0x45, 0x1A, 0x57, 0x93};
const u32 WiiSave::s_ng_id = 0x0403AC68;
bool CWiiSaveCrypted::ImportWiiSave(const std::string& filename)
bool WiiSave::ImportWiiSave(const std::string& filename)
{
CWiiSaveCrypted save_file(filename);
WiiSave save_file(filename);
return save_file.m_valid;
}
bool CWiiSaveCrypted::ExportWiiSave(u64 title_id)
bool WiiSave::ExportWiiSave(u64 title_id)
{
CWiiSaveCrypted export_save("", title_id);
WiiSave export_save("", title_id);
if (export_save.m_valid)
{
SuccessAlertT("Successfully exported file to %s", export_save.m_encrypted_save_path.c_str());
@@ -57,7 +57,7 @@ bool CWiiSaveCrypted::ExportWiiSave(u64 title_id)
return export_save.m_valid;
}
void CWiiSaveCrypted::ExportAllSaves()
void WiiSave::ExportAllSaves()
{
std::string title_folder = File::GetUserPath(D_WIIROOT_IDX) + "/title";
std::vector<u64> titles;
@@ -89,15 +89,15 @@ void CWiiSaveCrypted::ExportAllSaves()
u32 success = 0;
for (const u64& title : titles)
{
CWiiSaveCrypted export_save{"", title};
WiiSave export_save{"", title};
if (export_save.m_valid)
success++;
}
SuccessAlertT("Successfully exported %u save(s) to %s", success,
(File::GetUserPath(D_USER_IDX) + "private/wii/title/").c_str());
}
CWiiSaveCrypted::CWiiSaveCrypted(const std::string& filename, u64 title_id)
WiiSave::WiiSave(const std::string& filename, u64 title_id)
: m_encrypted_save_path(filename), m_title_id(title_id)
{
memcpy(m_sd_iv, "\x21\x67\x12\xE6\xAA\x1F\x68\x9F\x95\xC5\xA2\x23\x24\xDC\x6A\x98", 0x10);
@@ -134,7 +134,7 @@ CWiiSaveCrypted::CWiiSaveCrypted(const std::string& filename, u64 title_id)
}
}
void CWiiSaveCrypted::ReadHDR()
void WiiSave::ReadHDR()
{
File::IOFile data_file(m_encrypted_save_path, "rb");
if (!data_file)
@@ -197,7 +197,7 @@ void CWiiSaveCrypted::ReadHDR()
}
}
void CWiiSaveCrypted::WriteHDR()
void WiiSave::WriteHDR()
{
if (!m_valid)
return;
@@ -236,7 +236,7 @@ void CWiiSaveCrypted::WriteHDR()
}
}
void CWiiSaveCrypted::ReadBKHDR()
void WiiSave::ReadBKHDR()
{
if (!m_valid)
return;
@@ -282,7 +282,7 @@ void CWiiSaveCrypted::ReadBKHDR()
}
}
void CWiiSaveCrypted::WriteBKHDR()
void WiiSave::WriteBKHDR()
{
if (!m_valid)
return;
@@ -307,7 +307,7 @@ void CWiiSaveCrypted::WriteBKHDR()
}
}
void CWiiSaveCrypted::ImportWiiSaveFiles()
void WiiSave::ImportWiiSaveFiles()
{
if (!m_valid)
return;
@@ -391,7 +391,7 @@ void CWiiSaveCrypted::ImportWiiSaveFiles()
}
}
void CWiiSaveCrypted::ExportWiiSaveFiles()
void WiiSave::ExportWiiSaveFiles()
{
if (!m_valid)
return;
@@ -471,7 +471,7 @@ void CWiiSaveCrypted::ExportWiiSaveFiles()
}
}
void CWiiSaveCrypted::do_sig()
void WiiSave::do_sig()
{
if (!m_valid)
return;
@@ -550,8 +550,8 @@ void CWiiSaveCrypted::do_sig()
m_valid = data_file.IsGood();
}
void CWiiSaveCrypted::make_ec_cert(u8* cert, const u8* sig, const char* signer, const char* name,
const u8* priv, const u32 key_id)
void WiiSave::make_ec_cert(u8* cert, const u8* sig, const char* signer, const char* name,
const u8* priv, const u32 key_id)
{
memset(cert, 0, 0x180);
*(u32*)cert = Common::swap32(0x10002);
@@ -564,7 +564,7 @@ void CWiiSaveCrypted::make_ec_cert(u8* cert, const u8* sig, const char* signer,
ec_priv_to_pub(priv, cert + 0x108);
}
bool CWiiSaveCrypted::getPaths(bool for_export)
bool WiiSave::getPaths(bool for_export)
{
if (m_title_id)
{
@@ -606,9 +606,8 @@ bool CWiiSaveCrypted::getPaths(bool for_export)
return true;
}
void CWiiSaveCrypted::ScanForFiles(const std::string& save_directory,
std::vector<std::string>& file_list, u32* num_files,
u32* size_files)
void WiiSave::ScanForFiles(const std::string& save_directory, std::vector<std::string>& file_list,
u32* num_files, u32* size_files)
{
std::vector<std::string> directories;
directories.push_back(save_directory);
@@ -653,6 +652,6 @@ void CWiiSaveCrypted::ScanForFiles(const std::string& save_directory,
*size_files = size;
}
CWiiSaveCrypted::~CWiiSaveCrypted()
WiiSave::~WiiSave()
{
}
@@ -10,16 +10,16 @@
#include "Common/CommonTypes.h"
class CWiiSaveCrypted
class WiiSave
{
public:
bool static ImportWiiSave(const std::string& filename);
bool static ExportWiiSave(u64 title_id);
void static ExportAllSaves();
private:
CWiiSaveCrypted(const std::string& filename, u64 title_id = 0);
~CWiiSaveCrypted();
WiiSave(const std::string& filename, u64 title_id = 0);
~WiiSave();
void ReadHDR();
void ReadBKHDR();
void WriteHDR();
@@ -20,7 +20,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/WiiSaveCrypted.h"
#include "Core/HW/WiiSave.h"
#include "Core/WiiUtils.h"
#include "DiscIO/Blob.h"
#include "DiscIO/Enums.h"
@@ -260,7 +260,7 @@ void GameList::ExportWiiSave()
{
QMessageBox result_dialog(this);
const bool success = CWiiSaveCrypted::ExportWiiSave(GetSelectedGame()->GetTitleID());
const bool success = WiiSave::ExportWiiSave(GetSelectedGame()->GetTitleID());
result_dialog.setIcon(success ? QMessageBox::Information : QMessageBox::Critical);
result_dialog.setText(success ? tr("Successfully exported save files") :
@@ -26,7 +26,7 @@
#include "Core/Core.h"
#include "Core/Debugger/RSO.h"
#include "Core/HLE/HLE.h"
#include "Core/HW/WiiSaveCrypted.h"
#include "Core/HW/WiiSave.h"
#include "Core/HW/Wiimote.h"
#include "Core/Host.h"
#include "Core/IOS/ES/ES.h"
@@ -897,12 +897,12 @@ void MenuBar::ImportWiiSave()
"All Files (*)"));
if (!file.isEmpty())
CWiiSaveCrypted::ImportWiiSave(file.toStdString());
WiiSave::ImportWiiSave(file.toStdString());
}
void MenuBar::ExportWiiSaves()
{
CWiiSaveCrypted::ExportAllSaves();
WiiSave::ExportAllSaves();
}
void MenuBar::CheckNAND()
@@ -45,7 +45,7 @@
#include "Core/HW/GCPad.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/HW/SI/SI_Device.h"
#include "Core/HW/WiiSaveCrypted.h"
#include "Core/HW/WiiSave.h"
#include "Core/HW/Wiimote.h"
#include "Core/Host.h"
#include "Core/HotkeyManager.h"
@@ -1204,7 +1204,7 @@ void CFrame::OnLoadGameCubeIPLEUR(wxCommandEvent&)
void CFrame::OnExportAllSaves(wxCommandEvent& WXUNUSED(event))
{
CWiiSaveCrypted::ExportAllSaves();
WiiSave::ExportAllSaves();
}
void CFrame::OnImportSave(wxCommandEvent& WXUNUSED(event))
@@ -1215,7 +1215,7 @@ void CFrame::OnImportSave(wxCommandEvent& WXUNUSED(event))
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST, this);
if (!path.IsEmpty())
CWiiSaveCrypted::ImportWiiSave(WxStrToStr(path));
WiiSave::ImportWiiSave(WxStrToStr(path));
}
void CFrame::OnShowCheatsWindow(wxCommandEvent& WXUNUSED(event))
@@ -45,7 +45,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/HW/DVD/DVDInterface.h"
#include "Core/HW/WiiSaveCrypted.h"
#include "Core/HW/WiiSave.h"
#include "Core/Movie.h"
#include "Core/SysConf.h"
#include "Core/TitleDatabase.h"
@@ -988,7 +988,7 @@ void GameListCtrl::OnExportSave(wxCommandEvent& WXUNUSED(event))
{
const UICommon::GameFile* iso = GetSelectedISO();
if (iso)
CWiiSaveCrypted::ExportWiiSave(iso->GetTitleID());
WiiSave::ExportWiiSave(iso->GetTitleID());
}
// Save this file as the default file

0 comments on commit 00bc1f2

Please sign in to comment.