int
Check(char
*
Input
)
{
char FakeFlag[
48
];
strcpy_s(FakeFlag,
48
,
"flag{BzcZDnfNIqmQCtkTGlwLyDYeiHIjxSXwkRKzpFPv}"
);
_BYTE Data[
27
];
strcpy_s((char
*
)Data,
27
,
"Can you crack me?^olo^"
);
int
StrLength
=
strlen(
Input
);
int
bFail1
=
0
, bFail2
=
0
, MayFail
=
0
;
int
v9, v20
=
0
;
int
Last
=
0
;
int
v11;
int
v26;
DWORD Index
=
0
;
char v7
=
FakeFlag[
42
];
bool
v8
=
StrLength >
0
;
do
{
if
(v8)
{
int
v19
=
Input
[Index];
if
(v19
-
(unsigned
int
)
'0'
>
9
)
/
/
大于‘
9
’失败?
{
return
0
;
bFail1
=
1
;
MayFail
=
1
;
goto LABEL_32;
}
v9
=
(v19
+
(
0xFFFEC610
>> (Index
%
0x1F
)))
%
0xA
;
if
((Index &
1
) !
=
v9 <
1
)
{
return
0
;
MayFail
=
1
;
}
}
else
{
v9
=
v20;
Last
=
1
;
}
v11
=
v9;
v26
=
*
(_DWORD
*
)&Data[
16
] ^
*
(_DWORD
*
)&Data[
12
] ^
*
(_DWORD
*
)&Data[
8
] ^
*
(_DWORD
*
)&Data[
4
] ^
*
(_DWORD
*
)Data;
if
(Last ||
1
)
{
if
((((unsigned __int8)v26 ^ (unsigned __int8)(Data[
18
] ^ Data[
14
] ^ Data[
10
] ^ Data[
6
] ^ Data[
2
])) &
0x1F
) !
=
0
|| ((HIBYTE(v26) ^ BYTE1(v26)) &
0x1F
) !
=
0
)
{
/
/
v11
=
-
1
;
/
/
if
(Last)
/
/
return
0
;
}
else
{
printf(
"ans: %s"
,
Input
);
getchar();
return
1
;
}
/
/
goto LABEL_26;
}
if
(v9 >
=
1
)
{
BYTE v12, v13, v14;
v12
=
BYTE2(v26);
if
(v9 >
=
6
)
{
if
((((unsigned __int8)v26 ^ BYTE2(v26)) &
0x1F
) !
=
0
)
{
LABEL_25:
return
0
;
v11
=
9
;
goto LABEL_26;
}
v12
=
HIBYTE(v26);
v13
=
13
-
v9;
v14
=
BYTE1(v26);
}
else
{
v13
=
8
-
v9;
v14
=
v26;
}
if
((((v14 << v13)
+
0x80
)&
0xff
)
=
=
((v12 << v13)&
0xff
))
{
if
(Index
=
=
StrLength
-
1
)
return
2
;
goto LABEL_26;
}
goto LABEL_25;
}
LABEL_26:
v20
=
v11;
if
(Last)
{
bool
v15
=
v11 <
0
;
bFail1
=
MayFail;
if
(v15)
bFail2
=
1
;
}
else
{
int
v16
=
*
(_DWORD
*
)&FakeFlag[
4
*
v11
+
5
];
*
(_DWORD
*
)Data ^
=
v16;
*
(_DWORD
*
)&Data[
4
] ^
=
v16;
*
(_DWORD
*
)&Data[
8
] ^
=
v16;
*
(_DWORD
*
)&Data[
12
] ^
=
v16;
v8
=
v11 <
=
8
;
bFail1
=
MayFail;
*
(_DWORD
*
)&Data[
16
] ^
=
v16;
if
(!v8 && (v7 &
0x10000000
)
=
=
0
)
{
v7
=
~v7 &
0x7F
;
FakeFlag[
42
]
=
v7;
}
}
LABEL_32:
v8
=
(
int
)
+
+
Index < StrLength;
}
while
((
int
)Index <
=
StrLength);
if
(bFail1 || bFail2)
return
0
;
return
2
;
}