下面是一个数学问题的复杂伪代码,它试图检查输入的密码是否正确。
Previous Analysis Done:数据以3x3矩阵的形式排列,i,j为行,列,k为临时变量,生成测试条件。元素 v6、v7、v8 .. 等在 k 循环中用作数组。最终目标是返回 0 以成功完成代码。
signed __int64 __fastcall check_password(const char *a1)
{
signed int i; // [rsp+10h] [rbp-30h]
signed int j; // [rsp+14h] [rbp-2Ch]
int v4; // [rsp+18h] [rbp-28h]
signed int k; // [rsp+1Ch] [rbp-24h]
char v6; // [rsp+20h] [rbp-20h]
char v7; // [rsp+21h] [rbp-1Fh]
char v8; // [rsp+22h] [rbp-1Eh]
char v9; // [rsp+23h] [rbp-1Dh]
char v10; // [rsp+24h] [rbp-1Ch]
char v11; // [rsp+25h] [rbp-1Bh]
char v12; // [rsp+26h] [rbp-1Ah]
char v13; // [rsp+27h] [rbp-19h]
char v14; // [rsp+28h] [rbp-18h]
unsigned __int64 v15; // [rsp+38h] [rbp-8h]
v15 = __readfsqword(0x28u);
v6 = 79;
v7 = 8;
v8 = 29;
v9 = 58;
v10 = 81;
v11 = 21;
v12 = 49;
v13 = 123;
v14 = 114;
if ( strlen(a1) != 9 )
return -1;
for ( i = 0; i <= 2; ++i )
{
for ( j = 0; j <= 2; ++j )
{
v4 = 0;
for ( k = 0; k <= 2; ++k )
v4 = (a1[3 * k + j] * *(&v6 + 3 * i + k) + v4) % 127;
if ( i == j )
{
if ( v4 != 1 )
return -2;
}
else if ( v4 )
{
return -2;
}
}
}
return 0;
}