(DecryptHelper4): cosmetic changes.

This commit is contained in:
morkt 2016-08-29 05:44:05 +04:00
parent 52b1f58dec
commit 14f88049fc

View File

@ -367,54 +367,41 @@ namespace GameRes.Formats.ShiinaRio
uint k3 = key[3]; uint k3 = key[3];
uint k4 = key[4]; uint k4 = key[4];
uint pc = 0; for (int buf_idx = 0; buf_idx < 0x50; ++buf_idx)
uint v26 = 0;
int buf_idx = 0;
for (int ebp = 0; ebp < 0x50; ++ebp)
{ {
if (ebp >= 0x10) uint f, c;
if (buf_idx < 0x10)
{ {
if (ebp >= 0x20) f = k1 ^ k2 ^ k3;
c = 0;
}
else if (buf_idx < 0x20)
{ {
if (ebp >= 0x30) f = k1 & k2 | k3 & ~k1;
c = 0x5A827999;
}
else if (buf_idx < 0x30)
{ {
uint v27 = ~k3; f = k3 ^ (k1 | ~k2);
if (ebp >= 0x40) c = 0x6ED9EBA1;
}
else if (buf_idx < 0x40)
{ {
v26 = k1 ^ (k2 | v27); f = k1 & k3 | k2 & ~k3;
pc = 0xA953FD4E; c = 0x8F1BBCDC;
} }
else else
{ {
v26 = k1 & k3 | k2 & v27; f = k1 ^ (k2 | ~k3);
pc = 0x8F1BBCDC; c = 0xA953FD4E;
} }
} uint new_k0 = buf[buf_idx] + k4 + f + c + Binary.RotL (k0, 5);
else
{
v26 = k3 ^ (k1 | ~k2);
pc = 0x6ED9EBA1;
}
}
else
{
v26 = k1 & k2 | k3 & ~k1;
pc = 0x5A827999;
}
}
else
{
v26 = k1 ^ k2 ^ k3;
pc = 0;
}
uint new_k0 = buf[buf_idx] + k4 + v26 + pc + Binary.RotL (k0, 5);
uint new_k2 = Binary.RotR (k1, 2); uint new_k2 = Binary.RotR (k1, 2);
k1 = k0; k1 = k0;
k4 = k3; k4 = k3;
k3 = k2; k3 = k2;
k2 = new_k2; k2 = new_k2;
k0 = new_k0; k0 = new_k0;
++buf_idx;
} }
key[0] += k0; key[0] += k0;
key[1] += k1; key[1] += k1;