diff options
| author | PavelBARABANOV <pavelbarabanov94@gmail.com> | 2026-10-15 08:45:15 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-10-15 08:45:15 +0200 |
| commit | e255c20db4111485d228c10478bda63aabcfdde5 (patch) | |
| tree | 1f8c88981b60e9a4db4ed306742196b1c4b68116 /src/core/hle/service/spl/spl.cpp | |
| parent | 14da4482a4668928bad43bb67ef12f96b9c9d972 (diff) | |
Revert "[hle] constexpr handler dispatch maps, introduce version gating (#4480)" (#4532)
This reverts commit 218c6705d950635bc18f8458d738a1996fb592b6.
- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md).
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.
-------------------
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4532
Reviewed-by: lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Diffstat (limited to 'src/core/hle/service/spl/spl.cpp')
| -rw-r--r-- | src/core/hle/service/spl/spl.cpp | 171 |
1 files changed, 165 insertions, 6 deletions
diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index ad0251fac5..81be99c360 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp @@ -8,22 +8,181 @@ namespace Service::SPL { -SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:") {} +SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL::~SPL() = default; -SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:mig") {} +SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:mig") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, &SPL::GenerateAesKek, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, &SPL::GenerateAesKey, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_MIG::~SPL_MIG() = default; -SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:fs") {} +SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:fs") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {9, nullptr, "ImportLotusKey"}, + {10, nullptr, "DecryptLotusMessage"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {12, nullptr, "GenerateSpecificAesKey"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {19, nullptr, "LoadTitleKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {31, nullptr, "GetPackage2Hash"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_FS::~SPL_FS() = default; -SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:ssl") {} +SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:ssl") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {26, nullptr, "DecryptAndStoreSslClientCertKey"}, + {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_SSL::~SPL_SSL() = default; -SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:es") {} +SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:es") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {17, nullptr, "ImportEsKey"}, + {18, nullptr, "UnwrapTitleKey"}, + {20, nullptr, "PrepareEsCommonKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, + {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, + {31, nullptr, "PrepareEsArchiveKey"}, + {32, nullptr, "LoadPreparedAesKey"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_ES::~SPL_ES() = default; -SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:manu") {} +SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:manu") { + // clang-format off + static const FunctionInfo functions[] = { + {0, &SPL::GetConfig, "GetConfig"}, + {1, &SPL::ModularExponentiate, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, &SPL::SetConfig, "SetConfig"}, + {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"}, + {11, &SPL::IsDevelopment, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, &SPL::SetBootReason, "SetBootReason"}, + {25, &SPL::GetBootReason, "GetBootReason"}, + {30, nullptr, "ReencryptDeviceUniqueData"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + SPL_MANU::~SPL_MANU() = default; } // namespace Service::SPL |
