測試代碼
# Keygen program for Siglent oscilloscopes
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# READ THIS COMPLETLY BEFORE YOU START
# AND READ ALL OTHER INFORMATION HERE IN THE SCRIPT
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# PLEASE GET TIME FOR THIS !!!
# Go to Siglent homepage and find out witch model you have.
# When you have a SDS1104X-E the model is SDS1000X-E.
# And you can find out how much you can upgrade the bandwidth.
# Because the model SDS1000X-E have two versions with different bandwidths.
# And you can find out which options are possible.
# You had to increase the bandwidth gradually. If your model has more
bandwidths like two.
# Connect your scope via LAN to your home network.
# Activate LAN in the UI.
# Use DHCP to get the ip automaticly from your router.
# Or enter a fix ip config.
# Find out which ip the device got.
# Port is 5024.
# Search in google for the telnet programm "putty" you can use the telnet
version.
# Start putty and enter the ip adress, port and click connect.
# You can enter here the SCIP prompts.
# The SCIP prompts comes later in the script.
# Enter all SCIP prompts without the ""
# This is a python script.
# You have to run this script.
# And read the output from this script.
# THE INFO TOO !!!
# Search google for a "online python debugger".
# Or use a offline python debugger.
# Change in the script:
# SCOPEID, SN and Model with your own.
# Run the script.
# The generated key is binded by a keyword.
# The keyword represents the bandwidth or the option.
# The keyword 200M represents a bandwidth of 200Mhz.
# The keyword WIFI represents the option WIFI, so you need only a WIFI dongle.
# The keyword AWG represents the option to concect
# a siglent wafeform generator over USB to the scope.
import hashlib
# You get this by running "SCOPEID?" at the SCIP prompt and removing the
dashes
# Or with "MD5_SRLN?" over the SCIP promt without the dashes
SCOPEID = 'ID'
# Replace this with your SN
# You get this over the info from the UI
# Sometime find this under "Info"
SN = 'SN'
# Enter here the basic model
# You get this by running "MD5_PR?" at the SCIP prompt
# A sample: You have the SDS1104X-E than enter "SDS1000X-E"
# Some more basic models: "SDS1000X-E", "SDS2000X-E", "SDS2000X+",
"SDS5000X", "ZODIAC-"
Model = 'SDS800X-HD'
# You can add more bandwidhts here, when you have the ríght keyword
# Not all bandwidths works on your device!
bwopt = ('25M', '40M', '50M', '60M', '70M', '100M', '150M', '200M',
'250M', '300M', '350M', '500M', '750M', '1000M', 'MAX')
# You can add more options here, when you have the ríght keyword
# Not all options works on your device!
otheropt = ('AWG', 'WIFI', 'MSO', 'FLX', 'CFD', 'I2S', '1553',
'FG', '16LA', 'PWA', 'MANC', 'SENT')
# NO CHANGES HERE !!!
# NO MORE INFORMATION HERE !!!
hashkey =
'5zao9lyua01pp7hjzm3orcq90mds63z6zi5kv7vmv3ih981vlwn06txnjdtas3u2wa8msx61i12ueh14t7kqwsfskg032nhyuy1d9vv2wm925rd18kih9xhkyilobbgy'
def gen(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 <= 0x2F or b > 0x39) and (b <= 0x60 or b > 0x7A):
m = b % 0x24
b = m + (0x57 if m > 9 else 0x30)
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('INFO: CHECK YOUR GENERATED KEY BEFOR ENTER A NEW ONE !!!' + '\n')
print('You get your bandwidth by running "PRBD?" at the SCIP prompt' + '\n')
print('You get your bandwidth key by running "MCBD?" at the SCIP prompt' +
'\n')
print('Compare your key with the generated key')
print('INFO: IT HAVE TO BE SAME !!!')
print('\n')
print('\n')
print('