Compare commits
1 Commits
agent/data
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
beaf3fcf8c |
@@ -53,9 +53,9 @@ Progress
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 95.31% | 82.61% | 58.19% | 89.47% |
|
||||
| 95.37% | 82.76% | 58.19% | 89.47% |
|
||||
|
||||
units 777/1027 complete, functions 11962/12563 matched.
|
||||
units 777/1027 complete, functions 11967/12563 matched.
|
||||
|
||||
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
|
||||
<!-- progress:end -->
|
||||
|
||||
@@ -878,8 +878,8 @@ config.libs = [
|
||||
Object(Matching, "scene/setting/iplAOSSThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSSLink.c"),
|
||||
Object(NonMatching, "scene/setting/iplRakuRakuThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSS.c"),
|
||||
Object(NonMatching, "scene/setting/ATERM.c"),
|
||||
Object(NonMatching, "scene/setting/AOSS.c", extra_cflags=["-O4,p", "-inline off"]),
|
||||
Object(NonMatching, "scene/setting/ATERM.c", extra_cflags=["-O4,p", "-inline off"]),
|
||||
]
|
||||
),
|
||||
IPLSection("settingSelect", [
|
||||
|
||||
@@ -1850,13 +1850,10 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
|
||||
u32 controlFlags;
|
||||
u32 checksum;
|
||||
u32 i;
|
||||
u32 pairCount;
|
||||
u32 firstIndex;
|
||||
u32 secondIndex;
|
||||
u32 firstValue;
|
||||
u32 secondValue;
|
||||
u32 swapValue;
|
||||
u32 crcLimit;
|
||||
u32 crc;
|
||||
u8* outputCursor;
|
||||
const u8* inputCursor;
|
||||
@@ -1903,11 +1900,9 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
|
||||
AOSS_81401C9C(&schedule, s_packetState.keyNonce,
|
||||
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), dataLength);
|
||||
|
||||
i = 0;
|
||||
outputCursor = decryptedData;
|
||||
inputCursor = message->payload.encrypted.data;
|
||||
pairCount = dataLength >> 1;
|
||||
while (pairCount != 0) {
|
||||
for (i = 0; i < dataLength; i++) {
|
||||
firstIndex = ((schedule.i + 1) % schedule.length) & 0xff;
|
||||
firstValue = schedule.bytes[firstIndex];
|
||||
secondIndex = ((firstValue + schedule.j) % schedule.length) & 0xff;
|
||||
@@ -1916,54 +1911,13 @@ int AOSS_81400830(AOSSDecryptionMessage* message) {
|
||||
schedule.j = secondIndex;
|
||||
schedule.bytes[secondIndex] = (u8)firstValue;
|
||||
schedule.bytes[firstIndex] = (u8)secondValue;
|
||||
outputCursor[0] = schedule.bytes[(firstValue + secondValue) % schedule.length] ^ inputCursor[0];
|
||||
schedule.i = ((firstIndex + 1) % schedule.length) & 0xff;
|
||||
firstIndex = schedule.bytes[schedule.i];
|
||||
secondIndex = ((firstIndex + secondIndex) % schedule.length) & 0xff;
|
||||
swapValue = schedule.bytes[secondIndex];
|
||||
schedule.bytes[secondIndex] = (u8)firstIndex;
|
||||
schedule.bytes[schedule.i] = (u8)swapValue;
|
||||
outputCursor[1] = schedule.bytes[(firstIndex + swapValue) % schedule.length] ^ inputCursor[1];
|
||||
schedule.j = secondIndex;
|
||||
outputCursor += 2;
|
||||
inputCursor += 2;
|
||||
i += 2;
|
||||
pairCount--;
|
||||
}
|
||||
if ((dataLength & 1) != 0) {
|
||||
firstIndex = ((schedule.i + 1) % schedule.length) & 0xff;
|
||||
firstValue = schedule.bytes[firstIndex];
|
||||
secondIndex = ((firstValue + schedule.j) % schedule.length) & 0xff;
|
||||
secondValue = schedule.bytes[secondIndex];
|
||||
schedule.i = firstIndex;
|
||||
schedule.j = secondIndex;
|
||||
schedule.bytes[secondIndex] = (u8)firstValue;
|
||||
schedule.bytes[firstIndex] = (u8)secondValue;
|
||||
outputCursor[0] = schedule.bytes[(firstValue + secondValue) % schedule.length] ^ inputCursor[0];
|
||||
schedule.i = firstIndex;
|
||||
schedule.j = secondIndex;
|
||||
*outputCursor++ = schedule.bytes[(firstValue + secondValue) % schedule.length] ^ *inputCursor++;
|
||||
}
|
||||
|
||||
AOSS_81401DC0(0, s_crcTable);
|
||||
crc = 0xffffffff;
|
||||
i = 0;
|
||||
crcLimit = dataLength - 8;
|
||||
if ((s32)dataLength > 8 && (s32)dataLength >= 0 && (s32)dataLength <= 0x7ffffffe) {
|
||||
while ((s32)i < (s32)crcLimit) {
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 1]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 2]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 3]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 4]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 5]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 6]) & 0xff];
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i + 7]) & 0xff];
|
||||
i += 8;
|
||||
}
|
||||
}
|
||||
while (i < dataLength) {
|
||||
for (i = 0; i < dataLength; i++) {
|
||||
crc = (crc >> 8) ^ s_crcTable[(crc ^ decryptedData[i]) & 0xff];
|
||||
i++;
|
||||
}
|
||||
if (((crc ^ 0xffffffff) & 0xff) != checksum) {
|
||||
s_errorCode = 0x12;
|
||||
@@ -2021,9 +1975,7 @@ int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
|
||||
const AOSSOptionRecord* record;
|
||||
s32 length;
|
||||
s32 index;
|
||||
s32 bulkLimit;
|
||||
u32 value;
|
||||
u32 remaining;
|
||||
u16 nextOffset;
|
||||
const u8* valueBytes;
|
||||
|
||||
@@ -2054,35 +2006,8 @@ int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
|
||||
case 5:
|
||||
value = 0;
|
||||
valueBytes = record->data;
|
||||
index = 0;
|
||||
if (length > 0) {
|
||||
bulkLimit = length - 8;
|
||||
if (length > 8) {
|
||||
int canUnroll = length >= 0 && length <= 0x7ffffffe;
|
||||
if (canUnroll) {
|
||||
if (bulkLimit > 0) {
|
||||
for (; index < bulkLimit; index += 8) {
|
||||
value = (value << 8) + valueBytes[0];
|
||||
value = (value << 8) + valueBytes[1];
|
||||
value = (value << 8) + valueBytes[2];
|
||||
value = (value << 8) + valueBytes[3];
|
||||
value = (value << 8) + valueBytes[4];
|
||||
value = (value << 8) + valueBytes[5];
|
||||
value = (value << 8) + valueBytes[6];
|
||||
value = (value << 8) + valueBytes[7];
|
||||
valueBytes += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
remaining = length - index;
|
||||
if ((int)index < (int)length) {
|
||||
do {
|
||||
value = (value << 8) + *valueBytes;
|
||||
valueBytes++;
|
||||
remaining--;
|
||||
} while (remaining != 0);
|
||||
for (index = 0; index < length; index++) {
|
||||
value = (value << 8) + *valueBytes++;
|
||||
}
|
||||
value = SONtoHl(value);
|
||||
s_runtime.ipAddress = value;
|
||||
@@ -2090,35 +2015,8 @@ int AOSS_81400E0C(const AOSSOptionRecord* packet, u8* settings) {
|
||||
case 6:
|
||||
value = 0;
|
||||
valueBytes = record->data;
|
||||
index = 0;
|
||||
if (length > 0) {
|
||||
bulkLimit = length - 8;
|
||||
if (length > 8) {
|
||||
int canUnroll = length >= 0 && length <= 0x7ffffffe;
|
||||
if (canUnroll) {
|
||||
if (bulkLimit > 0) {
|
||||
for (; index < bulkLimit; index += 8) {
|
||||
value = (value << 8) + valueBytes[0];
|
||||
value = (value << 8) + valueBytes[1];
|
||||
value = (value << 8) + valueBytes[2];
|
||||
value = (value << 8) + valueBytes[3];
|
||||
value = (value << 8) + valueBytes[4];
|
||||
value = (value << 8) + valueBytes[5];
|
||||
value = (value << 8) + valueBytes[6];
|
||||
value = (value << 8) + valueBytes[7];
|
||||
valueBytes += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
remaining = length - index;
|
||||
if ((int)index < (int)length) {
|
||||
do {
|
||||
value = (value << 8) + *valueBytes;
|
||||
valueBytes++;
|
||||
remaining--;
|
||||
} while (remaining != 0);
|
||||
for (index = 0; index < length; index++) {
|
||||
value = (value << 8) + *valueBytes++;
|
||||
}
|
||||
value = SONtoHl(value);
|
||||
s_runtime.subnetMask = value;
|
||||
@@ -2277,8 +2175,7 @@ int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength
|
||||
if (responseRecord->fields.type == s_responseTypeByState[state]) {
|
||||
break;
|
||||
}
|
||||
length = SONtoHs(responseRecord->fields.length);
|
||||
length += 4;
|
||||
length = SONtoHs(responseRecord->fields.length) + 4;
|
||||
remainingLength -= length;
|
||||
responseRecord = (const AOSSReplyOption*)&responseRecord->bytes[length];
|
||||
if (remainingLength <= 0) {
|
||||
@@ -2334,8 +2231,7 @@ int AOSS_814013AC(int state, const AOSSReplyOption* response, int responseLength
|
||||
return result;
|
||||
}
|
||||
|
||||
length = SONtoHs(option->fields.length);
|
||||
length += 4;
|
||||
length = SONtoHs(option->fields.length) + 4;
|
||||
remainingLength -= length;
|
||||
option = (const AOSSReplyOption*)&option->bytes[length];
|
||||
} while (remainingLength > 0);
|
||||
@@ -2559,23 +2455,8 @@ void AOSS_81401C9C(AOSSKeySchedule* schedule, const u8* key, u32 keyLength, u32
|
||||
state = schedule->bytes;
|
||||
schedule->i = 0;
|
||||
schedule->length = stateLength;
|
||||
if (stateLength != 0) {
|
||||
if (stateLength > 8) {
|
||||
for (; index < stateLength - 8; index += 8) {
|
||||
state[index] = (u8)index;
|
||||
state[index + 1] = (u8)(index + 1);
|
||||
state[index + 2] = (u8)(index + 2);
|
||||
state[index + 3] = (u8)(index + 3);
|
||||
state[index + 4] = (u8)(index + 4);
|
||||
state[index + 5] = (u8)(index + 5);
|
||||
state[index + 6] = (u8)(index + 6);
|
||||
state[index + 7] = (u8)(index + 7);
|
||||
}
|
||||
}
|
||||
|
||||
for (; index < stateLength; index++) {
|
||||
state[index] = (u8)index;
|
||||
}
|
||||
for (index = 0; index < stateLength; index++) {
|
||||
state[index] = (u8)index;
|
||||
}
|
||||
index = 0;
|
||||
for (; index < stateLength; index++) {
|
||||
@@ -2599,22 +2480,13 @@ void AOSS_81401DC0(u32 seed, u32* table) {
|
||||
|
||||
for (index = 0; index < 0x100; index++) {
|
||||
value = index;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
{
|
||||
u32 bit;
|
||||
for (bit = 0; bit < 8; bit++) {
|
||||
if ((value & 1) != 0) value = (value >> 1) ^ 0xedb88320;
|
||||
else value >>= 1;
|
||||
}
|
||||
}
|
||||
*table++ = value;
|
||||
}
|
||||
}
|
||||
@@ -2628,7 +2500,6 @@ int AOSS_81401E80(void* packet, s32 length, const char* key, int keyLength) {
|
||||
s32 index;
|
||||
s32 keyIndex;
|
||||
int result = -1;
|
||||
int unrollAllowed;
|
||||
|
||||
keyMask = (u8*)AOSSi_Alloc(halfLength);
|
||||
if (keyMask == 0) {
|
||||
@@ -2652,27 +2523,8 @@ int AOSS_81401E80(void* packet, s32 length, const char* key, int keyLength) {
|
||||
}
|
||||
}
|
||||
|
||||
index = 0;
|
||||
if (halfLength > 0) {
|
||||
s32 bulkLimit = halfLength - 8;
|
||||
if (halfLength > 8) {
|
||||
unrollAllowed = halfLength >= 0 && halfLength <= 0x7ffffffe;
|
||||
if (unrollAllowed != 0) {
|
||||
for (; index < bulkLimit; index += 8) {
|
||||
packetBytes[halfLength + index] ^= keyMask[index];
|
||||
packetBytes[halfLength + index + 1] ^= keyMask[index + 1];
|
||||
packetBytes[halfLength + index + 2] ^= keyMask[index + 2];
|
||||
packetBytes[halfLength + index + 3] ^= keyMask[index + 3];
|
||||
packetBytes[halfLength + index + 4] ^= keyMask[index + 4];
|
||||
packetBytes[halfLength + index + 5] ^= keyMask[index + 5];
|
||||
packetBytes[halfLength + index + 6] ^= keyMask[index + 6];
|
||||
packetBytes[halfLength + index + 7] ^= keyMask[index + 7];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (; index < halfLength; index++) {
|
||||
packetBytes[halfLength + index] ^= keyMask[index];
|
||||
}
|
||||
for (index = 0; index < halfLength; index++) {
|
||||
packetBytes[halfLength + index] ^= keyMask[index];
|
||||
}
|
||||
|
||||
memcpy(temporary, packetBytes + halfLength, halfLength);
|
||||
@@ -2715,8 +2567,9 @@ int AOSS_814020CC(void* settings, void* config) {
|
||||
OSSleepTicks((OSTime)(ticksPerMillisecond * 100));
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#include <revolution/so/SOBasic.h>
|
||||
#include <private/wd.h>
|
||||
|
||||
static const u32 gAtermAesTables[10][256] = {
|
||||
{
|
||||
static const u32 gAtermAesEncryptTable0[256] = {
|
||||
0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
|
||||
0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a,
|
||||
0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
|
||||
@@ -42,8 +41,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
|
||||
0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8,
|
||||
0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesEncryptTable1[256] = {
|
||||
0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
|
||||
0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676,
|
||||
0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
|
||||
@@ -76,8 +75,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
|
||||
0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868,
|
||||
0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesEncryptTable2[256] = {
|
||||
0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
|
||||
0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76,
|
||||
0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
|
||||
@@ -110,8 +109,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
|
||||
0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068,
|
||||
0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesEncryptTable3[256] = {
|
||||
0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
|
||||
0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec,
|
||||
0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
|
||||
@@ -144,8 +143,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
|
||||
0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0,
|
||||
0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesSubstitutionTable[256] = {
|
||||
0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b, 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5,
|
||||
0x30303030, 0x01010101, 0x67676767, 0x2b2b2b2b, 0xfefefefe, 0xd7d7d7d7, 0xabababab, 0x76767676,
|
||||
0xcacacaca, 0x82828282, 0xc9c9c9c9, 0x7d7d7d7d, 0xfafafafa, 0x59595959, 0x47474747, 0xf0f0f0f0,
|
||||
@@ -178,8 +177,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x9b9b9b9b, 0x1e1e1e1e, 0x87878787, 0xe9e9e9e9, 0xcececece, 0x55555555, 0x28282828, 0xdfdfdfdf,
|
||||
0x8c8c8c8c, 0xa1a1a1a1, 0x89898989, 0x0d0d0d0d, 0xbfbfbfbf, 0xe6e6e6e6, 0x42424242, 0x68686868,
|
||||
0x41414141, 0x99999999, 0x2d2d2d2d, 0x0f0f0f0f, 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesDecryptTable0[256] = {
|
||||
0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
|
||||
0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f,
|
||||
0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6,
|
||||
@@ -212,8 +211,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86,
|
||||
0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541,
|
||||
0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesDecryptTable1[256] = {
|
||||
0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
|
||||
0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3,
|
||||
0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9,
|
||||
@@ -246,8 +245,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db,
|
||||
0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95,
|
||||
0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesDecryptTable2[256] = {
|
||||
0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
|
||||
0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562,
|
||||
0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3,
|
||||
@@ -280,8 +279,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844,
|
||||
0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d,
|
||||
0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesDecryptTable3[256] = {
|
||||
0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
|
||||
0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5,
|
||||
0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b,
|
||||
@@ -314,8 +313,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678,
|
||||
0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff,
|
||||
0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0
|
||||
},
|
||||
{
|
||||
};
|
||||
static const u32 gAtermAesInverseSubstitutionTable[256] = {
|
||||
0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5, 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838,
|
||||
0xbfbfbfbf, 0x40404040, 0xa3a3a3a3, 0x9e9e9e9e, 0x81818181, 0xf3f3f3f3, 0xd7d7d7d7, 0xfbfbfbfb,
|
||||
0x7c7c7c7c, 0xe3e3e3e3, 0x39393939, 0x82828282, 0x9b9b9b9b, 0x2f2f2f2f, 0xffffffff, 0x87878787,
|
||||
@@ -348,8 +347,8 @@ static const u32 gAtermAesTables[10][256] = {
|
||||
0xc8c8c8c8, 0xebebebeb, 0xbbbbbbbb, 0x3c3c3c3c, 0x83838383, 0x53535353, 0x99999999, 0x61616161,
|
||||
0x17171717, 0x2b2b2b2b, 0x04040404, 0x7e7e7e7e, 0xbabababa, 0x77777777, 0xd6d6d6d6, 0x26262626,
|
||||
0xe1e1e1e1, 0x69696969, 0x14141414, 0x63636363, 0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
static const u32 gAtermAesRoundConstants[10] = {
|
||||
0x1000000, 0x2000000, 0x4000000, 0x8000000, 0x10000000,
|
||||
0x20000000, 0x40000000, 0x80000000, 0x1b000000, 0x36000000
|
||||
@@ -810,8 +809,8 @@ int ATERM_8140276C(AtermApRecordSet* currentRecords, AtermApRecordSet* previousR
|
||||
|
||||
if (!found) {
|
||||
AtermSsidBuffer aossSsidName;
|
||||
int previousHasAoss = 0;
|
||||
int currentHasAoss = 0;
|
||||
int previousHasAoss = 0;
|
||||
|
||||
aossSsidName.clear.word0 = 0;
|
||||
aossSsidName.clear.word1 = 0;
|
||||
@@ -837,8 +836,7 @@ int ATERM_8140276C(AtermApRecordSet* currentRecords, AtermApRecordSet* previousR
|
||||
previousRecord++;
|
||||
}
|
||||
|
||||
currentRecord = currentRecords->entries;
|
||||
for (; currentIndex < currentRecords->count; currentIndex++) {
|
||||
for (currentIndex = 0; currentIndex < currentRecords->count; currentIndex++) {
|
||||
memcpy(aossSsidName.text, currentRecord->ssid, sizeof(currentRecord->ssid));
|
||||
aossSsidName.text[currentRecord->ssidLength] = '\0';
|
||||
aossLength = strlen(gAtermAossSsid);
|
||||
@@ -1031,10 +1029,8 @@ cleanup:
|
||||
|
||||
int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloadLength,
|
||||
void* encryptionKey) {
|
||||
s32 byteLength;
|
||||
u8* end;
|
||||
u8* cursor;
|
||||
u8* limit;
|
||||
u32 checksum = 0;
|
||||
|
||||
memset(payload, 0, 8);
|
||||
@@ -1052,24 +1048,8 @@ int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloa
|
||||
end = (u8*)(messageBuffer + 3);
|
||||
end += payloadLength;
|
||||
cursor = (u8*)messageBuffer;
|
||||
if ((u8*)messageBuffer < end) {
|
||||
byteLength = end - (u8*)messageBuffer;
|
||||
limit = end - 8;
|
||||
if (byteLength > 8 && cursor <= end) {
|
||||
for (; cursor < limit; cursor += 8) {
|
||||
checksum += cursor[0];
|
||||
checksum += cursor[1];
|
||||
checksum += cursor[2];
|
||||
checksum += cursor[3];
|
||||
checksum += cursor[4];
|
||||
checksum += cursor[5];
|
||||
checksum += cursor[6];
|
||||
checksum += cursor[7];
|
||||
}
|
||||
}
|
||||
while (cursor < end) {
|
||||
checksum += *cursor++;
|
||||
}
|
||||
for (; cursor < end; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
*(u16*)end = SOHtoNs(checksum);
|
||||
return (int)(end + sizeof(u16) - (u8*)messageBuffer);
|
||||
@@ -1078,7 +1058,6 @@ int ATERM_81402E40(u16* messageBuffer, u32 sequence, u16* payload, size_t payloa
|
||||
int ATERM_81402FC0(AtermPacket* packet, u32* setupType) {
|
||||
u8* cursor;
|
||||
u8* end;
|
||||
u8* limit;
|
||||
u8* payload;
|
||||
u8* value;
|
||||
u32 checksum = 0;
|
||||
@@ -1090,30 +1069,13 @@ int ATERM_81402FC0(AtermPacket* packet, u32* setupType) {
|
||||
s32 networkReady;
|
||||
s32 selectedMode;
|
||||
AtermPacketOption* option;
|
||||
s32 byteLength;
|
||||
|
||||
messageType = SONtoHs(packet->sequence);
|
||||
payloadLength = SONtoHs(packet->length);
|
||||
cursor = (u8*)packet;
|
||||
end = packet->payload + payloadLength;
|
||||
if (cursor < end) {
|
||||
byteLength = end - cursor;
|
||||
limit = end - 8;
|
||||
if (byteLength > 8 && cursor <= end) {
|
||||
for (; cursor < limit; cursor += 8) {
|
||||
checksum += cursor[0];
|
||||
checksum += cursor[1];
|
||||
checksum += cursor[2];
|
||||
checksum += cursor[3];
|
||||
checksum += cursor[4];
|
||||
checksum += cursor[5];
|
||||
checksum += cursor[6];
|
||||
checksum += cursor[7];
|
||||
}
|
||||
}
|
||||
while (cursor < end) {
|
||||
checksum += *cursor++;
|
||||
}
|
||||
for (; cursor < end; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
if ((u16)checksum != SONtoHs(*(u16*)end)) {
|
||||
payload = NULL;
|
||||
@@ -1196,7 +1158,7 @@ int ATERM_814031DC(AtermAssociationRequest* request) {
|
||||
const u8* addressCursor = interfaceMacAddress;
|
||||
int addressIndex;
|
||||
char* textCursor = interfaceMacText;
|
||||
for (addressIndex = 0; addressIndex < 6; addressIndex++) {
|
||||
for (addressIndex = 0; ; addressIndex++) {
|
||||
u8 addressByte = *addressCursor++;
|
||||
char* encoded = textCursor;
|
||||
s32 highNibble = (addressByte & 0xF0) >> 4;
|
||||
@@ -1213,9 +1175,10 @@ int ATERM_814031DC(AtermAssociationRequest* request) {
|
||||
}
|
||||
*encoded = 0;
|
||||
textCursor += encoded - textCursor;
|
||||
if (addressIndex < 5) {
|
||||
*textCursor++ = ':';
|
||||
if (addressIndex == 5) {
|
||||
break;
|
||||
}
|
||||
*textCursor++ = ':';
|
||||
}
|
||||
*textCursor = '\0';
|
||||
}
|
||||
@@ -1223,7 +1186,7 @@ int ATERM_814031DC(AtermAssociationRequest* request) {
|
||||
const u8* addressCursor = scanAddress;
|
||||
int addressIndex;
|
||||
char* textCursor = scanAddressText;
|
||||
for (addressIndex = 0; addressIndex < 6; addressIndex++) {
|
||||
for (addressIndex = 0; ; addressIndex++) {
|
||||
u8 addressByte = *addressCursor++;
|
||||
char* encoded = textCursor;
|
||||
s32 highNibble = (addressByte & 0xF0) >> 4;
|
||||
@@ -1240,9 +1203,10 @@ int ATERM_814031DC(AtermAssociationRequest* request) {
|
||||
}
|
||||
*encoded = 0;
|
||||
textCursor += encoded - textCursor;
|
||||
if (addressIndex < 5) {
|
||||
*textCursor++ = ':';
|
||||
if (addressIndex == 5) {
|
||||
break;
|
||||
}
|
||||
*textCursor++ = ':';
|
||||
}
|
||||
*textCursor = '\0';
|
||||
}
|
||||
@@ -1333,7 +1297,7 @@ int ATERM_814033F0(u16* response) {
|
||||
optionType = SONtoHs(optionCursor[0]);
|
||||
optionLength = SONtoHs(optionCursor[1]);
|
||||
optionValue = (u8*)(optionCursor + 2);
|
||||
optionCursor = (u16*)((u8*)optionCursor + ((optionLength + 0x0B) & ~7));
|
||||
optionCursor = (u16*)(((optionLength + 0x0B) & ~7) + (u32)optionCursor);
|
||||
}
|
||||
} while (optionValue != NULL);
|
||||
return result;
|
||||
@@ -1641,24 +1605,8 @@ s32 ATERM_814038C8(void) {
|
||||
u8* cursor = packetBuffer;
|
||||
u8* packetEnd = packet->payload + payloadLength;
|
||||
u8* payload = packet->payload;
|
||||
if (cursor < packetEnd) {
|
||||
s32 byteLength = packetEnd - cursor;
|
||||
u8* limit = packetEnd - 8;
|
||||
if (byteLength > 8 && cursor <= packetEnd) {
|
||||
for (; cursor < limit; cursor += 8) {
|
||||
checksum += cursor[0];
|
||||
checksum += cursor[1];
|
||||
checksum += cursor[2];
|
||||
checksum += cursor[3];
|
||||
checksum += cursor[4];
|
||||
checksum += cursor[5];
|
||||
checksum += cursor[6];
|
||||
checksum += cursor[7];
|
||||
}
|
||||
}
|
||||
while (cursor < packetEnd) {
|
||||
checksum += *cursor++;
|
||||
}
|
||||
for (; cursor < packetEnd; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
|
||||
payload = NULL;
|
||||
@@ -1790,24 +1738,8 @@ s32 ATERM_814038C8(void) {
|
||||
u8* cursor = packetBuffer;
|
||||
u8* packetEnd = packet->payload + payloadLength;
|
||||
u8* payload = packet->payload;
|
||||
if (cursor < packetEnd) {
|
||||
s32 byteLength = packetEnd - cursor;
|
||||
u8* limit = packetEnd - 8;
|
||||
if (byteLength > 8 && cursor <= packetEnd) {
|
||||
for (; cursor < limit; cursor += 8) {
|
||||
checksum += cursor[0];
|
||||
checksum += cursor[1];
|
||||
checksum += cursor[2];
|
||||
checksum += cursor[3];
|
||||
checksum += cursor[4];
|
||||
checksum += cursor[5];
|
||||
checksum += cursor[6];
|
||||
checksum += cursor[7];
|
||||
}
|
||||
}
|
||||
while (cursor < packetEnd) {
|
||||
checksum += *cursor++;
|
||||
}
|
||||
for (; cursor < packetEnd; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
|
||||
payload = NULL;
|
||||
@@ -2029,7 +1961,7 @@ int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 key
|
||||
return result;
|
||||
}
|
||||
|
||||
#define ATERM_AES_SUB_BYTE(value) (gAtermAesTables[4][(value)] & 0xFF)
|
||||
#define ATERM_AES_SUB_BYTE(value) (gAtermAesSubstitutionTable[(value)] & 0xFF)
|
||||
#define ATERM_AES_SUB_WORD(value) \
|
||||
((ATERM_AES_SUB_BYTE(((value) >> 24) & 0xFF) << 24) | \
|
||||
(ATERM_AES_SUB_BYTE(((value) >> 16) & 0xFF) << 16) | \
|
||||
@@ -2045,20 +1977,28 @@ int ATERM_81404A18(u16* destination, u16* source, u32 length, void* key, u32 key
|
||||
int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
const u8* keyBytes = (const u8*)key;
|
||||
u32* roundKey = expandedKey;
|
||||
const u32* roundConstant;
|
||||
|
||||
u32 keyWord;
|
||||
u32 firstWord;
|
||||
u32 secondWord;
|
||||
u32 thirdWord;
|
||||
u32 fourthWord;
|
||||
s32 generatedRounds = 0;
|
||||
|
||||
expandedKey[0] = (((u32)keyBytes[3] ^ ((u32)keyBytes[2] << 8)) ^ (((u32)keyBytes[0] << 24) ^ ((u32)keyBytes[1] << 16)));
|
||||
expandedKey[1] = (((u32)keyBytes[7] ^ ((u32)keyBytes[6] << 8)) ^ (((u32)keyBytes[4] << 24) ^ ((u32)keyBytes[5] << 16)));
|
||||
expandedKey[2] = (((u32)keyBytes[11] ^ ((u32)keyBytes[10] << 8)) ^ (((u32)keyBytes[8] << 24) ^ ((u32)keyBytes[9] << 16)));
|
||||
expandedKey[3] = (((u32)keyBytes[15] ^ ((u32)keyBytes[14] << 8)) ^ (((u32)keyBytes[12] << 24) ^ ((u32)keyBytes[13] << 16)));
|
||||
firstWord = (((u32)keyBytes[3] ^ ((u32)keyBytes[2] << 8)) ^ (((u32)keyBytes[0] << 24) ^ ((u32)keyBytes[1] << 16)));
|
||||
secondWord = (((u32)keyBytes[7] ^ ((u32)keyBytes[6] << 8)) ^ (((u32)keyBytes[4] << 24) ^ ((u32)keyBytes[5] << 16)));
|
||||
thirdWord = (((u32)keyBytes[11] ^ ((u32)keyBytes[10] << 8)) ^ (((u32)keyBytes[8] << 24) ^ ((u32)keyBytes[9] << 16)));
|
||||
fourthWord = (((u32)keyBytes[15] ^ ((u32)keyBytes[14] << 8)) ^ (((u32)keyBytes[12] << 24) ^ ((u32)keyBytes[13] << 16)));
|
||||
expandedKey[0] = firstWord;
|
||||
expandedKey[1] = secondWord;
|
||||
expandedKey[2] = thirdWord;
|
||||
expandedKey[3] = fourthWord;
|
||||
|
||||
if ((s32)keyBits == 0x80) {
|
||||
const u32* substitution;
|
||||
const u32* roundConstant;
|
||||
roundConstant = gAtermAesRoundConstants;
|
||||
substitution = gAtermAesTables[4];
|
||||
substitution = gAtermAesSubstitutionTable;
|
||||
do {
|
||||
keyWord = roundKey[3];
|
||||
roundKey[4] = (*roundConstant++ ^ ((substitution[keyWord >> 24] & 0xFF) ^ (substitution[keyWord & 0xFF] & 0xFF00))) ^ ((roundKey[0] ^ (substitution[(keyWord >> 16) & 0xFF] & 0xFF000000)) ^ (substitution[(keyWord >> 8) & 0xFF] & 0xFF0000));
|
||||
@@ -2076,8 +2016,9 @@ int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
expandedKey[5] = (((u32)keyBytes[23] ^ ((u32)keyBytes[22] << 8)) ^ (((u32)keyBytes[20] << 24) ^ ((u32)keyBytes[21] << 16)));
|
||||
if ((s32)keyBits == 0xC0) {
|
||||
const u32* substitution;
|
||||
const u32* roundConstant;
|
||||
roundConstant = gAtermAesRoundConstants;
|
||||
substitution = gAtermAesTables[4];
|
||||
substitution = gAtermAesSubstitutionTable;
|
||||
do {
|
||||
keyWord = roundKey[5];
|
||||
roundKey[6] = (*roundConstant++ ^ ((substitution[keyWord >> 24] & 0xFF) ^ (substitution[keyWord & 0xFF] & 0xFF00))) ^ ((roundKey[0] ^ (substitution[(keyWord >> 16) & 0xFF] & 0xFF000000)) ^ (substitution[(keyWord >> 8) & 0xFF] & 0xFF0000));
|
||||
@@ -2098,8 +2039,9 @@ int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
expandedKey[7] = (((u32)keyBytes[31] ^ ((u32)keyBytes[30] << 8)) ^ (((u32)keyBytes[28] << 24) ^ ((u32)keyBytes[29] << 16)));
|
||||
if ((s32)keyBits == 0x100) {
|
||||
const u32* substitution;
|
||||
const u32* roundConstant;
|
||||
roundConstant = gAtermAesRoundConstants;
|
||||
substitution = gAtermAesTables[4];
|
||||
substitution = gAtermAesSubstitutionTable;
|
||||
do {
|
||||
keyWord = roundKey[7];
|
||||
roundKey[8] = (*roundConstant++ ^ ((substitution[keyWord >> 24] & 0xFF) ^ (substitution[keyWord & 0xFF] & 0xFF00))) ^ ((roundKey[0] ^ (substitution[(keyWord >> 16) & 0xFF] & 0xFF000000)) ^ (substitution[(keyWord >> 8) & 0xFF] & 0xFF0000));
|
||||
@@ -2143,7 +2085,6 @@ int ATERM_81404BFC(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
}
|
||||
|
||||
int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
const u32 (*tables)[256] = gAtermAesTables;
|
||||
int rounds = ATERM_81404BFC(expandedKey, key, keyBits);
|
||||
u32* firstRound = expandedKey;
|
||||
u32* lastRound = expandedKey + rounds * 4;
|
||||
@@ -2186,11 +2127,11 @@ int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
const u32* inverseTable2;
|
||||
const u32* inverseTable3;
|
||||
const u32* substitutionTable;
|
||||
substitutionTable = tables[4];
|
||||
inverseTable3 = tables[8];
|
||||
inverseTable2 = tables[7];
|
||||
inverseTable0 = tables[5];
|
||||
inverseTable1 = tables[6];
|
||||
substitutionTable = gAtermAesSubstitutionTable;
|
||||
inverseTable3 = gAtermAesDecryptTable3;
|
||||
inverseTable2 = gAtermAesDecryptTable2;
|
||||
inverseTable0 = gAtermAesDecryptTable0;
|
||||
inverseTable1 = gAtermAesDecryptTable1;
|
||||
roundKey = expandedKey;
|
||||
for (roundCount = 1; roundCount < rounds; roundCount++) {
|
||||
ATERM_AES_TRANSFORM_KEY(roundKey, 4);
|
||||
@@ -2206,6 +2147,7 @@ int ATERM_8140502C(u32* expandedKey, const void* key, u32 keyBits) {
|
||||
#undef ATERM_AES_TRANSFORM_KEY
|
||||
|
||||
void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
|
||||
s32 roundPairs = (s32)rounds >> 1;
|
||||
u32 state0 = (((u32)input[2] << 8) ^ input[3]) ^
|
||||
(((u32)input[0] << 24) ^ ((u32)input[1] << 16)) ^ expandedKey[0];
|
||||
u32 state1 = (((u32)input[6] << 8) ^ input[7]) ^
|
||||
@@ -2215,11 +2157,10 @@ void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* out
|
||||
u32 state3 = (((u32)input[14] << 8) ^ input[15]) ^
|
||||
(((u32)input[12] << 24) ^ ((u32)input[13] << 16)) ^ expandedKey[3];
|
||||
u32 next0, next1, next2, next3;
|
||||
s32 roundPairs = (s32)rounds >> 1;
|
||||
const u32* roundTable3 = gAtermAesTables[3];
|
||||
const u32* roundTable2 = gAtermAesTables[2];
|
||||
const u32* roundTable0 = gAtermAesTables[0];
|
||||
const u32* roundTable1 = gAtermAesTables[1];
|
||||
const u32* roundTable3 = gAtermAesEncryptTable3;
|
||||
const u32* roundTable2 = gAtermAesEncryptTable2;
|
||||
const u32* roundTable0 = gAtermAesEncryptTable0;
|
||||
const u32* roundTable1 = gAtermAesEncryptTable1;
|
||||
|
||||
for (;;) {
|
||||
next0 = (roundTable3[state3 & 0xFF] ^ roundTable2[(state2 >> 8) & 0xFF]) ^
|
||||
@@ -2245,7 +2186,7 @@ void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* out
|
||||
}
|
||||
|
||||
{
|
||||
const u32* finalTable = gAtermAesTables[4];
|
||||
const u32* finalTable = gAtermAesSubstitutionTable;
|
||||
u32 result0 = (((finalTable[next0 >> 24] & 0xFF000000) |
|
||||
(finalTable[(next1 >> 16) & 0xFF] & 0x00FF0000) |
|
||||
(finalTable[(next2 >> 8) & 0xFF] & 0x0000FF00) |
|
||||
@@ -2283,6 +2224,7 @@ void ATERM_81405254(const u32* expandedKey, u32 rounds, const u8* input, u8* out
|
||||
}
|
||||
|
||||
void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* output) {
|
||||
s32 roundPairs = (s32)rounds >> 1;
|
||||
u32 state0 = (((u32)input[2] << 8) ^ input[3]) ^
|
||||
(((u32)input[0] << 24) ^ ((u32)input[1] << 16)) ^ expandedKey[0];
|
||||
u32 state1 = (((u32)input[6] << 8) ^ input[7]) ^
|
||||
@@ -2292,11 +2234,10 @@ void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* out
|
||||
u32 state3 = (((u32)input[14] << 8) ^ input[15]) ^
|
||||
(((u32)input[12] << 24) ^ ((u32)input[13] << 16)) ^ expandedKey[3];
|
||||
u32 next0, next1, next2, next3;
|
||||
s32 roundPairs = (s32)rounds >> 1;
|
||||
const u32* roundTable3 = gAtermAesTables[8];
|
||||
const u32* roundTable2 = gAtermAesTables[7];
|
||||
const u32* roundTable0 = gAtermAesTables[5];
|
||||
const u32* roundTable1 = gAtermAesTables[6];
|
||||
const u32* roundTable3 = gAtermAesDecryptTable3;
|
||||
const u32* roundTable2 = gAtermAesDecryptTable2;
|
||||
const u32* roundTable0 = gAtermAesDecryptTable0;
|
||||
const u32* roundTable1 = gAtermAesDecryptTable1;
|
||||
|
||||
for (;;) {
|
||||
next0 = roundTable3[state1 & 0xFF] ^ roundTable2[(state2 >> 8) & 0xFF] ^ roundTable0[state0 >> 24] ^ roundTable1[(state3 >> 16) & 0xFF] ^ expandedKey[4];
|
||||
@@ -2314,7 +2255,7 @@ void ATERM_81405690(const u32* expandedKey, u32 rounds, const u8* input, u8* out
|
||||
}
|
||||
|
||||
{
|
||||
const u32* finalTable = gAtermAesTables[9];
|
||||
const u32* finalTable = gAtermAesInverseSubstitutionTable;
|
||||
u32 result0 = (((finalTable[next0 >> 24] & 0xFF000000) |
|
||||
(finalTable[(next3 >> 16) & 0xFF] & 0x00FF0000) |
|
||||
(finalTable[(next2 >> 8) & 0xFF] & 0x0000FF00) |
|
||||
@@ -2367,32 +2308,8 @@ void ATERM_81405ACC(AtermMd5Context* context, const void* input, u32 length) {
|
||||
context->bitCountHigh += length >> 29;
|
||||
bytesToFill = 64 - bufferIndex;
|
||||
if (length >= bytesToFill) {
|
||||
copiedBytes = 0;
|
||||
if (bytesToFill != 0) {
|
||||
u32 groupLimit = bytesToFill - 8;
|
||||
if (bytesToFill > 8) {
|
||||
const u8* inputCursor = data;
|
||||
u8* bufferCursor = context->buffer8 + bufferIndex;
|
||||
for (; copiedBytes < groupLimit; copiedBytes += 8) {
|
||||
bufferCursor[0] = inputCursor[0];
|
||||
bufferCursor[1] = inputCursor[1];
|
||||
bufferCursor[2] = inputCursor[2];
|
||||
bufferCursor[3] = inputCursor[3];
|
||||
bufferCursor[4] = inputCursor[4];
|
||||
bufferCursor[5] = inputCursor[5];
|
||||
bufferCursor[6] = inputCursor[6];
|
||||
bufferCursor[7] = inputCursor[7];
|
||||
inputCursor += 8;
|
||||
bufferCursor += 8;
|
||||
}
|
||||
}
|
||||
{
|
||||
const u8* inputCursor = data + copiedBytes;
|
||||
u8* bufferCursor = context->buffer8 + bufferIndex + copiedBytes;
|
||||
for (; copiedBytes < bytesToFill; copiedBytes++) {
|
||||
*bufferCursor++ = *inputCursor++;
|
||||
}
|
||||
}
|
||||
for (copiedBytes = 0; copiedBytes < bytesToFill; copiedBytes++) {
|
||||
context->buffer8[bufferIndex + copiedBytes] = data[copiedBytes];
|
||||
}
|
||||
ATERM_81405D0C(context->state, context->buffer8);
|
||||
for (copiedBytes = bytesToFill; copiedBytes + 63 < length; copiedBytes += 64) {
|
||||
@@ -2402,70 +2319,32 @@ void ATERM_81405ACC(AtermMd5Context* context, const void* input, u32 length) {
|
||||
} else {
|
||||
copiedBytes = 0;
|
||||
}
|
||||
if (length - copiedBytes != 0) {
|
||||
u32 remainingBytes = length - copiedBytes;
|
||||
u32 groupLimit = remainingBytes - 8;
|
||||
index = 0;
|
||||
if (remainingBytes > 8) {
|
||||
const u8* inputCursor = data + copiedBytes;
|
||||
u8* bufferCursor = context->buffer8 + bufferIndex;
|
||||
for (; index < groupLimit; index += 8) {
|
||||
bufferCursor[0] = inputCursor[0];
|
||||
bufferCursor[1] = inputCursor[1];
|
||||
bufferCursor[2] = inputCursor[2];
|
||||
bufferCursor[3] = inputCursor[3];
|
||||
bufferCursor[4] = inputCursor[4];
|
||||
bufferCursor[5] = inputCursor[5];
|
||||
bufferCursor[6] = inputCursor[6];
|
||||
bufferCursor[7] = inputCursor[7];
|
||||
inputCursor += 8;
|
||||
bufferCursor += 8;
|
||||
}
|
||||
}
|
||||
{
|
||||
const u8* inputCursor = data + copiedBytes + index;
|
||||
u8* bufferCursor = context->buffer8 + bufferIndex + index;
|
||||
for (; index < remainingBytes; index++) {
|
||||
*bufferCursor++ = *inputCursor++;
|
||||
}
|
||||
}
|
||||
for (index = 0; index < length - copiedBytes; index++) {
|
||||
context->buffer8[bufferIndex + index] = data[copiedBytes + index];
|
||||
}
|
||||
}
|
||||
|
||||
#define ATERM_MD5_STEP(A, B, C, D, WORD, CONSTANT, SHIFT, F) \
|
||||
do { \
|
||||
u32 value = (A) + (F) + (WORD) + (CONSTANT); \
|
||||
(A) = (B) + ((value << (SHIFT)) | (value >> (32 - (SHIFT)))); \
|
||||
(A) += (F) + (WORD) + (CONSTANT); \
|
||||
(A) = ((A) << (SHIFT)) | ((A) >> (32 - (SHIFT))); \
|
||||
(A) += (B); \
|
||||
} while (0)
|
||||
|
||||
void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
|
||||
u32 byteIndex;
|
||||
u32 index;
|
||||
const u8* inputWord;
|
||||
u32 words[16];
|
||||
u32 a = state[0];
|
||||
u32 b = state[1];
|
||||
u32 c = state[2];
|
||||
u32 d = state[3];
|
||||
u32 index;
|
||||
|
||||
for (index = 0; index < 2; index++) {
|
||||
const u8* inputGroup = block + index * 32;
|
||||
u32* wordGroup = words + index * 8;
|
||||
|
||||
wordGroup[0] = (u32)inputGroup[0] | ((u32)inputGroup[1] << 8) |
|
||||
((u32)inputGroup[2] << 16) | ((u32)inputGroup[3] << 24);
|
||||
wordGroup[1] = (u32)inputGroup[4] | ((u32)inputGroup[5] << 8) |
|
||||
((u32)inputGroup[6] << 16) | ((u32)inputGroup[7] << 24);
|
||||
wordGroup[2] = (u32)inputGroup[8] | ((u32)inputGroup[9] << 8) |
|
||||
((u32)inputGroup[10] << 16) | ((u32)inputGroup[11] << 24);
|
||||
wordGroup[3] = (u32)inputGroup[12] | ((u32)inputGroup[13] << 8) |
|
||||
((u32)inputGroup[14] << 16) | ((u32)inputGroup[15] << 24);
|
||||
wordGroup[4] = (u32)inputGroup[16] | ((u32)inputGroup[17] << 8) |
|
||||
((u32)inputGroup[18] << 16) | ((u32)inputGroup[19] << 24);
|
||||
wordGroup[5] = (u32)inputGroup[20] | ((u32)inputGroup[21] << 8) |
|
||||
((u32)inputGroup[22] << 16) | ((u32)inputGroup[23] << 24);
|
||||
wordGroup[6] = (u32)inputGroup[24] | ((u32)inputGroup[25] << 8) |
|
||||
((u32)inputGroup[26] << 16) | ((u32)inputGroup[27] << 24);
|
||||
wordGroup[7] = (u32)inputGroup[28] | ((u32)inputGroup[29] << 8) |
|
||||
((u32)inputGroup[30] << 16) | ((u32)inputGroup[31] << 24);
|
||||
for (index = 0, byteIndex = 0; byteIndex < 64; index++, byteIndex += 4) {
|
||||
inputWord = block + byteIndex;
|
||||
words[index] = (u32)block[byteIndex] | ((u32)inputWord[1] << 8) |
|
||||
((u32)inputWord[2] << 16) | ((u32)inputWord[3] << 24);
|
||||
}
|
||||
|
||||
ATERM_MD5_STEP(a, b, c, d, words[0], 0xd76aa478, 7, (b & c) | (~b & d));
|
||||
@@ -2484,22 +2363,22 @@ void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
|
||||
ATERM_MD5_STEP(d, a, b, c, words[13], 0xfd987193, 12, (a & b) | (~a & c));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[14], 0xa679438e, 17, (d & a) | (~d & b));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[15], 0x49b40821, 22, (c & d) | (~c & a));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[1], 0xf61e2562, 5, (d & b) | (~d & c));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[6], 0xc040b340, 9, (c & a) | (~c & b));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[11], 0x265e5a51, 14, (b & d) | (~b & a));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[0], 0xe9b6c7aa, 20, (a & c) | (~a & d));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[5], 0xd62f105d, 5, (d & b) | (~d & c));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[10], 0x02441453, 9, (c & a) | (~c & b));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[15], 0xd8a1e681, 14, (b & d) | (~b & a));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[4], 0xe7d3fbc8, 20, (a & c) | (~a & d));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[9], 0x21e1cde6, 5, (d & b) | (~d & c));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[14], 0xc33707d6, 9, (c & a) | (~c & b));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[3], 0xf4d50d87, 14, (b & d) | (~b & a));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[8], 0x455a14ed, 20, (a & c) | (~a & d));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[13], 0xa9e3e905, 5, (d & b) | (~d & c));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[2], 0xfcefa3f8, 9, (c & a) | (~c & b));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[7], 0x676f02d9, 14, (b & d) | (~b & a));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[12], 0x8d2a4c8a, 20, (a & c) | (~a & d));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[1], 0xf61e2562, 5, (b & d) | (c & ~d));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[6], 0xc040b340, 9, (a & c) | (b & ~c));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[11], 0x265e5a51, 14, (d & b) | (a & ~b));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[0], 0xe9b6c7aa, 20, (c & a) | (d & ~a));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[5], 0xd62f105d, 5, (b & d) | (c & ~d));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[10], 0x02441453, 9, (a & c) | (b & ~c));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[15], 0xd8a1e681, 14, (d & b) | (a & ~b));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[4], 0xe7d3fbc8, 20, (c & a) | (d & ~a));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[9], 0x21e1cde6, 5, (b & d) | (c & ~d));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[14], 0xc33707d6, 9, (a & c) | (b & ~c));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[3], 0xf4d50d87, 14, (d & b) | (a & ~b));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[8], 0x455a14ed, 20, (c & a) | (d & ~a));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[13], 0xa9e3e905, 5, (b & d) | (c & ~d));
|
||||
ATERM_MD5_STEP(d, a, b, c, words[2], 0xfcefa3f8, 9, (a & c) | (b & ~c));
|
||||
ATERM_MD5_STEP(c, d, a, b, words[7], 0x676f02d9, 14, (d & b) | (a & ~b));
|
||||
ATERM_MD5_STEP(b, c, d, a, words[12], 0x8d2a4c8a, 20, (c & a) | (d & ~a));
|
||||
ATERM_MD5_STEP(a, b, c, d, words[5], 0xfffa3942, 4, b ^ c ^ d);
|
||||
ATERM_MD5_STEP(d, a, b, c, words[8], 0x8771f681, 11, a ^ b ^ c);
|
||||
ATERM_MD5_STEP(c, d, a, b, words[11], 0x6d9d6122, 16, d ^ a ^ b);
|
||||
@@ -2537,6 +2416,12 @@ void ATERM_81405D0C(u32 state[4], const u8 block[64]) {
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
{
|
||||
u8* wordBytes = (u8*)words;
|
||||
for (index = 0; index < sizeof(words); index++) {
|
||||
*wordBytes++ = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef ATERM_MD5_STEP
|
||||
|
||||
|
||||
606
tools/decomp-assist/sol-med-round4.md
Normal file
606
tools/decomp-assist/sol-med-round4.md
Normal file
@@ -0,0 +1,606 @@
|
||||
# ATERM and AOSS fourth matching pass
|
||||
|
||||
Pool-first checks and live baseline recorded in final gate below. Iteration changes one function at a time, descending by baseline objdiff score.
|
||||
|
||||
ATERMi_ApConfigStart initial 99.805824%
|
||||
- first tick conversion multiplies reciprocal before clock: 99.70874%; src 0x19c base 0x19c insns 103/103; diffs 6: [46, 47, 48, 49, 75, 76]; 46 M lis r31, -0x8000; B lis r30, -0x8000
|
||||
- clock sample follows reciprocal declaration in first scope: 99.70874%; src 0x19c base 0x19c insns 103/103; diffs 6: [46, 47, 48, 49, 75, 76]; 46 M lis r31, -0x8000; B lis r30, -0x8000
|
||||
- first divisor uses a signed widened high-word product: 99.70874%; src 0x19c base 0x19c insns 103/103; diffs 6: [46, 47, 48, 49, 75, 76]; 46 M lis r31, -0x8000; B lis r30, -0x8000
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81402E40 initial 99.791664%
|
||||
- payload header lifetime starts at clear: 99.791664%; src 0x180 base 0x180 insns 96/96; diffs 4: [9, 10, 47, 52]; 9 M mr r29, r7; B mr r3, r27
|
||||
- immutable encryption key local retained across clear: compile failed
|
||||
- byte clear view reused for first converted header word: 99.583336%; src 0x180 base 0x180 insns 96/96; diffs 6: [6, 7, 9, 10, 47, 52]; 6 M mr r26, r4; B mr r30, r3
|
||||
Retained best candidate
|
||||
|
||||
ATERMi_ApConfigStart initial 99.805824%
|
||||
- ordinary unsigned high-word clock product: 86.660194%; src 0x1a4 base 0x19c insns 105/103; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x30(r1); B 0 stwu r1, -0x20(r1)
|
||||
- both timer products expressed as unsigned high words: 82.58253%; src 0x1ac base 0x19c insns 107/103; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x30(r1); B 0 stwu r1, -0x20(r1)
|
||||
- first clock divisor and quotient reuse their original source values: 99.805824%; src 0x19c base 0x19c insns 103/103; diffs 3: [48, 49, 51]; 48 M lwz r6, 0xf8(r30); B lwz r0, 0xf8(r30)
|
||||
Retained best candidate
|
||||
|
||||
ATERMi_ApConfigGetState initial 99.42857%
|
||||
- clock multiplier expanded as ordinary unsigned high word: 90.42857%; src 0x98 base 0x8c insns 38/35; --- replace mine 13:14 base 13:14; M 13 b 68; B 13 b 56
|
||||
- clock address and sampled shifted value have named lifetimes: 99.42857%; src 0x8c base 0x8c insns 35/35; diffs 3: [17, 18, 20]; 17 M lwz r6, 0xf8(r6); B lwz r0, 0xf8(r6)
|
||||
- elapsed quotient reuses current time local: 99.42857%; src 0x8c base 0x8c insns 35/35; diffs 3: [17, 18, 20]; 17 M lwz r6, 0xf8(r6); B lwz r0, 0xf8(r6)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_8140502C initial 99.42029%
|
||||
- reverse indices declared before key expansion lifetime: 98.62319%; src 0x228 base 0x228 insns 138/138; diffs 25: [10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]; 10 M mr r6, r31; B mr r4, r31
|
||||
- each round word has a separately named swap temporary: 99.42029%; src 0x228 base 0x228 insns 138/138; diffs 13: [11, 12, 15, 16, 18, 20, 21, 24, 25, 28, 29, 33, 35]; 11 M slwi r7, r3, 2; B slwi r8, r3, 2
|
||||
- round reversal counters updated by counted for loop: 99.42029%; src 0x228 base 0x228 insns 138/138; diffs 14: [11, 12, 15, 16, 18, 20, 21, 24, 25, 28, 29, 33, 35, 36]; 11 M slwi r7, r3, 2; B slwi r8, r3, 2
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814036D8 initial 99.08064%
|
||||
- source, text and output views established in target preheader order: 98.69355%; src 0x1f0 base 0x1f0 insns 124/124; diffs 22: [33, 35, 36, 37, 43, 48, 58, 59, 64, 65, 70, 71, 76, 77, 82, 83, 88, 89, 94, 95]; 33 M addi r23, r26, 0x164; B addi r24, r26, 0x164
|
||||
- key loop index advances before both independent streams: 98.69355%; src 0x1f0 base 0x1f0 insns 124/124; diffs 22: [33, 35, 36, 37, 43, 48, 58, 59, 64, 65, 70, 71, 76, 77, 82, 83, 88, 89, 94, 95]; 33 M addi r23, r26, 0x164; B addi r24, r26, 0x164
|
||||
- WEP keys traversed using counted four-entry loop: 98.69355%; src 0x1f0 base 0x1f0 insns 124/124; diffs 22: [33, 35, 36, 37, 43, 48, 58, 59, 64, 65, 70, 71, 76, 77, 82, 83, 88, 89, 94, 95]; 33 M addi r23, r26, 0x164; B addi r24, r26, 0x164
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81404A18 initial 99.09091%
|
||||
- unwrap result assigned before IV initialization: 99.09091%; src 0x1e4 base 0x1e4 insns 121/121; diffs 20: [12, 20, 21, 29, 39, 40, 42, 44, 46, 49, 50, 51, 56, 67, 94, 98, 102, 103, 113, 114]; 12 M li r26, 1; B li r24, 1
|
||||
- destination stream view established on entry: 98.67769%; src 0x1e4 base 0x1e4 insns 121/121; diffs 26: [8, 12, 20, 21, 29, 34, 38, 39, 40, 41, 42, 43, 44, 46, 49, 50, 51, 56, 67, 94]; 8 M mr r29, r3; B mr r23, r3
|
||||
- descending block index declared with pass counter: 99.09091%; src 0x1e4 base 0x1e4 insns 121/121; diffs 20: [12, 20, 21, 29, 39, 40, 42, 44, 46, 49, 50, 51, 56, 67, 94, 98, 102, 103, 113, 114]; 12 M li r25, 1; B li r24, 1
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81404844 initial 99.0171%
|
||||
- wrap destination stream view established on entry: 98.84615%; src 0x1d4 base 0x1d4 insns 117/117; diffs 22: [8, 18, 19, 27, 30, 36, 37, 38, 39, 41, 42, 43, 45, 48, 54, 58, 60, 99, 101, 103]; 8 M mr r29, r3; B mr r25, r3
|
||||
- ascending block index declared with pass counter: 99.0171%; src 0x1d4 base 0x1d4 insns 117/117; diffs 18: [18, 19, 27, 36, 37, 38, 39, 41, 42, 43, 45, 54, 58, 60, 99, 101, 103, 104]; 18 M srwi r29, r5, 3; B srwi r27, r5, 3
|
||||
- wrap unsigned pass product assigned as separate inner operation: 99.0171%; src 0x1d4 base 0x1d4 insns 117/117; diffs 18: [18, 19, 27, 36, 37, 38, 39, 41, 42, 43, 45, 54, 58, 60, 99, 101, 103, 104]; 18 M srwi r29, r5, 3; B srwi r27, r5, 3
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81402E40 initial 99.791664%
|
||||
- encryption pointer local assigned after payload clear: 99.791664%; src 0x180 base 0x180 insns 96/96; diffs 4: [9, 10, 47, 52]; 9 M mr r29, r7; B mr r3, r27
|
||||
Retained best candidate
|
||||
|
||||
Data audit: both units have identical bytes in every existing non-code section prefix. ATERM .data/.rodata/.sbss exactly identical; .bss/.sdata/.sdata2 only differ in original extraction tail alignment. AOSS .bss/.sbss/.sdata/.sdata2 exactly identical; .data only original extraction tail alignment. No filler added. Trying normal AES table declarations to recover original address selection.
|
||||
- forward and combined substitution/inverse groups: unit fuzzy 82.53218%, rodata byte identity True; [('ATERM_81404BFC', 97.56716), ('ATERM_8140502C', 95.58696), ('ATERM_81405254', 51.099632), ('ATERM_81405690', 48.560886)]
|
||||
- substitution tables and inverse mix columns grouped by role: unit fuzzy 82.51177%, rodata byte identity True; [('ATERM_81404BFC', 97.56716), ('ATERM_8140502C', 94.246376), ('ATERM_81405254', 51.099632), ('ATERM_81405690', 48.88192)]
|
||||
- each actual AES lookup table has its own object: unit fuzzy 82.600914%, rodata byte identity True; [('ATERM_81404BFC', 97.56716), ('ATERM_8140502C', 99.42029), ('ATERM_81405254', 50.830257), ('ATERM_81405690', 48.09594)]
|
||||
Retained best real-table declarations
|
||||
|
||||
ATERMi_ApConfigStart initial 99.805824%
|
||||
- clock operands assigned after predeclared time snapshot: 99.805824%; src 0x19c base 0x19c insns 103/103; diffs 3: [48, 49, 51]; 48 M lwz r6, 0xf8(r30); B lwz r0, 0xf8(r30)
|
||||
- first timer uses same inline tick expression as callback timer: 99.70874%; src 0x19c base 0x19c insns 103/103; diffs 6: [46, 47, 48, 49, 75, 76]; 46 M lis r31, -0x8000; B lis r30, -0x8000
|
||||
- predeclared reciprocal assigned before sampled clock: 99.805824%; src 0x19c base 0x19c insns 103/103; diffs 3: [48, 49, 51]; 48 M lwz r6, 0xf8(r30); B lwz r0, 0xf8(r30)
|
||||
Retained best candidate
|
||||
|
||||
ATERMi_ApConfigGetState initial 99.42857%
|
||||
- all clock conversion temporaries declared before assignments: compile failed
|
||||
- literal reciprocal and clock expression replace temporary inputs: 99.42857%; src 0x8c base 0x8c insns 35/35; diffs 4: [15, 16, 17, 18]; 15 M lis r5, -0x8000; B lis r6, -0x8000
|
||||
- clock sampled after reciprocal assignment with predeclared operands: compile failed
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81404BFC initial 97.56716%
|
||||
- substitution view established before round constants per branch: 97.73508%; src 0x430 base 0x430 insns 268/268; diffs 51: [38, 39, 40, 41, 43, 44, 45, 46, 48, 52, 53, 54, 55, 60, 61, 62, 63, 64, 66, 67]; 38 M xor r31, r30, r31; B xor r0, r6, r0
|
||||
- round constant pointer has each key-size branch scope: 98.01492%; src 0x430 base 0x430 insns 268/268; diffs 37: [38, 39, 40, 41, 43, 44, 45, 46, 48, 52, 53, 54, 55, 58, 60, 61, 62, 63, 64, 66]; 38 M xor r31, r30, r31; B xor r0, r6, r0
|
||||
- initial four big-endian words assembled before ordered publication: 98.3097%; src 0x430 base 0x430 insns 268/268; diffs 73: [5, 7, 8, 10, 13, 14, 16, 19, 20, 22, 25, 26, 28, 30, 31, 32, 34, 40, 41, 43]; 5 M lbz r7, 6(r4); B lbz r7, 2(r4)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81404BFC initial 98.3097%
|
||||
- ordered initial words with substitution-first branch setup: 98.477615%; src 0x430 base 0x430 insns 268/268; diffs 67: [5, 7, 8, 10, 13, 14, 16, 19, 20, 22, 25, 26, 28, 30, 31, 32, 34, 40, 41, 43]; 5 M lbz r7, 6(r4); B lbz r7, 2(r4)
|
||||
- ordered initial words with branch-local round constants: 98.75746%; src 0x430 base 0x430 insns 268/268; diffs 53: [5, 7, 8, 10, 13, 14, 16, 19, 20, 22, 25, 26, 28, 30, 31, 32, 34, 40, 41, 43]; 5 M lbz r7, 6(r4); B lbz r7, 2(r4)
|
||||
- ordered initial words with both target branch view lifetimes: 98.589554%; src 0x430 base 0x430 insns 268/268; diffs 59: [5, 7, 8, 10, 13, 14, 16, 19, 20, 22, 25, 26, 28, 30, 31, 32, 34, 40, 41, 43]; 5 M lbz r7, 6(r4); B lbz r7, 2(r4)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_8140276C initial 95.965515%
|
||||
- fallback current-record search resets index as target instruction 124: 95.41954%; src 0x2b8 base 0x2b8 insns 174/174; diffs 97: [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27]; 5 M mr r24, r3; B mr r23, r3
|
||||
- fallback current-record view retained across previous-record search: 98.85058%; src 0x2b8 base 0x2b8 insns 174/174; diffs 38: [8, 11, 12, 13, 18, 29, 30, 34, 41, 54, 60, 66, 69, 70, 72, 74, 80, 82, 84, 87]; 8 M addi r20, r3, 4; B addi r31, r3, 4
|
||||
- fallback reset with result initialized separately: compile failed
|
||||
Retained best candidate
|
||||
|
||||
ATERM_8140276C initial 98.85058%
|
||||
- found and final result initialized before first traversal index: 98.44827%; src 0x2b8 base 0x2b8 insns 174/174; diffs 49: [8, 11, 12, 13, 18, 29, 30, 34, 41, 54, 60, 66, 69, 70, 72, 74, 76, 78, 80, 82]; 8 M addi r20, r3, 4; B addi r31, r3, 4
|
||||
- first traversal pointers assigned after scalar initialization: 98.85058%; src 0x2b8 base 0x2b8 insns 174/174; diffs 38: [8, 11, 12, 13, 18, 29, 30, 34, 41, 54, 60, 66, 69, 70, 72, 74, 80, 82, 84, 87]; 8 M addi r20, r3, 4; B addi r31, r3, 4
|
||||
- fallback presence flags initialized before record views and SSID clear: 98.965515%; src 0x2b8 base 0x2b8 insns 174/174; diffs 34: [8, 11, 12, 13, 18, 29, 30, 34, 41, 54, 60, 66, 69, 70, 72, 74, 80, 82, 84, 87]; 8 M addi r20, r3, 4; B addi r31, r3, 4
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81402A24 initial 90.5019%
|
||||
- descriptor fields address record set entries by loop index: 89.29278%; src 0x41c base 0x41c insns 263/263; diffs 242: [0, 2, 3, 6, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]; 0 M stwu r1, -0x80(r1); B stwu r1, -0x90(r1)
|
||||
- indexed descriptors use original counted forward loop: 89.29278%; src 0x41c base 0x41c insns 263/263; diffs 242: [0, 2, 3, 6, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]; 0 M stwu r1, -0x80(r1); B stwu r1, -0x90(r1)
|
||||
- per-iteration record view follows descriptor view: 89.69202%; src 0x418 base 0x41c insns 262/263; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x80(r1); B 0 stwu r1, -0x90(r1)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814033F0 initial 98.576645%
|
||||
- option cursor assignment follows all parser declarations: 98.576645%; src 0x224 base 0x224 insns 137/137; diffs 36: [11, 13, 16, 28, 29, 34, 39, 47, 55, 60, 65, 66, 71, 72, 74, 75, 81, 82, 85, 86]; 11 M li r23, 0; B li r22, 0
|
||||
- hex byte decoder counts with while increment condition: 98.576645%; src 0x224 base 0x224 insns 137/137; diffs 36: [11, 13, 16, 28, 29, 34, 39, 47, 55, 60, 65, 66, 71, 72, 74, 75, 81, 82, 85, 86]; 11 M li r23, 0; B li r22, 0
|
||||
- aligned option span added before cursor address: 98.649635%; src 0x224 base 0x224 insns 137/137; diffs 35: [11, 13, 16, 28, 29, 34, 39, 47, 55, 60, 65, 66, 71, 72, 74, 75, 81, 82, 85, 86]; 11 M li r23, 0; B li r22, 0
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814031DC initial 97.74436%
|
||||
- MAC low nibble assigned after high nibble output: 95.150375%; src 0x214 base 0x214 insns 133/133; diffs 48: [49, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 74, 75]; 49 M addi r6, r1, 8; B addi r5, r1, 8
|
||||
- MAC source byte kept as promoted signed scalar: 97.74436%; src 0x214 base 0x214 insns 133/133; diffs 44: [50, 51, 57, 59, 61, 62, 63, 65, 66, 67, 71, 72, 75, 76, 77, 78, 79, 80, 82, 83]; 50 M addi r7, r1, 0x38; B addi r8, r1, 0x38
|
||||
- MAC formatting traverses fixed six bytes with do loop: 90.22556%; src 0x20c base 0x214 insns 131/133; --- replace mine 47:48 base 47:49; M 47 beq 312; B 47 beq 320
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814021BC initial 96.61688%
|
||||
- network settings base view survives both configuration clears: 96.61688%; src 0x268 base 0x268 insns 154/154; diffs 54: [7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; 7 M addi r3, r30, 0; B addi r30, r30, 0
|
||||
- IP clear uses network member address directly: 96.61688%; src 0x268 base 0x268 insns 154/154; diffs 54: [7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; 7 M addi r3, r30, 0; B addi r30, r30, 0
|
||||
- IP configuration view initialized after clear: 96.61688%; src 0x268 base 0x268 insns 154/154; diffs 54: [7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; 7 M addi r3, r30, 0; B addi r30, r30, 0
|
||||
Retained best candidate
|
||||
|
||||
ATERMi_AutoConfigThread initial 94.75%
|
||||
- completion mask reuses consumed result scalar: 94.75%; src 0xa0 base 0xa0 insns 40/40; diffs 3: [20, 22, 23]; 20 M nor r0, r3, r0; B nor r3, r3, r0
|
||||
- state shift and bias assigned as separate operations: 94.25%; src 0xa0 base 0xa0 insns 40/40; diffs 8: [21, 22, 23, 24, 26, 28, 29, 30]; 21 M li r5, -1; B li r4, -1
|
||||
- completion forward difference scoped after socket cleanup: 94.75%; src 0xa0 base 0xa0 insns 40/40; diffs 3: [20, 22, 23]; 20 M nor r0, r3, r0; B nor r3, r3, r0
|
||||
Retained best candidate
|
||||
|
||||
ATERMi_ApConfigEnd initial 93.94574%
|
||||
- final progress storage declared alongside captured state: 93.94574%; src 0x1f4 base 0x204 insns 125/129; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0xe0; M 4 bl 0
|
||||
- cancellation alarm loop expressed as condition-only for loop: 93.94574%; src 0x1f4 base 0x204 insns 125/129; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0xe0; M 4 bl 0
|
||||
- join alarm delay multiplies unsigned wide tick count: 90.53488%; src 0x1f8 base 0x204 insns 126/129; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0xe0; M 4 bl 0
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814038C8 initial 85.12934%
|
||||
- protocol loop uses explicit initial cancellation exit: 83.953735%; src 0xef0 base 0xedc insns 956/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
- wait alarm tick conversion sampled before queue setup: 83.078865%; src 0xef0 base 0xedc insns 956/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
- connection and session key views retain byte type: 85.12934%; src 0xef0 base 0xedc insns 956/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405ACC initial 83.09028%
|
||||
- MD5 input view declared independently of copy indices: compile failed
|
||||
- MD5 partial tail uses forward while loop: 83.09028%; src 0x230 base 0x240 insns 140/144; --- insert mine 2:2 base 2:3; B 2 slwi r7, r5, 3; --- replace mine 3:5 base 4:11
|
||||
- MD5 full block traversal advances after transform: 83.09028%; src 0x230 base 0x240 insns 140/144; --- insert mine 2:2 base 2:3; B 2 slwi r7, r5, 3; --- replace mine 3:5 base 4:11
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405254 initial 50.830257%
|
||||
- AES input low byte precedes shifted adjacent byte: 50.867157%; src 0x41c base 0x43c insns 263/271; --- insert mine 24:24 base 24:26; B 24 srawi r30, r4, 1; B 25 lbz r11, 0xc(r5)
|
||||
- AES round-pair counter declared before initial state: 54.959408%; src 0x41c base 0x43c insns 263/271; --- replace mine 10:11 base 10:11; M 10 slwi r24, r12, 8; B 10 slwi r23, r12, 8
|
||||
- AES four lookup XOR grouping changed: 43.819187%; src 0x41c base 0x43c insns 263/271; --- replace mine 10:11 base 10:11; M 10 slwi r24, r12, 8; B 10 slwi r23, r12, 8
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405690 initial 48.09594%
|
||||
- AES input low byte precedes shifted adjacent byte: 48.132843%; src 0x41c base 0x43c insns 263/271; --- insert mine 24:24 base 24:26; B 24 srawi r30, r4, 1; B 25 lbz r11, 0xc(r5)
|
||||
- AES round-pair counter declared before initial state: 52.671585%; src 0x41c base 0x43c insns 263/271; --- replace mine 10:11 base 10:11; M 10 slwi r24, r12, 8; B 10 slwi r23, r12, 8
|
||||
- AES four lookup XOR grouping changed: 42.527676%; src 0x41c base 0x43c insns 263/271; --- replace mine 12:14 base 12:14; M 12 slwi r21, r11, 0x18; M 13 slwi r20, r10, 0x10
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405ACC initial 83.09028%
|
||||
- MD5 remaining count computed once before tail condition: 83.298615%; src 0x230 base 0x240 insns 140/144; --- insert mine 2:2 base 2:3; B 2 slwi r7, r5, 3; --- replace mine 3:5 base 4:11
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 53.851387%
|
||||
- MD5 canonical add rotate add updates state directly: 82.193054%; src 0xa60 base 0xb40 insns 664/720; --- replace mine 5:80 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- MD5 message word and constant cached before state addition: 57.45139%; src 0xa88 base 0xb40 insns 674/720; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0xb0(r1); B 0 stwu r1, -0xa0(r1)
|
||||
- MD5 decoder advances separate word and byte indices: 52.87361%; src 0xa58 base 0xb40 insns 662/720; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x90(r1); B 0 stwu r1, -0xa0(r1)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81402FC0 initial 100.0%
|
||||
- packet checksum accumulator declared after option scalars: 98.51852%; src 0x21c base 0x21c insns 135/135; diffs 32: [8, 10, 13, 15, 18, 23, 32, 34, 36, 38, 40, 42, 44, 46, 54, 59, 66, 67, 68, 72]; 8 M li r29, 0; B li r31, 0
|
||||
- packet checksum remainder uses explicit cursor advance: 100.0%; src 0x21c base 0x21c insns 135/135; diffs 2: [18, 23]; 18 M bge -3631; B bge -3647
|
||||
- packet option parser tests positive payload before validity exits: 100.0%; src 0x21c base 0x21c insns 135/135; diffs 2: [18, 23]; 18 M bge -3631; B bge -3647
|
||||
Retained exact candidate
|
||||
|
||||
AOSS_81401DC0 initial 99.375%
|
||||
- CRC final reflected bit writes its selected result directly: 86.875%; src 0xd0 base 0xc0 insns 52/48; --- replace mine 39:48 base 39:44; M 39 beq 28; M 40 srwi r0, r3, 1
|
||||
- CRC seed parameter reused as row counter: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
- CRC row output addressed by index: 90.270836%; src 0xc4 base 0xc0 insns 49/48; --- replace mine 1:3 base 1:2; M 1 li r6, 0; M 2 li r3, 0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401574 initial 98.87597%
|
||||
- request payload view initialized with response view: 96.93799%; src 0x204 base 0x204 insns 129/129; diffs 41: [5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33]; 5 M lwz r29, 0(0); B lwz r27, 0(0)
|
||||
- response view assigned after allocation clear: 98.87597%; src 0x204 base 0x204 insns 129/129; diffs 28: [5, 6, 9, 15, 24, 25, 33, 39, 42, 48, 51, 53, 54, 65, 68, 74, 76, 77, 79, 81]; 5 M lwz r29, 0(0); B lwz r27, 0(0)
|
||||
- request parameter typed as record view throughout function: compile failed
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 82.193054%
|
||||
- MD5 RFC decoder with independent word and byte traversal: 74.37361%; src 0x988 base 0xb40 insns 610/720; --- replace mine 5:10 base 5:8; M 5 li r0, 0x10; M 6 addi r6, r1, 8
|
||||
- MD5 decoder uses word-indexed input view: 74.69722%; src 0x980 base 0xb40 insns 608/720; --- replace mine 5:12 base 5:14; M 5 li r0, 0x10; M 6 addi r6, r1, 8
|
||||
- MD5 decoder traverses bytes and derives destination word: 74.270836%; src 0x984 base 0xb40 insns 609/720; --- replace mine 5:8 base 5:8; M 5 li r0, 0x10; M 6 addi r5, r1, 8
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 82.193054%
|
||||
- restore target word buffer erasure after state accumulation: 82.91944%; src 0xa70 base 0xb40 insns 668/720; --- replace mine 5:80 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- target decoder uses indexed words and independently indexed input with buffer erasure: 83.825%; src 0xa78 base 0xb40 insns 670/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- target indexed decoder erasure and canonical RFC G operands: 83.859726%; src 0xa78 base 0xb40 insns 670/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401DC0 initial 99.375%
|
||||
- CRC last bit branches from the clear-bit case: 93.541664%; src 0xc4 base 0xc0 insns 49/48; --- replace mine 39:41 base 39:42; M 39 srwi r0, r3, 1; M 40 xoris r3, r0, 0xedb8
|
||||
- CRC last bit saved before shifting current row value: 98.541664%; src 0xc0 base 0xc0 insns 48/48; diffs 8: [34, 36, 37, 38, 39, 41, 42, 43]; 34 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
- CRC row accumulator reuses incoming seed parameter: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401574 initial 98.87597%
|
||||
- request response declaration follows request-view declaration: 98.87597%; src 0x204 base 0x204 insns 129/129; diffs 28: [5, 6, 9, 15, 24, 25, 33, 39, 42, 48, 51, 53, 54, 65, 68, 74, 76, 77, 79, 81]; 5 M lwz r29, 0(0); B lwz r27, 0(0)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 83.859726%
|
||||
- erase MD5 words with byte-indexed loop: 86.11528%; src 0xa84 base 0xb40 insns 673/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- erase MD5 words with advancing byte view: 86.11528%; src 0xa84 base 0xb40 insns 673/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- erase MD5 words through four byte fields per word: 86.51945%; src 0xa94 base 0xb40 insns 677/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 86.51945%
|
||||
- target erases temporary message words in two thirty-two-byte chunks: 90.6375%; src 0xb00 base 0xb40 insns 704/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- target byte traversal controls decoder and thirty-two-byte buffer wipe: 90.6375%; src 0xb00 base 0xb40 insns 704/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
- message words cleared in four sixteen-byte chunks: 88.30278%; src 0xac0 base 0xb40 insns 688/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_813FFD68 initial 96.981735%
|
||||
- config result and record views initialized in declarations: 96.981735%; src 0x364 base 0x36c insns 217/219; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- SSID ASCII validation uses unsigned range expression: 92.43379%; src 0x34c base 0x36c insns 211/219; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- SSID cursor dereference advances after validation byte assignment: 96.981735%; src 0x364 base 0x36c insns 217/219; --- replace mine 3:5 base 3:7; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_814013AC initial 94.48245%
|
||||
- response initial view assigned with declaration: 92.59649%; src 0x1d0 base 0x1c8 insns 116/114; --- insert mine 6:6 base 6:7; B 6 mr r27, r3; --- delete mine 7:9 base 8:8
|
||||
- response step length uses one converted length expression: 96.32456%; src 0x1c8 base 0x1c8 insns 114/114; diffs 43: [6, 7, 10, 14, 15, 16, 17, 20, 25, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]; 6 M mr r24, r5; B mr r27, r3
|
||||
- key config views scoped to their option cases: 87.447365%; src 0x1c0 base 0x1c8 insns 112/114; --- replace mine 6:11 base 6:11; M 6 mr r27, r5; M 7 mr r25, r3
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401E80 initial 92.82313%
|
||||
- packet half view cached for mask and swap operations: 91.63265%; src 0x248 base 0x24c insns 146/147; --- replace mine 6:7 base 6:7; M 6 mr r29, r3; B 6 mr r21, r3
|
||||
- key mask initialization computes XOR before byte store: 92.82313%; src 0x248 base 0x24c insns 146/147; --- replace mine 6:7 base 6:7; M 6 mr r28, r3; B 6 mr r21, r3
|
||||
- second-half XOR scalar tail uses while advance: 92.82313%; src 0x248 base 0x24c insns 146/147; --- replace mine 6:7 base 6:7; M 6 mr r28, r3; B 6 mr r21, r3
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 90.6375%
|
||||
- MD5 decoder increments word index after each decoded word: 90.9875%; src 0xb1c base 0xb40 insns 711/720; --- replace mine 5:89 base 5:98; M 5 li r6, 2; M 6 addi r5, r1, 8
|
||||
- MD5 decoder advances both indices per decoded word: 90.9875%; src 0xb1c base 0xb40 insns 711/720; --- replace mine 5:89 base 5:98; M 5 li r6, 2; M 6 addi r5, r1, 8
|
||||
- MD5 decoder separates word increment and byte increment statements: 90.86667%; src 0xb00 base 0xb40 insns 704/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_814001B4 initial 88.78481%
|
||||
- packet message view scoped independently of receive storage: 85.08861%; src 0x130 base 0x13c insns 76/79; --- replace mine 3:6 base 3:11; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- packet dispatch returns selected handler result directly: 83.27848%; src 0x124 base 0x13c insns 73/79; --- replace mine 3:5 base 3:10; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- packet message length assigned after opcode declaration: 88.78481%; src 0x12c base 0x13c insns 75/79; --- replace mine 3:5 base 3:10; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81400E0C initial 86.81579%
|
||||
- option record view initialized before clear: 85.63158%; src 0x2fc base 0x2f8 insns 191/190; --- insert mine 5:5 base 5:6; B 5 mr r29, r4; --- replace mine 6:8 base 7:8
|
||||
- option scalar byte view advances with dereference: 86.81579%; src 0x2fc base 0x2f8 insns 191/190; --- replace mine 19:20 base 19:20; M 19 bgt -10867; B 19 bgt -11215
|
||||
- option network scalar remainder tests remaining byte count: 87.8421%; src 0x2f4 base 0x2f8 insns 189/190; --- replace mine 19:20 base 19:20; M 19 bgt -10867; B 19 bgt -11215
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81400830 initial 83.99377%
|
||||
- payload RC4 output and input views assigned after pair count: 83.99377%; src 0x4ec base 0x504 insns 315/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- payload RC4 complete pairs use counted for traversal: 83.99377%; src 0x4ec base 0x504 insns 315/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- payload CRC tail advances source byte cursor: 83.576324%; src 0x4ec base 0x504 insns 315/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
Retained best candidate
|
||||
|
||||
AOSS_814020CC initial 81.65%
|
||||
- host wait samples reciprocal clock before constant multiplication: 81.23333%; src 0xe4 base 0xf0 insns 57/60; --- replace mine 3:5 base 3:6; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- host wait counter increment folded into retry condition: 81.65%; src 0xe4 base 0xf0 insns 57/60; --- replace mine 3:5 base 3:6; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
- host wait delay uses wide unsigned clock product: 76.15%; src 0xe8 base 0xf0 insns 58/60; --- replace mine 3:6 base 3:7; M 3 addi r11, r1, 0x20; M 4 bl 0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401778 initial 77.53846%
|
||||
- hello CRC checksum narrows after complement: 77.13553%; src 0x440 base 0x444 insns 272/273; --- replace mine 5:7 base 5:6; M 5 lis r31, 0; M 6 lwz r30, 0(0)
|
||||
- hello pair processing traverses packet byte view: 76.1978%; src 0x444 base 0x444 insns 273/273; diffs 244: [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; 5 M lis r31, 0; B lwz r28, 0(0)
|
||||
- hello state index byte mask assigned separately from remainder: 77.53846%; src 0x440 base 0x444 insns 272/273; --- replace mine 5:7 base 5:6; M 5 lis r31, 0; M 6 lwz r30, 0(0)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401C9C initial 77.0685%
|
||||
- KSA byte state view initialized alongside counters: 77.0685%; src 0x130 base 0x124 insns 76/73; --- replace mine 0:5 base 0:5; M 0 stwu r1, -0x20(r1); M 1 mflr r0
|
||||
- KSA initialization remainder uses advancing byte view: 76.9315%; src 0x130 base 0x124 insns 76/73; --- replace mine 0:5 base 0:5; M 0 stwu r1, -0x20(r1); M 1 mflr r0
|
||||
- KSA swapping caches input key byte before modular addition: 71.178085%; src 0x130 base 0x124 insns 76/73; --- replace mine 0:5 base 0:5; M 0 stwu r1, -0x20(r1); M 1 mflr r0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_Init_old initial 28.42298%
|
||||
- initialization wait counters use fixed signed sixteen-bit types: 28.42298%; src 0x1794 base 0x18c0 insns 1509/1584; --- replace mine 0:1 base 0:4; M 0 stwu r1, -0x100(r1); B 0 clrlwi r11, r1, 0x1b
|
||||
- initialization failure result stored as signed return value: 28.42298%; src 0x1794 base 0x18c0 insns 1509/1584; --- replace mine 0:1 base 0:4; M 0 stwu r1, -0x100(r1); B 0 clrlwi r11, r1, 0x1b
|
||||
- initialization response view declared and assigned before packet fields: 28.419823%; src 0x1790 base 0x18c0 insns 1508/1584; --- replace mine 0:1 base 0:4; M 0 stwu r1, -0x100(r1); B 0 clrlwi r11, r1, 0x1b
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 90.9875%
|
||||
- signed MD5 decoder word counter matches independent store traversal: 90.9875%; src 0xb1c base 0xb40 insns 711/720; --- replace mine 5:89 base 5:98; M 5 li r6, 2; M 6 addi r5, r1, 8
|
||||
- MD5 decoder word counter masked to sixteen-word buffer: 91.73194%; src 0xb3c base 0xb40 insns 719/720; --- replace mine 6:10 base 6:12; M 6 addi r6, r1, 8; M 7 lwz r8, 0(r3)
|
||||
- MD5 decoder explicitly advances word counter after stores: 90.86667%; src 0xb00 base 0xb40 insns 704/720; --- replace mine 5:82 base 5:98; M 5 li r5, 2; M 6 lwz r0, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 91.73194%
|
||||
- MD5 decoder factored as standard byte-length conversion helper: 87.34722%; src 0xa20 base 0xb40 insns 648/720; --- replace mine 5:13 base 5:14; M 5 li r0, 0x10; M 6 addi r7, r1, 8
|
||||
- MD5 decoder factored as standard word-count conversion helper: 87.34722%; src 0xa20 base 0xb40 insns 648/720; --- replace mine 5:13 base 5:14; M 5 li r0, 0x10; M 6 addi r7, r1, 8
|
||||
- MD5 word decoding helper carries inline qualifier: 87.34722%; src 0xa20 base 0xb40 insns 648/720; --- replace mine 5:13 base 5:14; M 5 li r0, 0x10; M 6 addi r7, r1, 8
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401DC0 initial 99.375%
|
||||
- CRC reflected-bit helper shared by all eight polynomial steps: 0%; src 0x6c base 0xc0 insns 27/48; --- replace mine 0:26 base 0:47; M 0 stwu r1, -0x10(r1); M 1 mflr r0
|
||||
- CRC final polynomial step expressed through reflected-bit helper: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
- CRC reflected-bit helper shifts then applies captured-bit polynomial: 0%; src 0x6c base 0xc0 insns 27/48; --- replace mine 0:26 base 0:47; M 0 stwu r1, -0x10(r1); M 1 mflr r0
|
||||
Retained best candidate
|
||||
|
||||
MD5 masked-word-index candidate rejected after source review: masking is absent from the target and unnecessary for this fixed block; retain advancing word index despite lower fuzzy score.
|
||||
|
||||
AOSS_81401DC0 initial 99.375%
|
||||
- CRC row storage signed with explicit logical right shift: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
- CRC traversal counter signed with unchanged bounded row count: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
- CRC loop advances row count before publishing completed row: 99.375%; src 0xc0 base 0xc0 insns 48/48; diffs 4: [39, 41, 42, 43]; 39 M srwi r0, r3, 1; B srwi r3, r3, 1
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401DC0 initial 99.375%
|
||||
- speed optimization of standard eight-bit reflected CRC loop: 100.0%; src 0xc0 base 0xc0 insns 48/48; diffs 0: []
|
||||
- speed optimization CRC loop with captured low bit: 92.916664%; src 0xc0 base 0xc0 insns 48/48; diffs 35: [1, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 26]; 1 M li r3, 0; B li r5, 0
|
||||
- speed optimization CRC loop with signed bit counter: 100.0%; src 0xc0 base 0xc0 insns 48/48; diffs 0: []
|
||||
Retained exact candidate
|
||||
|
||||
ATERM_81402E40 initial 0%
|
||||
- speed optimization checksum uses original scalar byte loop: 99.791664%; src 0x180 base 0x180 insns 96/96; diffs 4: [9, 10, 47, 52]; 9 M mr r29, r7; B mr r3, r27
|
||||
- speed optimization checksum uses postincrement cursor loop: 82.135414%; src 0x160 base 0x180 insns 88/96; --- replace mine 5:12 base 5:12; M 5 mr r28, r5; M 6 mr r26, r3
|
||||
- speed optimization checksum loop retains nonempty packet guard: 98.75%; src 0x184 base 0x180 insns 97/96; --- insert mine 9:9 base 9:10; B 9 mr r3, r27; --- delete mine 10:11 base 11:11
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401C9C initial 0%
|
||||
- speed optimization KSA uses canonical state byte initializer: 83.53425%; src 0x130 base 0x124 insns 76/73; --- replace mine 0:1 base 0:2; M 0 stwu r1, -0x20(r1); B 0 stwu r1, -0x10(r1)
|
||||
- speed optimization KSA initializer retains nonempty guard: 82.16438%; src 0x134 base 0x124 insns 77/73; --- replace mine 0:1 base 0:2; M 0 stwu r1, -0x20(r1); B 0 stwu r1, -0x10(r1)
|
||||
- speed optimization KSA initializer uses explicit advancing while: 83.53425%; src 0x130 base 0x124 insns 76/73; --- replace mine 0:1 base 0:2; M 0 stwu r1, -0x20(r1); B 0 stwu r1, -0x10(r1)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81402FC0 initial 0%
|
||||
- speed optimization checksum uses original scalar byte loop: 100.0%; src 0x21c base 0x21c insns 135/135; diffs 2: [18, 23]; 18 M bge -3755; B bge -3647
|
||||
- speed optimization checksum uses postincrement cursor loop: 87.59259%; src 0x1fc base 0x21c insns 127/135; --- replace mine 5:6 base 5:6; M 5 mr r25, r3; B 5 mr r27, r3
|
||||
- speed optimization checksum loop retains nonempty packet guard: 99.25926%; src 0x220 base 0x21c insns 136/135; --- replace mine 18:20 base 18:19; M 18 bge -3755; M 19 bge -3759
|
||||
Retained exact candidate
|
||||
|
||||
AOSS_81400E0C initial 30.273684%
|
||||
- speed optimization network scalar assembled by canonical byte loop: 90.04211%; src 0x304 base 0x2f8 insns 193/190; --- replace mine 19:20 base 19:20; M 19 bgt -11307; B 19 bgt -11215
|
||||
- speed optimization network scalar loop uses advancing view: 95.26316%; src 0x2fc base 0x2f8 insns 191/190; --- replace mine 19:20 base 19:20; M 19 bgt -11307; B 19 bgt -11215
|
||||
- speed optimization network scalar loop counts signed byte length: 91.41579%; src 0x2e4 base 0x2f8 insns 185/190; --- replace mine 19:20 base 19:20; M 19 bgt -11307; B 19 bgt -11215
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401E80 initial 11.714286%
|
||||
- speed optimization mask uses canonical half-packet byte loop: 92.72109%; src 0x248 base 0x24c insns 146/147; --- replace mine 6:7 base 6:7; M 6 mr r28, r3; B 6 mr r21, r3
|
||||
- speed optimization mask retains nonempty half guard: 92.04082%; src 0x24c base 0x24c insns 147/147; diffs 95: [6, 8, 9, 10, 11, 12, 15, 19, 22, 24, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38]; 6 M mr r28, r3; B mr r21, r3
|
||||
- speed optimization mask advances second-half and key views: 86.4966%; src 0x248 base 0x24c insns 146/147; --- replace mine 6:7 base 6:7; M 6 mr r28, r3; B 6 mr r21, r3
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 83.53472%
|
||||
- speed optimization canonical MD5 byte decoder and message erasure: 94.459724%; src 0xb60 base 0xb40 insns 728/720; --- replace mine 7:10 base 7:10; M 7 lwz r15, 0(r3); M 8 li r19, 0
|
||||
- speed optimization canonical MD5 word-count decoder and message erasure: 86.406944%; src 0xb1c base 0xb40 insns 711/720; --- replace mine 5:81 base 5:98; M 5 li r6, 2; M 6 addi r5, r1, 8
|
||||
- speed optimization canonical MD5 decoder and cursor-based erasure: 97.255554%; src 0xb40 base 0xb40 insns 720/720; diffs 74: [7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 20, 22, 23, 24, 26, 28, 29, 30, 34, 35]; 7 M lwz r15, 0(r3); B lwz r17, 0(r3)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81400830 initial 0%
|
||||
- speed optimization payload CRC uses canonical signed byte loop: 11.5856695%; src 0x570 base 0x504 insns 348/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- speed optimization payload CRC uses canonical unsigned byte loop: 72.389404%; src 0x594 base 0x504 insns 357/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- speed optimization payload CRC byte pointer advances independently: 11.570093%; src 0x570 base 0x504 insns 348/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 97.255554%
|
||||
- MD5 decoder indices declared before state values: 99.74306%; src 0xb40 base 0xb40 insns 720/720; diffs 35: [12, 15, 16, 17, 22, 23, 26, 28, 29, 34, 35, 38, 41, 43, 46, 50, 51, 56, 58, 60]; 12 M li r16, 0; B li r14, 0
|
||||
- MD5 decoder indices scoped independently of buffer wipe: compile failed
|
||||
- MD5 input byte index precedes word index and state values: 99.673615%; src 0xb40 base 0xb40 insns 720/720; diffs 44: [8, 12, 15, 16, 17, 18, 20, 22, 23, 24, 26, 28, 29, 30, 34, 35, 36, 38, 41, 43]; 8 M li r16, 0; B li r15, 0
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81400830 initial 72.389404%
|
||||
- speed optimization RC4 uses standard one-byte stream traversal: 75.40187%; src 0x5bc base 0x504 insns 367/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- speed optimization RC4 traverses advancing source and destination views: 77.14019%; src 0x5ac base 0x504 insns 363/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
- speed optimization RC4 publishes cursor state after byte output: 72.361374%; src 0x5b4 base 0x504 insns 365/321; --- replace mine 5:6 base 5:7; M 5 mr r27, r3; B 5 mr r26, r3
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405ACC initial 0%
|
||||
- speed optimization MD5 input copies use canonical byte-indexed loops: 88.583336%; src 0x22c base 0x240 insns 139/144; --- replace mine 26:27 base 26:27; M 26 blt 232; B 26 blt 244
|
||||
- speed optimization MD5 input copies use advancing byte cursors: 74.86806%; src 0x21c base 0x240 insns 135/144; --- delete mine 5:6 base 5:5; M 5 mr r31, r4; --- insert mine 7:7 base 6:7
|
||||
- speed optimization MD5 byte copy loops use signed remainder bounds: 77.986115%; src 0x1fc base 0x240 insns 127/144; --- delete mine 13:14 base 13:13; M 13 rlwinm r8, r6, 0x1d, 0x1a, 0x1f; --- insert mine 16:16 base 15:16
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814038C8 initial 44.91798%
|
||||
- speed optimization response checksums use canonical source loops: 83.25552%; src 0xf28 base 0xedc insns 970/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
- speed optimization response checksums use advancing cursor loops: 81.921135%; src 0xee8 base 0xedc insns 954/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
- speed optimization response checksums retain initial empty guard: 83.13144%; src 0xf30 base 0xedc insns 972/951; --- replace mine 0:1 base 0:1; M 0 stwu r1, -0x190(r1); B 0 stwu r1, -0x180(r1)
|
||||
Retained best candidate
|
||||
|
||||
ATERM_81405D0C initial 99.74306%
|
||||
- MD5 byte index word index and input word view precede state values: 100.0%; src 0xb40 base 0xb40 insns 720/720; diffs 0: []
|
||||
- MD5 word index word view and byte index precede state values: 99.673615%; src 0xb40 base 0xb40 insns 720/720; diffs 44: [8, 12, 15, 16, 17, 18, 20, 22, 23, 24, 26, 28, 29, 30, 34, 35, 36, 38, 41, 43]; 8 M li r14, 0; B li r15, 0
|
||||
- MD5 all four input bytes addressed through explicit word view: 100.0%; src 0xb40 base 0xb40 insns 720/720; diffs 0: []
|
||||
Retained exact candidate
|
||||
|
||||
Compiler-option audit: the default IPL flags end with size optimization (-O4,s). Testing speed optimization (-O4,p), scoped only to these two NonMatching C objects, recovered the original individual register-save sequences for AOSS_813FFD68 (219/219, diffs 0) and AOSS_814001B4 (79/79, diffs 0). Canonical CRC and MD5 source loops then recovered their original compiler-generated unrolling. Adding -ipa off split pooled BSS and broke the existing AOSS_814004D0 data reference, so that option was rejected and reverted. Keeping file IPA with -inline off preserves all original data mappings and prevents the compact CRC builder from being inlined into its two callers. No other translation unit receives these flags.
|
||||
ATERM_81405D0C now instruction-exact: 720/720, diffs 0, objdiff 100%. Its final source restores the original temporary-message erasure, normal MD5 add/rotate/add operations, and byte-index/word-index decoder with an explicit input-word view. The intermediate manually expanded decoder/wipe and masked-index experiment are absent from the final source.
|
||||
AOSS_81401DC0 now instruction-exact: 48/48, diffs 0, objdiff 100%, ordinary eight-bit polynomial loop.
|
||||
Native supplemental verification passed: AES-128/192/256 encryption/decryption, MD5 lengths 0/1/3/55/56/64/130, scan comparison fallback/unchanged/status-change/empty cases with changed-index writes, KSA lengths 0/1/7/8/9/16/256/300, all 256 CRC rows, and RC4 payload decode/checksum rejection lengths 1/7/8/9/16/31/32/255/256/257. Vendor transform and network conversion are stubbed only in the isolated payload test; these are not PPC instruction-match evidence.
|
||||
|
||||
ATERM full clean gate before first commit:
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/ATERM] pool: IDENTICAL
|
||||
[src/scene/setting/ATERM] objdiff: code 4528/19204 data 18448/18864 functions 7/26 fuzzy 88.3064 linked code 0
|
||||
[src/scene/setting/ATERM] instruction-exact functions: 6/26
|
||||
[src/scene/setting/ATERM] section .bss size 8160 match 100.0
|
||||
[src/scene/setting/ATERM] section .data size 280 match None
|
||||
[src/scene/setting/ATERM] section .rodata size 10280 match 100.0
|
||||
[src/scene/setting/ATERM] section .sbss size 80 match 38.88889
|
||||
[src/scene/setting/ATERM] section .sdata size 56 match None
|
||||
[src/scene/setting/ATERM] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/ATERM] section .text size 19204 match 88.3064
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814021BC 96.61688
|
||||
[src/scene/setting/ATERM] below 100: ATERM_8140276C 98.965515
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81402A24 81.04943
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81402E40 99.791664
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814031DC 53.969925
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814033F0 98.649635
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814036D8 99.08064
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814038C8 83.25657
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_AutoConfigThread 94.75
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404844 95.1453
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404A18 99.09091
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404BFC 98.75746
|
||||
[src/scene/setting/ATERM] below 100: ATERM_8140502C 99.42029
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405254 54.959408
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405690 52.671585
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405ACC 88.583336
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigStart 99.805824
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigEnd 99.4186
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigGetState 99.42857
|
||||
[src/scene/setting/ATERM] baseline: code 1648/19204 data 18448 functions 6 fuzzy 82.5403
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 82.45576 -> 82.59813
|
||||
global fuzzy_match_percent: 95.09687 -> 95.14157
|
||||
global complete_code_percent: 58.19218 -> 58.19218
|
||||
global matched_data_percent: 89.46201 -> 89.46201
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
note: config touched: configure.py (orchestrator reviews every config/symbols change)
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
AOSS_814020CC initial 98.13333%
|
||||
- startup error branch precedes common successful host return: 100.0%; src 0xf0 base 0xf0 insns 60/60; diffs 0: []
|
||||
- startup result explicitly selected in success and failure branches: 98.13333%; src 0xec base 0xf0 insns 59/60; --- replace mine 11:12 base 11:12; M 11 b 164; B 11 b 168
|
||||
- startup failure exits before host acquisition block: 91.4%; src 0xec base 0xf0 insns 59/60; --- replace mine 11:12 base 11:12; M 11 b 164; B 11 b 168
|
||||
Retained exact candidate
|
||||
|
||||
AOSS_814013AC initial 96.32456%
|
||||
- response payload view advances before converted option length: 96.18421%; src 0x1c8 base 0x1c8 insns 114/114; diffs 38: [6, 7, 10, 14, 15, 16, 17, 20, 25, 29, 30, 34, 37, 38, 39, 40, 41, 42, 55, 56]; 6 M mr r24, r5; B mr r27, r3
|
||||
- single response cursor survives selection and option traversal: 96.18421%; src 0x1c8 base 0x1c8 insns 114/114; diffs 38: [6, 7, 10, 14, 15, 16, 17, 20, 25, 29, 30, 34, 37, 38, 39, 40, 41, 42, 55, 56]; 6 M mr r24, r5; B mr r27, r3
|
||||
- single response cursor initializes flags after selected record: 95.9386%; src 0x1c8 base 0x1c8 insns 114/114; diffs 47: [6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]; 6 M mr r24, r5; B mr r27, r3
|
||||
Retained best candidate
|
||||
|
||||
AOSS_81401574 initial 98.87597%
|
||||
- typed requested access-point record view initialized before response: 98.87597%; src 0x204 base 0x204 insns 129/129; diffs 28: [5, 6, 9, 15, 24, 25, 33, 39, 42, 48, 51, 53, 54, 65, 68, 74, 76, 77, 79, 81]; 5 M lwz r29, 0(0); B lwz r27, 0(0)
|
||||
- typed request-record parameter view initialized before response: 98.87597%; src 0x204 base 0x204 insns 129/129; diffs 28: [5, 6, 9, 15, 24, 25, 33, 39, 42, 48, 51, 53, 54, 65, 68, 74, 76, 77, 79, 81]; 5 M lwz r29, 0(0); B lwz r27, 0(0)
|
||||
- response typed view established after request storage clear: 96.434105%; src 0x204 base 0x204 insns 129/129; diffs 43: [5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]; 5 M lwz r3, 0(0); B lwz r27, 0(0)
|
||||
Retained best candidate
|
||||
|
||||
AOSS_813FFD68: objdiff 100%, 219/219, diffs 0 after the per-object optimization correction.
|
||||
AOSS_814001B4: objdiff 100%, 79/79, diffs 0 after the same correction.
|
||||
AOSS_814020CC: objdiff 100%, 60/60, diffs 0 after placing the common successful return after the explicit startup failure branch.
|
||||
AOSS vendor transform independently verified against a two-round reference for even lengths 2/4/8/16/30/32/64/260 and key lengths 1/5/10, without the vendor-transform stub used by the separate payload test.
|
||||
AOSS full clean gate before unit commit:
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/AOSS] pool: IDENTICAL
|
||||
[src/scene/setting/AOSS] objdiff: code 4868/16192 data 3896/3928 functions 13/21 fuzzy 68.5190 linked code 0
|
||||
[src/scene/setting/AOSS] instruction-exact functions: 13/21
|
||||
[src/scene/setting/AOSS] section .bss size 3496 match 100.0
|
||||
[src/scene/setting/AOSS] section .data size 368 match 100.0
|
||||
[src/scene/setting/AOSS] section .sbss size 32 match 42.857143
|
||||
[src/scene/setting/AOSS] section .sdata size 24 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/AOSS] section .text size 16192 match 68.51902
|
||||
[src/scene/setting/AOSS] below 100: AOSS_Init_old 28.1875
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81400830 87.78505
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81400E0C 95.26316
|
||||
[src/scene/setting/AOSS] below 100: AOSS_814013AC 96.32456
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81401574 98.87597
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81401778 77.92308
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81401C9C 83.53425
|
||||
[src/scene/setting/AOSS] below 100: AOSS_81401E80 92.72109
|
||||
[src/scene/setting/AOSS] baseline: code 3244/16192 data 3896 functions 9 fuzzy 67.0618
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 82.45576 -> 82.60614
|
||||
global fuzzy_match_percent: 95.09687 -> 95.14172
|
||||
global complete_code_percent: 58.19218 -> 58.19218
|
||||
global matched_data_percent: 89.46201 -> 89.46201
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
note: config touched: configure.py (orchestrator reviews every config/symbols change)
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
ATERM_814031DC initial 53.969925%
|
||||
- MAC encoder stops immediately after final address byte: 90.766914%; src 0x204 base 0x214 insns 129/133; --- replace mine 47:48 base 47:49; M 47 beq 304; B 47 beq 320
|
||||
- MAC encoder expresses known nonempty traversal with do loop: 90.22556%; src 0x20c base 0x214 insns 131/133; --- replace mine 47:48 base 47:49; M 47 beq 312; B 47 beq 320
|
||||
- MAC encoder traverses bounded address byte views: 89.99248%; src 0x22c base 0x214 insns 139/133; --- replace mine 47:51 base 47:50; M 47 beq 344; M 48 addi r6, r1, 8
|
||||
Retained best candidate
|
||||
|
||||
ATERM_814031DC initial 90.766914%
|
||||
- MAC format traversal terminates at six-byte equality: 53.969925%; src 0x2fc base 0x214 insns 191/133; --- replace mine 47:49 base 47:49; M 47 beq 552; M 48 li r0, 3
|
||||
- MAC format traversal counts remaining bytes separately from delimiter index: 51.56391%; src 0x30c base 0x214 insns 195/133; --- replace mine 47:49 base 47:49; M 47 beq 568; M 48 li r0, 3
|
||||
- MAC format traversal tests nonzero remaining bytes with decrement in body: 51.56391%; src 0x30c base 0x214 insns 195/133; --- replace mine 47:49 base 47:49; M 47 beq 568; M 48 li r0, 3
|
||||
Retained best candidate
|
||||
|
||||
Final src/scene/setting/ATERM residuals (each original residual has at least three successful, distinct source trials above):
|
||||
| Function | objdiff % | Instructions | Evidence / remaining reason |
|
||||
|---|---:|---|---|
|
||||
| ATERM_814021BC | 96.61688 | 154/154 | network/settings view allocation and initial base-address scheduling |
|
||||
| ATERM_8140276C | 98.965515 | 174/174 | record/flag register allocation; fallback reset now follows target |
|
||||
| ATERM_81402A24 | 81.04943 | 290/263 | scan frame, descriptor-view scheduling and MAC-loop unrolling |
|
||||
| ATERM_81402E40 | 99.791664 | 96/96 | argument move ordering plus cr1 branch normalization |
|
||||
| ATERM_81402FC0 | 100.0 | 135/135 | objdiff exact; gate/ctxdiff cr1 branch normalization differs by preceding-function address delta |
|
||||
| ATERM_814031DC | 90.766914 | 129/133 | MAC loop uses explicit terminal break; original uses CTR and different temporaries |
|
||||
| ATERM_814033F0 | 98.649635 | 137/137 | option flag/cursor register allocation and span addition scheduling |
|
||||
| ATERM_814036D8 | 99.08064 | 124/124 | key/text/output view register allocation and stream advancement order |
|
||||
| ATERM_814038C8 | 83.25657 | 970/951 | protocol frame, loop scheduling and option/authentication block allocation |
|
||||
| ATERMi_AutoConfigThread | 94.75 | 40/40 | socket result/state arithmetic register choices |
|
||||
| ATERM_81404844 | 95.1453 | 116/117 | wrap loop setup/control and saved-register allocation |
|
||||
| ATERM_81404A18 | 99.09091 | 121/121 | unwrap result/pass/block register allocation |
|
||||
| ATERM_81404BFC | 98.75746 | 268/268 | initial key byte-load ordering and AES-128 substitution register allocation |
|
||||
| ATERM_8140502C | 99.42029 | 138/138 | round-reversal index and swap register allocation |
|
||||
| ATERM_81405254 | 54.959408 | 263/271 | AES round XOR scheduling and intermediate stack lifetimes |
|
||||
| ATERM_81405690 | 52.671585 | 263/271 | inverse AES round XOR scheduling and intermediate stack lifetimes |
|
||||
| ATERM_81405ACC | 88.583336 | 139/144 | input copy loop guards/index scheduling |
|
||||
| ATERMi_ApConfigStart | 99.805824 | 103/103 | first clock conversion temporary r0/r6 cycle |
|
||||
| ATERMi_ApConfigEnd | 99.4186 | 129/129 | alarm callback/clock operand setup order |
|
||||
| ATERMi_ApConfigGetState | 99.42857 | 35/35 | clock conversion temporary r0/r6 cycle |
|
||||
|
||||
Final data byte audit (no padding or address-pinned objects added):
|
||||
- .bss: mine 8144, original 8160 bytes; prefix mismatches 0/8144.
|
||||
- .rodata: mine 10280, original 10280 bytes; prefix mismatches 0/10280.
|
||||
- .data: mine 280, original 280 bytes; prefix mismatches 0/280.
|
||||
- .sdata2: mine 7, original 8 bytes; prefix mismatches 0/7.
|
||||
- .sdata: mine 53, original 56 bytes; prefix mismatches 0/53.
|
||||
- .sbss: mine 84, original 80 bytes; prefix mismatches 0/80.
|
||||
Packet parser raw bytes identical: True. Raw SHA-256 mine 91a60a7585553b8702d6f6ff83d5a91eedfd3cbaf3a04fb25501c637a6f84acd, original 91a60a7585553b8702d6f6ff83d5a91eedfd3cbaf3a04fb25501c637a6f84acd. Raw-byte equality does not assert linker relocation identity. The gate instruction count remains authoritative in this report.
|
||||
|
||||
Final src/scene/setting/AOSS residuals (each original residual has at least three successful, distinct source trials above):
|
||||
| Function | objdiff % | Instructions | Evidence / remaining reason |
|
||||
|---|---:|---|---|
|
||||
| AOSS_Init_old | 28.1875 | 1512/1584 | initialization branch layout, wait/receive loops and stack allocation |
|
||||
| AOSS_81400830 | 87.78505 | 317/321 | RC4 cursor publication, CRC-loop guards and register allocation |
|
||||
| AOSS_81400E0C | 95.26316 | 191/190 | network scalar loop guards and switch/register scheduling |
|
||||
| AOSS_814013AC | 96.32456 | 114/114 | response cursor, flags and config-view lifetimes and load ordering |
|
||||
| AOSS_81401574 | 98.87597 | 129/129 | three pointer-register allocation cycle |
|
||||
| AOSS_81401778 | 77.92308 | 273/273 | hello key/nonce stack fields and stream/CRC register lifetimes |
|
||||
| AOSS_81401C9C | 83.53425 | 76/73 | KSA save/restore and initialization/swap index scheduling |
|
||||
| AOSS_81401E80 | 92.72109 | 146/147 | half-buffer XOR guard and loop/allocation lifetimes |
|
||||
|
||||
Final data byte audit (no padding or address-pinned objects added):
|
||||
- .bss: mine 3496, original 3496 bytes; prefix mismatches 0/3496.
|
||||
- .data: mine 364, original 368 bytes; prefix mismatches 0/364.
|
||||
- .sdata2: mine 8, original 8 bytes; prefix mismatches 0/8.
|
||||
- .sdata: mine 24, original 24 bytes; prefix mismatches 0/24.
|
||||
- .sbss: mine 32, original 32 bytes; prefix mismatches 0/32.
|
||||
|
||||
Data is not claimed 100%: ATERM switch-table relocation correspondence and anonymous small-data mappings remain below complete objdiff coverage; AOSS has unresolved small-BSS correspondence. Original extracted alignment tails are not synthesized.
|
||||
|
||||
ATERM association MAC formatting native check passed: normalized BSSID, descending address order and uppercase colon-separated strings, three address pairs. Buffers are exposed only in the native test wrapper. The final source uses a terminal break after the sixth byte, eliminating the compiler double unroll; 129/133 instructions remain versus target CTR loop.
|
||||
ATERM full clean gate before MAC improvement commit:
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/ATERM] pool: IDENTICAL
|
||||
[src/scene/setting/ATERM] objdiff: code 4528/19204 data 18448/18864 functions 7/26 fuzzy 89.3258 linked code 0
|
||||
[src/scene/setting/ATERM] instruction-exact functions: 6/26
|
||||
[src/scene/setting/ATERM] section .bss size 8160 match 100.0
|
||||
[src/scene/setting/ATERM] section .data size 280 match None
|
||||
[src/scene/setting/ATERM] section .rodata size 10280 match 100.0
|
||||
[src/scene/setting/ATERM] section .sbss size 80 match 38.88889
|
||||
[src/scene/setting/ATERM] section .sdata size 56 match None
|
||||
[src/scene/setting/ATERM] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/ATERM] section .text size 19204 match 89.32577
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814021BC 96.61688
|
||||
[src/scene/setting/ATERM] below 100: ATERM_8140276C 98.965515
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81402A24 81.04943
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81402E40 99.791664
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814031DC 90.766914
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814033F0 98.649635
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814036D8 99.08064
|
||||
[src/scene/setting/ATERM] below 100: ATERM_814038C8 83.25657
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_AutoConfigThread 94.75
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404844 95.1453
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404A18 99.09091
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81404BFC 98.75746
|
||||
[src/scene/setting/ATERM] below 100: ATERM_8140502C 99.42029
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405254 54.959408
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405690 52.671585
|
||||
[src/scene/setting/ATERM] below 100: ATERM_81405ACC 88.583336
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigStart 99.805824
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigEnd 99.4186
|
||||
[src/scene/setting/ATERM] below 100: ATERMi_ApConfigGetState 99.42857
|
||||
[src/scene/setting/ATERM] baseline: code 1648/19204 data 18448 functions 6 fuzzy 82.5403
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 82.45576 -> 82.60614
|
||||
global fuzzy_match_percent: 95.09687 -> 95.14824
|
||||
global complete_code_percent: 58.19218 -> 58.19218
|
||||
global matched_data_percent: 89.46201 -> 89.46201
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
note: config touched: configure.py (orchestrator reviews every config/symbols change)
|
||||
GATE PASS
|
||||
```
|
||||
Reference in New Issue
Block a user