PythonPart I 设置Python环境
Posted sunieve
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PythonPart I 设置Python环境相关的知识,希望对你有一定的参考价值。
01 设置Python环境
02 破解WingIDE
(1)下载专业版wingide
http://wingware.com/downloads/wing-pro/6.0.11-1/binaries&os=linux64
(2)破解代码crack.py
1 import string 2 import random 3 import sha 4 5 BASE16 = ‘0123456789ABCDEF‘ 6 BASE30 = ‘123456789ABCDEFGHJKLMNPQRTVWXY‘ #charset of License 7 8 9 def randomstring(size=20, chars=string.ascii_uppercase + string.digits): 10 return ‘‘.join((random.choice(chars) for _ in range(size))) #generate random License 11 12 13 def BaseConvert(number, fromdigits, todigits, ignore_negative=True): 14 if not ignore_negative and str(number)[0] == ‘-‘: 15 number = str(number)[1:] 16 neg = 1 17 else: 18 neg = 0 19 x = long(0) 20 for digit in str(number): 21 x = x * len(fromdigits) + fromdigits.index(digit) 22 23 res = ‘‘ 24 while x > 0: 25 digit = x % len(todigits) 26 res = todigits[digit] + res 27 x /= len(todigits) 28 29 if neg: 30 res = ‘-‘ + res 31 return res 32 33 34 def AddHyphens(code): 35 return code[:5] + ‘-‘ + code[5:10] + ‘-‘ + code[10:15] + ‘-‘ + code[15:] #change format 36 37 38 def SHAToBase30(digest): 39 tdigest = ‘‘.join([c for i, c in enumerate(digest) if i / 2 * 2 == i]) 40 result = BaseConvert(tdigest, BASE16, BASE30) 41 while len(result) < 17: 42 result = ‘1‘ + result 43 return result 44 45 46 def loop(ecx, lichash): 47 part = 0 48 for c in lichash: 49 part = ecx * part + ord(c) & 1048575 50 return part 51 52 rng = AddHyphens(‘CN‘ + randomstring(18, ‘123456789ABCDEFGHJKLMNPQRTVWXY‘)) 53 print ‘License id: ‘ + rng #generate License id and write it in wing 54 act30 = raw_input(‘Enter request code:‘) #get request code from wing 55 lichash = act30 56 hasher = sha.new() 57 hasher.update(act30) #sha request code 58 hasher.update(rng) #sha license id 59 lichash = AddHyphens(lichash[:3] + SHAToBase30(hasher.hexdigest().upper())) 60 61 part5 = format(loop(23, lichash), ‘05x‘) + format(loop(161, lichash), ‘05x‘) + format(loop(47, lichash), 62 ‘05x‘) + format(loop(9, lichash), 63 ‘05x‘) 64 part5 = BaseConvert(part5.upper(), BASE16, BASE30) 65 while len(part5) < 17: 66 part5 = ‘1‘ + part5 67 68 part5 = ‘AXX‘ + part5 69 print ‘Activation code: ‘ + AddHyphens(part5) #output Activation code and write it in wing
(3) 破解wing
step1 运行crack.py,得到License id,把License id输入进wing
step2 从wing中复制request code, 输入crack.py的输入框
step3 从crack.py得到Activation code,写入wing
以上是关于PythonPart I 设置Python环境的主要内容,如果未能解决你的问题,请参考以下文章