一道是WhaleCTF的r100(decamp)


a1 为 flag

该函数是一个二维数组

等式等于1的话 返回0

python解密脚本

flag = ""

key = [[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]]

v3 = "Dufhbmf"
v4 = "pG`imos"
v5 = "ewUglpt"

for i in range(len(v3)):
	key[0][i] = ord(v3[i])
	key[1][i] = ord(v4[i])
	key[2][i] = ord(v5[i])

for i in range(0,12):
	flag += chr(key[(i%3)][2*int((i/3))]-1)

print flag

c语言脚本

#include<stdio.h>
int main()
{
	char s[3][7]={{"Dufhbmf"},{"pG`imos"},{"ewUglpt"}};
	char flag[12],i;
	for(i=0;i<=11;++i)
	{
		flag[i]=s[i%3][2*(i/3)]-1;
	 } 

	 printf("flag:%s\n\t括号李",flag);
	 
return 0;
}

第二道是安恒月赛的一道逆向 xor


 

flag = ""

global_number = [0x66, 0x0A, 0x6B, 0x0C, 0x77, 0x26, 0x4F, 0x2E, 0x40, 0x11, 
  0x78, 0x0D, 0x5A, 0x3B, 0x55, 0x11, 0x70, 0x19, 0x46, 0x1F, 
  0x76, 0x22, 0x4D, 0x23, 0x44, 0x0E, 0x67, 0x06, 0x68, 0x0F, 
  0x47, 0x32, 0x4F]

for i in range(1,len(global_number))[::-1]:
	flag += chr(global_number[i]^global_number[i-1])

print chr(global_number[0]) + flag[::-1]

 

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注