int
judge08_2(unsigned
int
*
flag, unsigned
int
*
check,
int
index)
{
for
(
int
j
=
0
; j <
5
; j
+
+
)
/
/
check中是
5
个
4
位数
{
check[j] ^
=
flag[index];
}
int
num
=
check[
0
] ^ check[
1
] ^ check[
2
] ^ check[
3
] ^ check[
4
];
int
bit0
=
(num &
0xFF000000
) >>
24
;
int
bit1
=
(num &
0xFF0000
) >>
16
;
int
bit2
=
(num &
0xFF00
) >>
8
;
int
bit3
=
num &
0xFF
;
/
/
printf(
"%x\n"
, num);
int
e
=
bit0 ^ bit2;
int
f
=
bit1 ^ bit3;
/
/
printf(
"%x %x\n"
, e, f);
if
(((e &
0x1F
)
=
=
0
) && ((f &
0x1F
)
=
=
0
))
{
/
/
printf(
"%x %x\n"
, (e &
0x1F
), (f &
0x1F
));
return
1
;
}
return
0
;
}
void ctf08()
{
unsigned
int
check[]
=
{
0x43616e20
,
0x796f7520
,
0x63726163
,
0x6b206d65
,
0x3f5e6f6c
};
unsigned
int
flag[]
=
{
0x427a635a
,
0x446e664e
,
0x49716d51
,
0x43746b54
,
0x476c774c
,
0x79445965
,
0x6948496a
,
0x78535877
,
0x6b524b7a
,
0x70465076
};
for
(
int
i
=
0
; i <
1000
; i
+
+
)
{
int
j
=
0
;
for
(; j <
10
; j
+
+
)
/
/
从
0
-
9
遍历
{
int
v12
=
((
0xFFFEC610
>> i
%
31
)
+
(
0x30
+
j))
%
0xA
;
if
((i &
1
) !
=
v12 <
1
)
/
/
过滤掉不符合的数字
continue
;
if
(v12
=
=
0
)
/
/
i是奇数位
{
for
(
int
k
=
0
; k <
5
; k
+
+
)
/
/
check中是
5
个
4
位数
{
check[k] ^
=
flag[v12];
/
/
其实也就是
0
位
}
printf(
"id=%d num=%d v12=%d\n"
, i, j, v12);
break
;
}
int
num
=
check[
0
] ^ check[
1
] ^ check[
2
] ^ check[
3
] ^ check[
4
];
/
/
75
73
1D
00
=
0x001d7375
int
al
=
(num &
0xFF00
) >>
8
;
/
/
73
int
dl
=
(num &
0xFF000000
) >>
24
;
int
v15;
if
(v12 >
=
6
)
{
int
e
=
al ^ dl;
if
((e &
0x1F
) !
=
0
)
continue
;
v15
=
13
-
v12;
al
=
num &
0xFF
;
dl
=
(num &
0xFF0000
) >>
16
;
}
else
v15
=
8
-
v12;
int
a
=
(al << v15) &
0xff
;
int
b
=
(dl << v15) &
0xff
;
if
(a
=
=
((
128
+
b) &
0xff
))
{
printf(
"id=%d num=%d v12=%d\n"
, i, j, v12);
if
(judge08_2(flag, check, v12))
{
printf(
"hahaha"
);
exit(
0
);
}
break
;
}
}
if
(j
=
=
10
)
/
/
没找到数字的话
{
for
(
int
k
=
0
; k <
5
; k
+
+
)
/
/
check中是
5
个
4
位数
{
check[j] ^
=
flag[
9
];
/
/
其实也就是
0
位
}
printf(
"id=%d [9]\n"
, i);
}
}
/
/
search08(flag, check,
0
);
}