JEB 1.5.201408040(full) Python版注册机,作者:CodeColorist
JEB 1.5.201408040(full) Python版注册机,作者:CodeColoristhttps://gist.github.com/ChiChou/6a6427068965752c3c7b
http://scz.617.cn/misc/201507281725.txt
CodeColorist把Mac OS X的补上,我把Linux的补上。这个Python版JEB注册机同时支
持Windows、Darwin、Linux。区别就是取序列号不同:
wmic bios get serialnumber
ioreg -l
cat /var/lib/dbus/machine-id
#! /usr/bin/env python
# -*- coding: cp936 -*-
#
# Copyleft (c) 2014, 2025
# ------------------------------------------------------------------------
# Author : CodeColorist
# : https://gist.github.com/ChiChou/6a6427068965752c3c7b
# Original : quard@pediy
# : wangshy@pediy
# : scz
# : http://scz.617.cn/misc/201507251700.txt
# : http://scz.617.cn/misc/201507271722.txt
# : http://scz.617.cn/misc/201507281725.txt
# :
# Create : 2014-04-23 17:01
# Modify : 2015-07-28 17:25
# ------------------------------------------------------------------------
# The only thing they can't take from us are our minds. !H
#
import struct, time, hashlib, platform, re, subprocess
def License_GetSerialNumber () :
system= platform.system()
ctrl = \
{
'Windows' :
[
'wmic bios get serialnumber',
r'SerialNumber\s+(\S+)\s+'
],
'Darwin' :
[
'ioreg -l',
r'"IOPlatformSerialNumber" = "(\S+)"'
],
'Linux' :
[
'cat /var/lib/dbus/machine-id',
r'(\S+)'
]
}
if system in ctrl :
command, regular \
= ctrl
p = subprocess.Popen\
(
command.split( ' ' ),
stdin = subprocess.PIPE,
stdout= subprocess.PIPE,
stderr= subprocess.PIPE
)
out, err = p.communicate()
if not err :
return( re.search( regular, out, re.S ).group( 1 ) )
else:
raise Exception( "Failed to retrieve serial number.\n%s" % err )
else :
raise Exception( "OS not supported." )
#
# end of License_GetSerialNumber
#
def License_sum ( val ) :
i = 0
while val > 0 :
i += ( val & 0xF )
val >>= 4
#
# end of while
#
return( i % 10 )
#
# end of License_sum
#
def License_GetMachineId ( SerialNumber ) :
md5 = hashlib.md5()
md5.update( SerialNumber )
digest= md5.digest()
return( struct.unpack( '<Q', digest[:8]) )
#
# end of License_GetMachineId
#
def License_GetMachineId_2 ( MachineId ) :
low = MachineId & 0xFFFFFFFF
high = MachineId >> 32
n = low + 376273029 + 287454020 & 0xFFFFFFFF
m = high - 52416167 + 1432778632 & 0x7FFFFFFF
buf = struct.pack( '>LL', m, n )
return( struct.unpack( '>Q', buf ) )
#
# end of License_GetMachineId_2
#
def License_GenerateKey ( MachineId, timestamp ) :
l = License_GetMachineId_2( MachineId )
t = timestamp & 0xFFFFFFFF ^ 0x56739ACD
return( '%dZ%d%d' % ( l, t, License_sum( t ) ) )
#
# end of License_GenerateKey
#
def main () :
SerialNumber = License_GetSerialNumber()
MachineId = License_GetMachineId( SerialNumber )
timestamp = int( time.time() + 86400 * 365 * 100 )
ret = \
"SerialNumber : %s\n" \
"MachineId : %x\n" \
"MachineId_2 : %x\n" \
"License key : %s" \
% \
(
SerialNumber,
MachineId,
License_GetMachineId_2( MachineId ),
License_GenerateKey( MachineId, timestamp )
)
print ret
#
# end of main
#
if __name__ == '__main__' :
main()
thx fore share it~~awesome tool`~ 沙发?太神奇了 ~ 本帖最后由 gswxy 于 2015-8-26 18:39 编辑
可以使用了 谢谢大神 感谢分享~~话说楼主网盘分享里面有好东西! 哇,突然发现您是shencz师傅,感谢注册机
页:
[1]