defgen(x): h = hashlib.md5(( hashkey + (Model+'\n').ljust(32, '\x00') + opt.ljust(5, '\x00') + 2*(((SCOPEID if opt in bwopt else SN) + '\n').ljust(32, '\x00')) + '\x00'*16).encode('ascii') ).digest() key = '' for b in h: if (b <= 0x2For b > 0x39) and (b <= 0x60or b > 0x7A): m = b % 0x24 b = m + (0x57if m > 9else0x30) if b == 0x30: b = 0x32 if b == 0x31: b = 0x33 if b == 0x6c: b = 0x6d if b == 0x6f: b = 0x70 key += chr(b) return key.upper()
print('--------------------------------') print('\n') for opt in bwopt: print('{:5} {}'.format(opt, gen(SCOPEID)))
print('\n') print('--------------------------------') print('\n') for opt in otheropt: print('{:5} {}'.format(opt, gen(SN)))