1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| rand = [19954,28965,14137,3558,10069,31251,32362,11940,3430,27969,14847,11465,12175,9021,27614,8175,12050,16408,20581,6478,17749,4203,22364,2272,9340,14232,10535,32196,17981,4946,3136,17889,7408,30816,16101,12491,23270,11421,6414,31210,17404,16964,2722,7641,15728,14442,18922,7948,4083,1228,17990,32182,4095,27339,13087,26345,8298,17333,16156,24319,17212,7238,19353,27450,11454,19311,14421,32423,3283,26197,5994,11848,651,13725,23939,28785,28150,4071,25161,27507,5174,15768,17694,6008,18904,18909,2574,14254,5989,25837,770,28328,3123,15246,22839,29185,13185,26586,19183,8514,24515,24387,29031,1029,16443,469,8968,29531,29897,11963,17889,29292,5124,517,9813,31325,22409,8104,9745,15735,25236,12230,22338,9605,22221,28720,22532,4477,11108,32554,541,5731,31327,17262,17131,18283,14387,5491,12187,18782,2450,3566,10652,13630,11141,7578,10067,3629,8634,21044,29969,20107,7967,27850,578,20575,23728,11574,3815,5368,21132,30438,19782,12244,1871,13022,19423,22720,27036,4863,15267,26945,26617,6793,26209,18739,15072,4063,27009,3760,5394,15242,2292,21811,11823,6273,11883,4093,23428,22951,26823,23480] msg = [72, 77, 59, 160, 39, 49, 40, 84, 109, 241, 33, 53, 24, 115, 106, 76, 113, 59, 189, 152, 182, 90, 119, 45, 11, 43, 203, 155, 228, 138, 76, 169, 92, 79, 27, 241, 152, 61, 48, 89, 63, 20, 252, 122, 244, 100, 2, 43]
dict = {}
for i in range(256): dict[(23*(i)+66)&0xff]=i
print(dict)
for ip in range(0,len(msg),12): for j in range(31,-1,-1): t=msg[ip:ip+12] tmp=[i for i in t] data=[] for i in range(0,len(tmp),4): data.append(int.from_bytes(tmp[i:i+4],"little")) get = data
v23 = get[0] >> 7 v24 = rand[6*j+4] + v23 v25 = (get[0] >> 15) ^ (get[0] << 10) | 3 data[2] -= v24 + (rand[6*j+5] ^ v25) data[2] &= 0xffffffff
v23 = get[2] >> 7 v24 = rand[6*j+2] + v23 v25 = (get[2] >> 15) ^ (get[2] << 10) | 3 data[1] -= v24 + (rand[6*j+3] ^ v25) data[1] &= 0xffffffff
v23 = get[1] >> 7 v24 = rand[6*j] + v23 v25 = (get[1] >> 15) ^ (get[1]<< 10) | 3 data[0] -= v24 + (rand[6*j+1] ^ v25) data[0]&=0xffffffff
for item in range(3): i1=[i for i in bytes.fromhex(hex(data[item])[2:].rjust(8,"0"))][::-1] for i2 in range(4): msg[ip+4*item+i2]=dict[i1[i2]]
print(bytes(msg))
|