├── .gitignore ├── LICENSE ├── Main.py └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Young 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*-# 2 | __author__ = 'young' 3 | 4 | import requests 5 | # HTTP LIB requests: http://docs.python-requests.org/en/latest/ 6 | 7 | class CodeSearch1024(): 8 | def __init__(self, codeWithMask, parent=None): 9 | self.url='http://1024ss.net/register.php' 10 | self.codeWithMask = codeWithMask 11 | self.chars = '0123456789abcdefghijklmnopqrstuvwxyz' 12 | self.chars1 = '0123456789'#'abcdefghijklmnopqrstuvwxyz' 13 | self.chars2 = '0123456789' 14 | 15 | def getMaskCount(self): 16 | count = 0 17 | for ch in self.codeWithMask: 18 | if ch == '*': 19 | count += 1 20 | return count 21 | 22 | def start(self, samemask = False): 23 | maskCount = self.getMaskCount() 24 | self.codeWithMask = self.codeWithMask.replace('*','%s') 25 | if maskCount>3: 26 | print(u'暂时不能处理大于3个隐藏字符的邀请码') 27 | return 28 | if maskCount == 0: 29 | code = self.codeWithMask 30 | result = self.doReg(code,0) 31 | if result == 'found': 32 | print('%s found!' % (code)) 33 | return 34 | else: 35 | print('%s %s!' % (code,result)) 36 | elif samemask: 37 | for ch in self.chars: 38 | code = self.codeWithMask % ((ch,)*maskCount) 39 | result = self.doReg(code,0) 40 | if result == 'found': 41 | print('%s found!' % (code)) 42 | return 43 | else: 44 | print('%s %s!' % (code,result)) 45 | elif maskCount == 1: 46 | for ch in self.chars: 47 | code = self.codeWithMask % (ch) 48 | result = self.doReg(code,0) 49 | if result == 'found': 50 | print('%s found!' % (code)) 51 | return 52 | else: 53 | print('%s %s!' % (code,result)) 54 | elif maskCount == 2: 55 | for ch1 in self.chars: 56 | for ch2 in self.chars: 57 | code = self.codeWithMask % (ch1,ch2) 58 | result = self.doReg(code,0) 59 | if result == 'found': 60 | print('%s found!' % (code)) 61 | return 62 | else: 63 | print('%s %s!' % (code,result)) 64 | 65 | elif maskCount == 3: 66 | for ch1 in self.chars: 67 | for ch2 in self.chars: 68 | for ch3 in self.chars: 69 | code = self.codeWithMask % (ch1,ch2,ch3) 70 | result = self.doReg(code,0) 71 | if result == 'found': 72 | print('%s found!' % (code)) 73 | return 74 | else: 75 | print('%s %s!' % (code,result)) 76 | print('done!') 77 | 78 | 79 | def doReg(self,code,n): 80 | #可重试5次 81 | if n>5: 82 | return 'timeout' 83 | 84 | postData = {'regname':'youngytj', 85 | 'regpwd':'999999', 86 | 'regpwdrepeat':'999999', 87 | 'regemail':'youngytj@sina.com', 88 | 'invcode':code, 89 | 'forward':'', 90 | 'step':'2' 91 | } 92 | try: 93 | r = requests.post(url=self.url,data=postData) 94 | html = r.text.encode(r.encoding).decode('gbk') 95 | if html.find(u'邀請碼錯誤')>-1: 96 | return 'incorrect' 97 | else: 98 | return 'found' 99 | except: 100 | return self.doReg(code,n+1) #递归 101 | 102 | 103 | #用法示例 104 | #code = raw_input(u'Please input a code: ') # e.g.: *8m*9754yupt307t 105 | code = '77c4e**e935*03c8' 106 | print 'code is', code 107 | print 'Running' 108 | reg = CodeSearch1024(code) 109 | reg.start(True) 110 | 111 | raw_input() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简介 2 | 得到带\*的邀请码后自动猜测\*符号并注册1024账号的程序 3 | 4 | # 使用说明 5 | * 安装Python2.7.10 6 | * 安装[HTTP LIB requests](http://docs.python-requests.org/en/latest/) 7 | * 修改程序中的注册地址,还有注册信息中的昵称,密码,邮箱等信息 8 | * 运行Python Main.py 9 | * 输入带\*的邀请码 10 | 11 | # 注意事项 12 | 目前匹配不大于3个带\*字符的邀请码 13 | --------------------------------------------------------------------------------