mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-06-07 15:14:58 -06:00
use trivially copyable uint32be
This commit is contained in:
parent
67718881f8
commit
1dbdbcc23d
@ -772,7 +772,7 @@ namespace nsyshid
|
|||||||
// Seed is the first 4 bytes (little endian) of the decrypted payload
|
// Seed is the first 4 bytes (little endian) of the decrypted payload
|
||||||
uint32 seed = (uint32&)value[0];
|
uint32 seed = (uint32&)value[0];
|
||||||
// Confirmation is the second 4 bytes (big endian) of the decrypted payload
|
// Confirmation is the second 4 bytes (big endian) of the decrypted payload
|
||||||
uint32 conf = uint32be::from_bevalue((uint32&)value[4]);
|
uint32 conf = (uint32be&)value[4];
|
||||||
// Initialize rng using the seed from decrypted payload
|
// Initialize rng using the seed from decrypted payload
|
||||||
InitializeRNG(seed);
|
InitializeRNG(seed);
|
||||||
// Encrypt 8 bytes, first 4 bytes is the decrypted confirmation from payload, 2nd 4 bytes are blank
|
// Encrypt 8 bytes, first 4 bytes is the decrypted confirmation from payload, 2nd 4 bytes are blank
|
||||||
@ -792,7 +792,7 @@ namespace nsyshid
|
|||||||
// Decrypt payload into an 8 byte array
|
// Decrypt payload into an 8 byte array
|
||||||
std::array<uint8, 8> value = Decrypt(buf, std::nullopt);
|
std::array<uint8, 8> value = Decrypt(buf, std::nullopt);
|
||||||
// Confirmation is the first 4 bytes of the decrypted payload
|
// Confirmation is the first 4 bytes of the decrypted payload
|
||||||
uint32 conf = uint32be::from_bevalue((uint32&)value[0]);
|
uint32 conf = (uint32be&)value[0];
|
||||||
// Generate next random number based on RNG
|
// Generate next random number based on RNG
|
||||||
uint32 nextRandom = GetNext();
|
uint32 nextRandom = GetNext();
|
||||||
// Encrypt an 8 byte array, first 4 bytes are the next random number (little endian)
|
// Encrypt an 8 byte array, first 4 bytes are the next random number (little endian)
|
||||||
@ -961,7 +961,7 @@ namespace nsyshid
|
|||||||
|
|
||||||
std::array<uint8, 4> randomized = DimensionsRandomize(toScramble, count);
|
std::array<uint8, 4> randomized = DimensionsRandomize(toScramble, count);
|
||||||
|
|
||||||
return uint32be::from_bevalue((uint32&)randomized[0]);
|
return (uint32be&)randomized[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<uint8, 4> DimensionsUSB::PWDGenerate(const std::array<uint8, 0x2D * 0x04>& buf)
|
std::array<uint8, 4> DimensionsUSB::PWDGenerate(const std::array<uint8, 0x2D * 0x04>& buf)
|
||||||
@ -1075,7 +1075,7 @@ namespace nsyshid
|
|||||||
// Decrypt payload to 8 byte array, byte 1 is the index, 4-7 are the confirmation
|
// Decrypt payload to 8 byte array, byte 1 is the index, 4-7 are the confirmation
|
||||||
std::array<uint8, 8> value = Decrypt(buf, std::nullopt);
|
std::array<uint8, 8> value = Decrypt(buf, std::nullopt);
|
||||||
uint8 index = value[0];
|
uint8 index = value[0];
|
||||||
uint32 conf = uint32be::from_bevalue((uint32&)value[4]);
|
uint32 conf = (uint32be&)value[4];
|
||||||
// Response is the figure's id (little endian) followed by the confirmation from payload
|
// Response is the figure's id (little endian) followed by the confirmation from payload
|
||||||
// Index from game begins at 1 rather than 0, so minus 1 here
|
// Index from game begins at 1 rather than 0, so minus 1 here
|
||||||
std::array<uint8, 8> valueToEncrypt = {};
|
std::array<uint8, 8> valueToEncrypt = {};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user