nums = [] keys = open('./usbdata.txt','r') posx = 0 posy = 0 for line in keys: x = int(line[2:4],16) y = int(line[4:6],16) if x > 127 : x -= 256 if y > 127 : y -= 256 posx += x posy += y btn_flag = int(line[0:2],16) # 1 for left , 2 for right , 0 for nothing if btn_flag == 1 : print posx , -posy keys.close()
最后gnuplot画下点就可以得到flag图片。
easyRe
简单题,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Python 3.8.0 (default, Oct 232019, 18:51:26) [GCC 9.2.0] on linux Type"help", "copyright", "credits"or"license"for more information. >>> >>> s = "lfgaL{teU__stsr4_t3R3vSr}e" >>> for i inrange(13): ... KeyboardInterrupt >>> res = "" >>> for i inrange(13): ... res += s[i*2+1]+s[i*2] ... >>> res 'flag{Let_Us_st4rt_R3v3rSe}' >>>
m = "" for i inrange(12): now = cipher[i*4:(i+1)*4] ch = "".join(map(lambda x: bin(ord(x)-48)[2:].rjust(8,'0')[2:],now)) m += "".join([chr(int(ch[8*i:8*(i+1)],2)) for i inrange(3)])