A Python problem?
I am trying to unlock my 1104X-E using this method:
https://www.makermatrix.com/blog/hacking-the-siglent-1104x-e-oscilloscope/Here's my note to the author about the problem I have encountered:
Thank you so much for sharing this! I have a 1104X-E and I have made good progress with your instructions -- to a point. I have not been able to run the Python code successfully.
I downloaded Python v3.11, from the Microsoft App Store. I copied/pasted your code to NotePad. I adjusted the Scope ID and Serial number to my numbers (the last five changed to "#####," for personal security.) See RAW Paste Data ( I hope this is where I am supposed to put my code.) I copied the adjusted code to the Clipboard.
I opened Python and right clicked to paste the updated code. Windows gives me a warning and I accept. Python opens and automatically pastes my code on the page.
I know little of coding and nothing of Python, but it appears that the script runs automatically and fails =
SyntaxError: invalid syntax
>>> print('{:5} {}'.format(opt, gen(SN)))
I rather think that this is not related to the scope ID and serial numbers that I adjusted. However, please confirm the syntaxes are correct for both. Please also confirm that the code runs automatically and that I do not need to clean/compile/run it, in some manner. Of course, I need to know what to do to get things to work correctly, as well. Please be very specific with your instructions, step by step.Not knowing when the author might check for comments, I thought that I would ask here, as well. Please and thank you, for your help.
t1d
HP All-in-One
Windows 11 - Current version
Full code:
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> # Keygen program for Siglent oscilloscopes
>>>
>>> import hashlib
>>>
>>> # You get this by running "SCOPEID?" at the SCIP prompt and removing the dashes
>>> SCOPEID = '000225480f4#####'
>>> # Replace this with your SN
>>> SN = 'SDSMMEBQ3#####'
>>> # This is one of the four options below
>>> Model = 'SDS1000X-E'
>>> # 'SDS1000X-E', 'SDS2000X-E', 'SDS2000X+', 'SDS5000X', 'ZODIAC-'
>>>
>>> bwopt = ('25M', '40M', '50M', '60M', '70M', '100M', '150M', '200M',
... '250M', '300M', '350M', '500M', '750M', '1000M', 'MAX')
>>> otheropt = ('AWG', 'WIFI', 'MSO', 'FLX',
... 'CFD', 'I2S', '1553', 'FG', '16LA')
>>>
>>> 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()
...
>>> for opt in bwopt:
... print('{:5} {}'.format(opt, gen(SCOPEID)))
... for opt in otheropt:
File "<stdin>", line 3
for opt in otheropt:
^^^
SyntaxError: invalid syntax
>>> print('{:5} {}'.format(opt, gen(SN)))