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 51
|
import base64 import os
def andd(a,b): v3=1 if a&b==0 else 0 v4=1 if v3&a==0 else 0 v5=1 if v3&b==0 else 0 return 1 if v4&v5==0 else 0 tab = [ord(i) for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'] rtab = [0]*256 for i in range(len(tab)): rtab[tab[i]]=i a = [0x54, 0x54, 0x18, 0x59, 0x54, 0x38, 0xc, 0x2f, 0x57, 0x38, 0x4, 0x2f, 0x54, 0x0, 0x32, 0x2f, 0x54, 0x54, 0x10, 0x24, 0x57, 0x0, 0x2e, 0x2e, 0x54, 0x11, 0xc, 0x17, 0x2d, 0x26, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x13, 0x8, 0x30, 0x54, 0x13, 0x8, 0x30, 0x54, 0x10, 0x8, 0x9, 0x54, 0x56, 0x2e, 0x2a, 0x54, 0x2d, 0x10, 0x26, 0x54, 0x56, 0x10, 0xc, 0x54, 0x0, 0x57, 0x0, 0x2d, 0x2e, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x11, 0x8, 0x7, 0x54, 0x57, 0xc, 0x57, 0x54, 0x2d, 0x8, 0x2d, 0x54, 0x13, 0x36, 0x23, 0x54, 0x13, 0x36, 0x10, 0x54, 0x54, 0x10, 0x24, 0x54, 0x2d, 0x53, 0x6, 0x2d, 0x29, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x2d, 0x14, 0x2f, 0x54, 0x55, 0x32, 0x53, 0x54, 0x57, 0x4, 0x38, 0x54, 0x0, 0x4a, 0x26, 0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x3b, 0x18, 0xe, 0x54, 0x57, 0x53, 0x2b, 0x54, 0x54, 0x53, 0x20, 0x54, 0x2d, 0x53, 0x6, 0x54, 0x38, 0x4, 0x57, 0x54, 0x55, 0x57, 0x16, 0x2d, 0x29, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x11, 0x4, 0xd, 0x54, 0x11, 0x4, 0xd, 0x54, 0x0, 0x32, 0x2, 0x54, 0x0, 0x32, 0x2, 0x57, 0x28, 0x4, 0x10, 0x57, 0x2d, 0x53, 0x12, 0x54, 0x54, 0x10, 0x24, 0x57, 0x2a, 0x26, 0x2c, 0x54, 0x11, 0x8, 0x7, 0x2d, 0x24, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x38, 0x8, 0x16, 0x54, 0x0, 0x32, 0x24, 0x57, 0x38, 0x26, 0x14, 0x54, 0x13, 0x14, 0x9, 0x54, 0x38, 0x8, 0x13, 0x54, 0x2d, 0x10, 0x57, 0x54, 0x54, 0x10, 0x24, 0x57, 0x28, 0x2e, 0x2c, 0x54, 0x3, 0x53, 0x19, 0x2d, 0x26, 0x5c, 0x5c, 0x0, 0x0, 0x57, 0x2a, 0x57, 0x11, 0x57, 0x0, 0x2e, 0x2e, 0x54, 0x3b, 0x22, 0x54, 0x54, 0x11, 0x36, 0xb, 0x54, 0x13, 0x4, 0x52, 0x54, 0x2d, 0xc, 0x19, 0x54, 0x54, 0x10, 0x24, 0x54, 0x3b, 0x26, 0x59, 0x54, 0x3b, 0x22, 0x55, 0x2d, 0x26, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x3, 0x4a, 0x13, 0x54, 0x3, 0x4a, 0x13, 0x54, 0x13, 0x8, 0x27, 0x57, 0x38, 0x0, 0x32, 0x7, 0xf, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x3b, 0x53, 0x3b, 0x57, 0x3b, 0x53, 0x3b, 0x54, 0x55, 0x36, 0xf, 0x54, 0x2d, 0x10, 0x14, 0x54, 0x38, 0x57, 0x7, 0x54, 0x11, 0x53, 0xd, 0x54, 0x54, 0x10, 0x24, 0x57, 0x28, 0x4, 0x10, 0x54, 0x3, 0x4, 0x19, 0x2d, 0x2d, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x0, 0x32, 0x11, 0x54, 0x57, 0xc, 0x57, 0x54, 0x13, 0x32, 0x32, 0x54, 0x13, 0x14, 0x9, 0x54, 0x3, 0x4a, 0x58, 0x54, 0x55, 0x32, 0x53, 0x54, 0x54, 0x10, 0x24, 0x54, 0x38, 0x36, 0x2b, 0x54, 0x11, 0x8, 0x2e, 0x2d, 0x24, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x54, 0x18, 0x59, 0x54, 0x2d, 0x8, 0x15, 0x54, 0x38, 0x4a, 0x10, 0x57, 0x2a, 0x0, 0x23, 0x54, 0x56, 0x14, 0x0, 0x54, 0x55, 0x2e, 0x22, 0x54, 0x54, 0x10, 0x24, 0x54, 0x0, 0x32, 0x11, 0x57, 0x3b, 0xc, 0x27, 0x2d, 0x26, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x38, 0x0, 0x2f, 0x57, 0x0, 0x2e, 0x4, 0x57, 0x2a, 0x26, 0x2c, 0x28, 0x36, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0xe, 0x8, 0x33, 0x54, 0x38, 0x14, 0x29, 0x54, 0x11, 0x36, 0x8, 0x54, 0x3b, 0x18, 0x16, 0x54, 0xe, 0x10, 0x12, 0x57, 0x2d, 0x36, 0x52, 0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b, 0xc, 0x54, 0x54, 0x13, 0x36, 0x52, 0x2d, 0x23, 0x5c, 0x5c, 0x0, 0x0, 0x54, 0x3b, 0x2a, 0x2c, 0x54, 0xe, 0x8, 0x33, 0x54, 0x2d, 0x8, 0x20, 0x57, 0x2d, 0x36, 0x52, 0x54, 0x38, 0x0, 0x32, 0x57, 0x3b, 0xc, 0x11, 0x2d, 0x29, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x2e, 0x4, 0x54, 0x3b, 0x22, 0x33, 0x54, 0x38, 0x4a, 0xc, 0x54, 0x2d, 0x8, 0x20, 0x54, 0x2d, 0x8, 0x10, 0x54, 0x2d, 0x8, 0x36, 0x54, 0x54, 0x36, 0x2c, 0x2d, 0x2f, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x52, 0x37, 0x16, 0x3b, 0x39, 0x28, 0x6, 0x3, 0x36, 0x27, 0xf, 0x0, 0x36, 0x2c, 0x6, 0x5, 0x53, 0x58, 0x18, 0x3, 0x26, 0x33, 0x4a, 0x7, 0x6, 0x5c, 0x5c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
def trans(v3): v2 = 0 for k in range(8): v2 = andd(((v3>>(7-k))&1),((97>>(7-k))&1))&1^2*v2 v2&=0xff return v2 def get(s1,s2): b1 = 0 b2 = 0 i=0 while s1[i]!=ord('='): b1=s1[i] i+=1 b2 = s2[i-1] print(b1,b2) return b1-b2 s = [] for i in range(0,34,2): t = 0 ss = [] for j in range(42): v3 = a[42*i+j] v2 = trans(v3) ss.append(v2) t=get(bytes(ss),base64.b64encode(base64.b64decode(bytes(ss)))) ss = [] for j in range(42): v3 = a[42*(i+1)+j] v2 = trans(v3) ss.append(v2) t=(t<<4)+get(bytes(ss),base64.b64encode(base64.b64decode(bytes(ss)))) s.append(t) print(bytes(s))
|