diff options
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/nfc/common/device.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp index e5de65ce0..9b0685bdb 100644 --- a/src/core/hle/service/nfc/common/device.cpp +++ b/src/core/hle/service/nfc/common/device.cpp | |||
| @@ -227,11 +227,20 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const { | |||
| 227 | return ResultWrongDeviceState; | 227 | return ResultWrongDeviceState; |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | UniqueSerialNumber uuid = encrypted_tag_data.uuid.uid; | ||
| 231 | |||
| 232 | // Generate random UUID to bypass amiibo load limits | ||
| 233 | if (Settings::values.random_amiibo_id) { | ||
| 234 | Common::TinyMT rng{}; | ||
| 235 | rng.GenerateRandomBytes(uuid.data(), sizeof(UniqueSerialNumber)); | ||
| 236 | uuid[3] = 0x88 ^ uuid[0] ^ uuid[1] ^ uuid[2]; | ||
| 237 | } | ||
| 238 | |||
| 230 | if (is_mifare) { | 239 | if (is_mifare) { |
| 231 | tag_info = { | 240 | tag_info = { |
| 232 | .uuid = encrypted_tag_data.uuid.uid, | 241 | .uuid = uuid, |
| 233 | .uuid_extension = {}, | 242 | .uuid_extension = {}, |
| 234 | .uuid_length = static_cast<u8>(encrypted_tag_data.uuid.uid.size()), | 243 | .uuid_length = static_cast<u8>(uuid.size()), |
| 235 | .protocol = NfcProtocol::TypeA, | 244 | .protocol = NfcProtocol::TypeA, |
| 236 | .tag_type = TagType::Type4, | 245 | .tag_type = TagType::Type4, |
| 237 | }; | 246 | }; |
| @@ -240,9 +249,9 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const { | |||
| 240 | 249 | ||
| 241 | // Protocol and tag type may change here | 250 | // Protocol and tag type may change here |
| 242 | tag_info = { | 251 | tag_info = { |
| 243 | .uuid = encrypted_tag_data.uuid.uid, | 252 | .uuid = uuid, |
| 244 | .uuid_extension = {}, | 253 | .uuid_extension = {}, |
| 245 | .uuid_length = static_cast<u8>(encrypted_tag_data.uuid.uid.size()), | 254 | .uuid_length = static_cast<u8>(uuid.size()), |
| 246 | .protocol = NfcProtocol::TypeA, | 255 | .protocol = NfcProtocol::TypeA, |
| 247 | .tag_type = TagType::Type2, | 256 | .tag_type = TagType::Type2, |
| 248 | }; | 257 | }; |