From e9f23fbc9244c4046f5ade0702de639fdf6e4cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 28 Feb 2017 18:42:06 +0100 Subject: [PATCH] ESFormats: Fix calculation of the ticket start offset The signature part doesn't seem to appear more than once in a signed ticket, so we should always add that offset regardless of the ticket number. --- Source/Core/Core/IOS/ES/Formats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/ES/Formats.cpp b/Source/Core/Core/IOS/ES/Formats.cpp index 34e82db850..38e285285c 100644 --- a/Source/Core/Core/IOS/ES/Formats.cpp +++ b/Source/Core/Core/IOS/ES/Formats.cpp @@ -234,7 +234,7 @@ const std::vector& TicketReader::GetRawTicket() const std::vector TicketReader::GetRawTicketView(u32 ticket_num) const { // A ticket view is composed of a view ID + part of a ticket starting from the ticket_id field. - const auto ticket_start = m_bytes.cbegin() + (GetOffset() + sizeof(Ticket)) * ticket_num; + const auto ticket_start = m_bytes.cbegin() + GetOffset() + sizeof(Ticket) * ticket_num; const auto view_start = ticket_start + offsetof(Ticket, ticket_id); // Copy the view ID to the buffer.