From 650071c3e4c4c05e570ab89d89d8c3cf8c8e5f51 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 28 Jan 2017 18:01:40 -0500 Subject: [PATCH] ec_wii: Make getter functions const member functions --- Source/Core/Core/IOS/ES/ES.cpp | 6 +++--- Source/Core/Core/IOS/Network/Net.cpp | 2 +- Source/Core/Core/ec_wii.cpp | 8 ++++---- Source/Core/Core/ec_wii.h | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index b974c92a7c..1cca391ff0 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -490,7 +490,7 @@ IPCCommandResult ES::ESGetDeviceID(const IOCtlVRequest& request) { _dbg_assert_msg_(IOS_ES, request.io_vectors.size() == 1, "IOCTL_ES_GETDEVICEID no io vectors"); - EcWii& ec = EcWii::GetInstance(); + const EcWii& ec = EcWii::GetInstance(); INFO_LOG(IOS_ES, "IOCTL_ES_GETDEVICEID %08X", ec.getNgId()); Memory::Write_U32(ec.getNgId(), request.io_vectors[0].address); return GetDefaultReply(IPC_SUCCESS); @@ -1246,7 +1246,7 @@ IPCCommandResult ES::GetDeviceCertificate(const IOCtlVRequest& request) _dbg_assert_(IOS_ES, request.io_vectors.size() == 1); u8* destination = Memory::GetPointer(request.io_vectors[0].address); - EcWii& ec = EcWii::GetInstance(); + const EcWii& ec = EcWii::GetInstance(); get_ng_cert(destination, ec.getNgId(), ec.getNgKeyId(), ec.getNgPriv(), ec.getNgSig()); return GetDefaultReply(IPC_SUCCESS); } @@ -1259,7 +1259,7 @@ IPCCommandResult ES::Sign(const IOCtlVRequest& request) u32 data_size = request.in_vectors[0].size; u8* sig_out = Memory::GetPointer(request.io_vectors[0].address); - EcWii& ec = EcWii::GetInstance(); + const EcWii& ec = EcWii::GetInstance(); get_ap_sig_and_cert(sig_out, ap_cert_out, m_TitleID, data, data_size, ec.getNgPriv(), ec.getNgId()); diff --git a/Source/Core/Core/IOS/Network/Net.cpp b/Source/Core/Core/IOS/Network/Net.cpp index 5380bdfcb6..a8b26e9b55 100644 --- a/Source/Core/Core/IOS/Network/Net.cpp +++ b/Source/Core/Core/IOS/Network/Net.cpp @@ -149,7 +149,7 @@ IPCCommandResult NetKDRequest::IOCtl(const IOCtlRequest& request) u8 id_ctr = config.IdGen(); u8 hardware_model = GetHardwareModel(model); - EcWii& ec = EcWii::GetInstance(); + const EcWii& ec = EcWii::GetInstance(); u32 HollywoodID = ec.getNgId(); u64 UserID = 0; diff --git a/Source/Core/Core/ec_wii.cpp b/Source/Core/Core/ec_wii.cpp index a0fbd33d16..ba7fea7fcd 100644 --- a/Source/Core/Core/ec_wii.cpp +++ b/Source/Core/Core/ec_wii.cpp @@ -160,22 +160,22 @@ EcWii::~EcWii() { } -u32 EcWii::getNgId() +u32 EcWii::getNgId() const { return Common::swap32(BootMiiKeysBin.ng_id); } -u32 EcWii::getNgKeyId() +u32 EcWii::getNgKeyId() const { return Common::swap32(BootMiiKeysBin.ng_key_id); } -const u8* EcWii::getNgPriv() +const u8* EcWii::getNgPriv() const { return BootMiiKeysBin.ng_priv; } -const u8* EcWii::getNgSig() +const u8* EcWii::getNgSig() const { return BootMiiKeysBin.ng_sig; } diff --git a/Source/Core/Core/ec_wii.h b/Source/Core/Core/ec_wii.h index d69bd9d911..b3117fb907 100644 --- a/Source/Core/Core/ec_wii.h +++ b/Source/Core/Core/ec_wii.h @@ -39,10 +39,10 @@ public: EcWii(); ~EcWii(); static EcWii& GetInstance(); - u32 getNgId(); - u32 getNgKeyId(); - const u8* getNgPriv(); - const u8* getNgSig(); + u32 getNgId() const; + u32 getNgKeyId() const; + const u8* getNgPriv() const; + const u8* getNgSig() const; private: void InitDefaults();