diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt
index 2ac4c204c1..8631b6ab85 100644
--- a/Source/Core/Core/CMakeLists.txt
+++ b/Source/Core/Core/CMakeLists.txt
@@ -7,7 +7,6 @@ set(SRCS
Core.cpp
CoreTiming.cpp
DSPEmulator.cpp
- ec_wii.cpp
GeckoCodeConfig.cpp
GeckoCode.cpp
HotkeyManager.cpp
diff --git a/Source/Core/Core/Core.vcxproj b/Source/Core/Core/Core.vcxproj
index 10e0e019b9..f50a2811de 100644
--- a/Source/Core/Core/Core.vcxproj
+++ b/Source/Core/Core/Core.vcxproj
@@ -92,7 +92,6 @@
-
@@ -343,7 +342,6 @@
-
diff --git a/Source/Core/Core/Core.vcxproj.filters b/Source/Core/Core/Core.vcxproj.filters
index c9f2ea8deb..5af2b51d8c 100644
--- a/Source/Core/Core/Core.vcxproj.filters
+++ b/Source/Core/Core/Core.vcxproj.filters
@@ -169,7 +169,6 @@
-
@@ -895,7 +894,6 @@
-
diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp
index 42f79c9f04..d29d6a6d53 100644
--- a/Source/Core/Core/IOS/ES/ES.cpp
+++ b/Source/Core/Core/IOS/ES/ES.cpp
@@ -27,7 +27,6 @@
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/IOSC.h"
#include "Core/IOS/VersionInfo.h"
-#include "Core/ec_wii.h"
namespace IOS
{
@@ -218,9 +217,7 @@ bool ES::LaunchTitle(u64 title_id, bool skip_reload)
NOTICE_LOG(IOS_ES, "Launching title %016" PRIx64 "...", title_id);
- u32 device_id;
- if (title_id == Titles::SHOP &&
- (GetDeviceId(&device_id) != IPC_SUCCESS || device_id == DEFAULT_WII_DEVICE_ID))
+ if (title_id == Titles::SHOP && m_ios.GetIOSC().IsUsingDefaultId())
{
ERROR_LOG(IOS_ES, "Refusing to launch the shop channel with default device credentials");
CriticalAlertT("You cannot use the Wii Shop Channel without using your own device credentials."
diff --git a/Source/Core/Core/IOS/ES/Identity.cpp b/Source/Core/Core/IOS/ES/Identity.cpp
index dd6c342a48..18771d86e5 100644
--- a/Source/Core/Core/IOS/ES/Identity.cpp
+++ b/Source/Core/Core/IOS/ES/Identity.cpp
@@ -10,7 +10,6 @@
#include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h"
#include "Core/IOS/ES/Formats.h"
-#include "Core/ec_wii.h"
namespace IOS
{
@@ -20,8 +19,7 @@ namespace Device
{
ReturnCode ES::GetDeviceId(u32* device_id) const
{
- const EcWii& ec = EcWii::GetInstance();
- *device_id = ec.GetNGID();
+ *device_id = m_ios.GetIOSC().GetDeviceId();
INFO_LOG(IOS_ES, "GetDeviceId: %08X", *device_id);
return IPC_SUCCESS;
}
@@ -92,10 +90,9 @@ IPCCommandResult ES::GetDeviceCertificate(const IOCtlVRequest& request)
return GetDefaultReply(ES_EINVAL);
INFO_LOG(IOS_ES, "IOCTL_ES_GETDEVICECERT");
- u8* destination = Memory::GetPointer(request.io_vectors[0].address);
- const EcWii& ec = EcWii::GetInstance();
- MakeNGCert(destination, ec.GetNGID(), ec.GetNGKeyID(), ec.GetNGPriv(), ec.GetNGSig());
+ const auto cert = m_ios.GetIOSC().GetDeviceCertificate();
+ Memory::CopyToEmu(request.io_vectors[0].address, cert.data(), cert.size());
return GetDefaultReply(IPC_SUCCESS);
}
@@ -113,10 +110,7 @@ IPCCommandResult ES::Sign(const IOCtlVRequest& request)
if (!m_title_context.active)
return GetDefaultReply(ES_EINVAL);
- const EcWii& ec = EcWii::GetInstance();
- MakeAPSigAndCert(sig_out, ap_cert_out, m_title_context.tmd.GetTitleId(), data, data_size,
- ec.GetNGPriv(), ec.GetNGID());
-
+ m_ios.GetIOSC().Sign(sig_out, ap_cert_out, m_title_context.tmd.GetTitleId(), data, data_size);
return GetDefaultReply(IPC_SUCCESS);
}
} // namespace Device
diff --git a/Source/Core/Core/IOS/ES/TitleManagement.cpp b/Source/Core/Core/IOS/ES/TitleManagement.cpp
index 4a7660fd52..f656e58ac7 100644
--- a/Source/Core/Core/IOS/ES/TitleManagement.cpp
+++ b/Source/Core/Core/IOS/ES/TitleManagement.cpp
@@ -21,7 +21,6 @@
#include "Core/CommonTitles.h"
#include "Core/HW/Memmap.h"
#include "Core/IOS/ES/Formats.h"
-#include "Core/ec_wii.h"
namespace IOS
{
@@ -63,7 +62,7 @@ ReturnCode ES::ImportTicket(const std::vector& ticket_bytes, const std::vect
return ES_EINVAL;
const u32 ticket_device_id = ticket.GetDeviceId();
- const u32 device_id = EcWii::GetInstance().GetNGID();
+ const u32 device_id = m_ios.GetIOSC().GetDeviceId();
if (type == TicketImportType::PossiblyPersonalised && ticket_device_id != 0)
{
if (device_id != ticket_device_id)
diff --git a/Source/Core/Core/IOS/IOSC.cpp b/Source/Core/Core/IOS/IOSC.cpp
index edb6fdf734..bfe7024ddf 100644
--- a/Source/Core/Core/IOS/IOSC.cpp
+++ b/Source/Core/Core/IOS/IOSC.cpp
@@ -6,6 +6,7 @@
#include
#include
+#include
#include
#include
#include