#!/usr/bin/python import commands import re import sys chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" for c1 in chars: if re.match(".* : 7f.*", commands.getoutput("./crypt " + c1)): for c2 in chars: if re.match(".* : 7f e7.*", commands.getoutput("./crypt " + c1 + c2)): for c3 in chars: if re.match(".* : 7f e7 ff.*", commands.getoutput("./crypt " + c1 + c2 + c3)): for c4 in chars: if re.match(".* : 7f e7 ff ce.*", commands.getoutput("./crypt " +c1+c2+c3+c4)): for c5 in chars: if re.match(".* : 7f e7 ff ce 0.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5)): for c6 in chars: if re.match(".* : 7f e7 ff ce 0 98.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6)): for c7 in chars: if re.match(".* : 7f e7 ff ce 0 98 15.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6+c7)): for c8 in chars: if re.match(".* : 7f e7 ff ce 0 98 15 dd.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6+c7+c8)): for c9 in chars: if re.match(".* : 7f e7 ff ce 0 98 15 dd 88.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6+c7+c8+c9)): for c10 in chars: if re.match(".* : 7f e7 ff ce 0 98 15 dd 88 fb.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6+c7+c8+c9+c10)): for c11 in chars: if re.match(".* : 7f e7 ff ce 0 98 15 dd 88 fb 6e.*", commands.getoutput("./crypt " +c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11)): xmodem = commands.getoutput("./pycrc-0.7.11/pycrc.py --model=xmodem --check-string=" +c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11) print c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11 + " (" + xmodem + ")" if xmodem == "0x8124": print "GOT IT!" sys.exit(0)