misc: chore: Fix object creation in HLE project

This commit is contained in:
Evan Husted
2025-01-26 15:15:26 -06:00
parent f1fd5c9366
commit beab133c8d
48 changed files with 194 additions and 194 deletions

View File

@@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
string nickName = amiiboDump.AmiiboNickname;
LogFinalData(titleId, appId, head, tail, finalID, nickName, initDateTime, writeDateTime, settingsValue, writeCounterValue, applicationAreas);
VirtualAmiiboFile virtualAmiiboFile = new VirtualAmiiboFile
VirtualAmiiboFile virtualAmiiboFile = new()
{
FileVersion = 1,
TagUuid = uid,
@@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
readBytes = newFileBytes;
}
AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath);
AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath);
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
byte[] oldData = amiiboDump.GetData();
@@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
readBytes = newFileBytes;
}
AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath);
AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath);
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
amiiboDump.AmiiboNickname = newNickName;
byte[] oldData = amiiboDump.GetData();

View File

@@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(seedBytes, 0, dataForAes, 2, seedBytes.Length);
byte[] derivedBytes;
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
using (HMACSHA256 hmac = new(key.HmacKey))
{
derivedBytes = hmac.ComputeHash(dataForAes);
}
@@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
dataForHmacKey[1] = 0x01; // Counter (1)
Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length);
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
using (HMACSHA256 hmac = new(key.HmacKey))
{
derivedBytes = hmac.ComputeHash(dataForHmacKey);
}
@@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length);
byte[] derivedBytes;
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
using (HMACSHA256 hmac = new(key.HmacKey))
{
derivedBytes = hmac.ComputeHash(dataForHmacKey);
}
@@ -229,7 +229,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(data, 0x054, tagHmacData, 8, 44);
byte[] tagHmac;
using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey))
using (HMACSHA256 hmac = new(hmacTagKey))
{
tagHmac = hmac.ComputeHash(tagHmacData);
}
@@ -258,7 +258,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(data, 0x054, dataHmacData, offset, len5);
byte[] dataHmac;
using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey))
using (HMACSHA256 hmac = new(hmacDataKey))
{
dataHmac = hmac.ComputeHash(dataHmacData);
}
@@ -278,7 +278,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(data, 0x054, tagHmacData, 8, 44);
byte[] calculatedTagHmac;
using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey))
using (HMACSHA256 hmac = new(hmacTagKey))
{
calculatedTagHmac = hmac.ComputeHash(tagHmacData);
}
@@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
Array.Copy(data, 0x054, dataHmacData, offset, len5);
byte[] calculatedDataHmac;
using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey))
using (HMACSHA256 hmac = new(hmacDataKey))
{
calculatedDataHmac = hmac.ComputeHash(dataHmacData);
}