| 150 | } |
| 151 | |
| 152 | bool TryFindApplicationTicket(const u64 app_id, Ticket &out_tik) { |
| 153 | ScopedLock lk(g_TicketsLock); |
| 154 | const auto tik_it = std::find_if(g_Tickets.begin(), g_Tickets.end(), [app_id](const Ticket &tik) { |
| 155 | return esGetRightsIdApplicationId(&tik.rights_id) == app_id; |
| 156 | }); |
| 157 | if(tik_it != g_Tickets.end()) { |
| 158 | out_tik = *tik_it; |
| 159 | return true; |
| 160 | } |
| 161 | else { |
| 162 | return false; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | TicketFile ReadTicket(const std::string &path) { |
| 167 | TicketFile tik_file = {}; |