diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-04-10 20:07:49 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-07-08 03:38:33 +0200 |
commit | c6a32dc077f3d55421898294ada0a5fe93400b9e (patch) | |
tree | 21593192a8c19f5f335dcbdb48f2a9b93960d3a8 /src/core | |
parent | es: Implement ETicket GetPersonalizedTicketSize (15) (diff) | |
download | yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.gz yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.bz2 yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.lz yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.xz yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.zst yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/es/es.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index e18f27e7a..8a29453d7 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -31,7 +31,7 @@ public: {13, nullptr, "ListMissingPersonalizedTicket"}, {14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, {15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, - {16, nullptr, "GetCommonTicketData"}, + {16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, {17, nullptr, "GetPersonalizedTicketData"}, {18, nullptr, "OwnTicket"}, {19, nullptr, "GetTicketInfo"}, @@ -222,6 +222,25 @@ private: rb.Push<u64>(ticket.size()); } + void GetCommonTicketData(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto rights_id = rp.PopRaw<u128>(); + + LOG_DEBUG(Service_ETicket, "called, rights_id={:016X}{:016X}", rights_id[1], rights_id[0]); + + if (!CheckRightsId(ctx, rights_id)) + return; + + const auto ticket = keys.GetCommonTickets().at(rights_id); + + const auto write_size = std::min(ticket.size(), ctx.GetWriteBufferSize()); + ctx.WriteBuffer(ticket.data(), write_size); + + IPC::ResponseBuilder rb{ctx, 4}; + rb.Push(RESULT_SUCCESS); + rb.Push<u64>(write_size); + } + }; void InstallInterfaces(SM::ServiceManager& service_manager) { |