diff --git a/Source/Utility/Cipher/CipherPrimitives.cpp b/Source/Utility/Cipher/CipherPrimitives.cpp index fed00462b..f7ab20239 100644 --- a/Source/Utility/Cipher/CipherPrimitives.cpp +++ b/Source/Utility/Cipher/CipherPrimitives.cpp @@ -595,16 +595,20 @@ unsigned int* CryptonSetKey(const unsigned int* input, unsigned int keyBits) { // OFFSET: 0x00B0BDD0 // FUNCTION: fn_18399 void StoreLittleEndian32(unsigned int value, unsigned char* bytes) { - bytes[0] = static_cast(value); - bytes[1] = static_cast(value >> 8); - bytes[2] = static_cast(value >> 16); - bytes[3] = static_cast(value >> 24); + *bytes++ = static_cast(value); + *bytes++ = static_cast(value >> 8); + *bytes++ = static_cast(value >> 16); + *bytes = static_cast(value >> 24); } // OFFSET: 0x00B0C3D0 // FUNCTION: fn_18400 unsigned int LoadLittleEndian32(const unsigned char* bytes) { - return ((((static_cast(bytes[3]) << 8) | bytes[2]) << 8 | bytes[1]) << 8) | bytes[0]; + unsigned char b0 = *bytes++; + unsigned char b1 = *bytes++; + unsigned char b2 = *bytes++; + unsigned char b3 = *bytes; + return ((((static_cast(b3) << 8) | b2) << 8 | b1) << 8) | b0; } // OFFSET: 0x00B0C440