Skip to content

Commit

Permalink
Merge pull request #9 from lanvent/patch
Browse files Browse the repository at this point in the history
Patch
  • Loading branch information
zdm65477730 authored Dec 16, 2022
2 parents 4c90ebc + b5234a3 commit 92844e1
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 98 deletions.
16 changes: 14 additions & 2 deletions py/NSCB.bat
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
ECHO ******************************************
echo Or Input "b" to return to the list options
Expand Down Expand Up @@ -1116,6 +1118,10 @@ if /i "%bs%"=="12" set "vkey=-kp 12"
if /i "%bs%"=="12" set "capRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "vkey=-kp 14"
if /i "%bs%"=="14" set "capRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "vkey=-kp 15"
if /i "%bs%"=="15" set "capRSV=--RSVcap 1006632960"
if /i "%vkey%"=="none" echo WRONG CHOICE
if /i "%vkey%"=="none" goto s_KeyChange_wrongchoice
goto s_KeyChange_skip
Expand Down Expand Up @@ -1901,7 +1907,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
ECHO *****************************************
echo Or Input "b" to return to the option list
Expand Down Expand Up @@ -1940,6 +1948,10 @@ if /i "%bs%"=="12" set "vkey=-kp 12"
if /i "%bs%"=="12" set "capRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "vkey=-kp 14"
if /i "%bs%"=="14" set "capRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "vkey=-kp 15"
if /i "%bs%"=="15" set "capRSV=--RSVcap 1006632960"
if /i "%vkey%"=="none" echo WRONG CHOICE
if /i "%vkey%"=="none" goto m_KeyChange_wrongchoice

Expand Down
24 changes: 21 additions & 3 deletions py/ztools/LEGACY.bat
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
ECHO ******************************************
echo Or Input "b" to return to the list options
Expand Down Expand Up @@ -606,6 +608,10 @@ if /i "%bs%"=="12" set "vkey=-kp 12"
if /i "%bs%"=="12" set "capRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "vkey=-kp 14"
if /i "%bs%"=="14" set "capRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "vkey=-kp 15"
if /i "%bs%"=="15" set "capRSV=--RSVcap 1006632960"
if /i "%vkey%"=="none" echo WRONG CHOICE
if /i "%vkey%"=="none" goto s_KeyChange_wrongchoice

Expand Down Expand Up @@ -989,7 +995,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
ECHO *****************************************
echo Or Input "b" to return to the option list
Expand Down Expand Up @@ -1028,6 +1036,10 @@ if /i "%bs%"=="12" set "vkey=-kp 12"
if /i "%bs%"=="12" set "capRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "vkey=-kp 14"
if /i "%bs%"=="14" set "capRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "vkey=-kp 15"
if /i "%bs%"=="15" set "capRSV=--RSVcap 1006632960"
if /i "%vkey%"=="none" echo WRONG CHOICE
if /i "%vkey%"=="none" goto m_KeyChange_wrongchoice

Expand Down Expand Up @@ -1819,7 +1831,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
ECHO ******************************************
echo Or Input "b" to return to the list options
Expand Down Expand Up @@ -1858,6 +1872,10 @@ if /i "%bs%"=="12" set "vkey=-kp 12"
if /i "%bs%"=="12" set "capRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "vkey=-kp 14"
if /i "%bs%"=="14" set "capRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "vkey=-kp 15"
if /i "%bs%"=="15" set "capRSV=--RSVcap 1006632960"
if /i "%vkey%"=="none" echo WRONG CHOICE
if /i "%vkey%"=="none" goto m_KeyChange_wrongchoice

Expand Down
12 changes: 9 additions & 3 deletions py/ztools/NSCB_config.bat
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ echo Input "9" to change top keygeneration to 9 (FW 8.1.0)
echo Input "10" to change top keygeneration to 10 (FW 9.0.0-9.01)
echo Input "11" to change top keygeneration to 11 (FW 9.1.0-11.0.3)
echo Input "12" to change top keygeneration to 12 (FW 12.1.0)
echo Input "13" to change top keygeneration to 13 (>FW 13.0.0)
echo Input "13" to change top keygeneration to 13 (FW 13.0.0-13.2.1)
echo Input "14" to change top keygeneration to 14 (FW 14.0.0-14.1.2)
echo Input "15" to change top keygeneration to 15 (>FW 15.0.0)
echo.
echo Input "b" to return to AUTO-MODE - CONFIGURATION
echo Input "c" to return to CONFIG MENU
Expand Down Expand Up @@ -271,8 +273,12 @@ if /i "%bs%"=="11" set "v_KGEN=-kp 11"
if /i "%bs%"=="11" set "v_CAPRSV=--RSVcap 605028352"
if /i "%bs%"=="12" set "v_KGEN=-kp 12"
if /i "%bs%"=="12" set "v_CAPRSV=--RSVcap 806354944"
if /i "%bs%"=="13" set "vkey=-kp 13"
if /i "%bs%"=="13" set "capRSV=--RSVcap 872415232"
if /i "%bs%"=="13" set "v_KGEN=-kp 13"
if /i "%bs%"=="13" set "v_CAPRSV=--RSVcap 872415232"
if /i "%bs%"=="14" set "v_KGEN=-kp 14"
if /i "%bs%"=="14" set "v_CAPRSV=--RSVcap 939524096"
if /i "%bs%"=="15" set "v_KGEN=-kp 15"
if /i "%bs%"=="15" set "v_CAPRSV=--RSVcap 1006632960"

if /i "%bs%"=="b" goto sc2
if /i "%bs%"=="c" goto sc1
Expand Down
4 changes: 3 additions & 1 deletion py/ztools/_EEL_/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ def _process_message(message, ws):
error_info['errorText'] = repr(e)
error_info['errorTraceback'] = err_traceback
_repeated_send(ws, _safe_json({ 'return': message['call'],
'value': return_val }))
'status': status,
'value': return_val,
'error': error_info,}))
elif 'return' in message:
call_id = message['return']
if call_id in _call_return_callbacks:
Expand Down
2 changes: 2 additions & 0 deletions py/ztools/keys_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ master_key_09 =
master_key_0a =
master_key_0b =
master_key_0c =
master_key_0d =
master_key_0e =

header_key =

Expand Down
16 changes: 11 additions & 5 deletions py/ztools/lib/nutdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ def consolidate_versiondb():
tid=str(row[id]).upper()
v_=str(row[ver])
if v_=="" and tid.endswith('800'):
v_=65536
continue
# v_=65536
elif v_=="":
v_=0
if tid.endswith('800'):
Expand All @@ -600,7 +601,8 @@ def consolidate_versiondb():
tid=tid[:-3]+'000'
for j in (data[i]).keys():
if j=="" and i.endswith('800'):
j=65536
continue
# j=65536
elif j=="":
j=0
try:
Expand All @@ -623,13 +625,16 @@ def consolidate_versiondb():
try:
j=entry['version']
except:
j=65536
continue
# j=65536
else:
try:
j=entry['version']
except:
j=0
try:
if j is None:
continue
if not tid in ver_txt_dict:
ver_txt_dict[tid]=j
else:
Expand All @@ -649,7 +654,8 @@ def consolidate_versiondb():
try:
j=version
except:
j=65536
continue
# j=65536
else:
try:
j=version
Expand All @@ -674,7 +680,7 @@ def consolidate_versiondb():
if not updid in newdict:
newdict[i]='0'
newdict[updid]=v_
ver_txt_dict=newdict
ver_txt_dict=newdict
for i in data:
tid=i.upper()
if i.endswith('000'):
Expand Down
131 changes: 79 additions & 52 deletions py/ztools/lib/sq_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,66 @@
tabs = '\t' * indent
'''
versions =
0: "1.0.0", -> keygeneration = 0
450: "1.0.0", -> keygeneration = 0
65536: "2.0.0", -> keygeneration = 1
131072: "2.1.0", -> keygeneration = 1
196608: "2.2.0", -> keygeneration = 1
262144: "2.3.0", -> keygeneration = 1
201326592: "3.0.0", -> keygeneration = 2
201392128: "3.0.1", -> keygeneration = 3
201457664: "3.0.2", -> keygeneration = 3
268435456: "4.0.0", -> keygeneration = 4
268500992: "4.0.1", -> keygeneration = 4
269484032: "4.1.0", -> keygeneration = 4
335544320: "5.0.0", -> keygeneration = 5
335609856: "5.0.1", -> keygeneration = 5
335675392: "5.0.2", -> keygeneration = 5
336592896: "5.1.0", -> keygeneration = 5
402653184: "6.0.0", -> keygeneration = 6
402718720: "6.0.1", -> keygeneration = 6
403701760: "6.1.0", -> keygeneration = 6
404750336: "6.2.0" -> keygeneration = 7
469762048: "7.0.0" -> keygeneration = 8
469827584: "7.0.1" -> keygeneration = 8
536870912: "8.0.0" -> keygeneration = 8
536936448: "8.0.1" -> keygeneration = 8
537919488: "8.1.0" -> keygeneration = 9
603979776: "9.0.0" -> keygeneration = 10
604045312: "9.0.1" -> keygeneration = 10
605028352: "9.1.0" -> keygeneration = 11
606076928: "9.2.0" -> keygeneration = 11
671088640: "10.0.0" -> keygeneration = 11
671154176: "10.0.1" -> keygeneration = 11
671219712: "10.0.2" -> keygeneration = 11
671285248: "10.0.3" -> keygeneration = 11
671350784: "10.0.4" -> keygeneration = 11
672137216: "10.1.0" -> keygeneration = 11
672202752: "10.1.1" -> keygeneration = 11
673185792: "10.2.0" -> keygeneration = 11
738197504: "11.0.0" -> keygeneration = 11
738263040: "11.0.1" -> keygeneration = 11
805306368: "12.0.0" -> keygeneration = 11
805371904: "12.0.1" -> keygeneration = 11
805437440: "12.0.2" -> keygeneration = 11
805502976: "12.0.3" -> keygeneration = 11
806354944: "12.1.0" -> keygeneration = 12
872415232: "13.0.0" -> keygeneration = 13
873463808: "13.1.0" -> keygeneration = 13
0: "1.0.0", -> keygeneration = 0
450: "1.0.0", -> keygeneration = 0
65536: "2.0.0", -> keygeneration = 1
131072: "2.1.0", -> keygeneration = 1
196608: "2.2.0", -> keygeneration = 1
262144: "2.3.0", -> keygeneration = 1
201326592: "3.0.0", -> keygeneration = 2
201392128: "3.0.1", -> keygeneration = 3
201457664: "3.0.2", -> keygeneration = 3
268435456: "4.0.0", -> keygeneration = 4
268500992: "4.0.1", -> keygeneration = 4
269484032: "4.1.0", -> keygeneration = 4
335544320: "5.0.0", -> keygeneration = 5
335609856: "5.0.1", -> keygeneration = 5
335675392: "5.0.2", -> keygeneration = 5
336592896: "5.1.0", -> keygeneration = 5
402653184: "6.0.0", -> keygeneration = 6
402718720: "6.0.1", -> keygeneration = 6
403701760: "6.1.0", -> keygeneration = 6
404750336: "6.2.0" -> keygeneration = 7
469762048: "7.0.0" -> keygeneration = 8
469827584: "7.0.1" -> keygeneration = 8
536870912: "8.0.0" -> keygeneration = 8
536936448: "8.0.1" -> keygeneration = 8
537919488: "8.1.0" -> keygeneration = 9
603979776: "9.0.0" -> keygeneration = 10
604045312: "9.0.1" -> keygeneration = 10
605028352: "9.1.0" -> keygeneration = 11
606076928: "9.2.0" -> keygeneration = 11
671088640: "10.0.0" -> keygeneration = 11
671154176: "10.0.1" -> keygeneration = 11
671219712: "10.0.2" -> keygeneration = 11
671285248: "10.0.3" -> keygeneration = 11
671350784: "10.0.4" -> keygeneration = 11
672137216: "10.1.0" -> keygeneration = 11
672202752: "10.1.1" -> keygeneration = 11
673185792: "10.2.0" -> keygeneration = 11
738197504: "11.0.0" -> keygeneration = 11
738263040: "11.0.1" -> keygeneration = 11
805306368: "12.0.0" -> keygeneration = 11
805371904: "12.0.1" -> keygeneration = 11
805437440: "12.0.2" -> keygeneration = 11
805502976: "12.0.3" -> keygeneration = 11
806354944: "12.1.0" -> keygeneration = 12
872415232: "13.0.0" -> keygeneration = 13
873463808: "13.1.0" -> keygeneration = 13
874512404: "13.2.0" -> keygeneration = 13
874578000: "13.2.1" -> keygeneration = 13
939524096: "14.0.0" -> keygeneration = 14
940572672: "14.1.0" -> keygeneration = 14
940638208: "14.1.1" -> keygeneration = 14
940703744: "14.1.2" -> keygeneration = 14
1006632960: "15.0.0" -> keygeneration = 15
1006698496: "15.0.1" -> keygeneration = 15
'''
def kgstring():
kg=list()
kg13=[872415232,873463808];kg.append(kg13)
kg15=[1006632960,1006698496];kg.append(kg15)
kg14=[939524096,940572672,940638208,940703744];kg.append(kg14)
kg13=[872415232,873463808,874512404,874578000];kg.append(kg13)
kg12=[806354944];kg.append(kg12)
kg11=[605028352,606076928,671088640,671154176,671219712,671285248,671350784,672137216,672202752,673185792,738197504,738263040,805306368,805371904,805437440,805502976];kg.append(kg11)
kg10=[603979776,604045312];kg.append(kg10)
Expand Down Expand Up @@ -151,7 +161,11 @@ def getTopRSV(keygeneration, RSV):
if keygeneration == 12:
return 806354944
if keygeneration == 13:
return 872415232
return 872415232
if keygeneration == 14:
return 939524096
if keygeneration == 15:
return 1006632960
else:
return RSV

Expand Down Expand Up @@ -188,11 +202,20 @@ def getMinRSV(keygeneration, RSV):
RSV=9*67108864
return RSV
if keygeneration == 11:
RSV=9*67108864+2*1048576+0*65796+0*1
RSV=9*67108864+1*1048576+0*65796+0*1
return RSV
if keygeneration == 11:
if keygeneration == 12:
RSV=12*67108864+1*1048576+0*65796+0*1
return RSV
return RSV
if keygeneration == 13:
RSV=13*67108864+0*1048576+0*65796+0*1
return RSV
if keygeneration == 14:
RSV=14*67108864+0*1048576+0*65796+0*1
return RSV
if keygeneration == 15:
RSV=15*67108864+0*1048576+0*65796+0*1
return RSV
else:
return RSV

Expand Down Expand Up @@ -224,7 +247,11 @@ def getFWRangeKG(keygeneration):
if keygeneration == 12:
return "(12.1.0)"
if keygeneration == 13:
return "(>= 13.0.0)"
return "(13.0.0 - 13.2.1)"
if keygeneration == 14:
return "(14.0.0 - 14.1.2)"
if keygeneration == 15:
return "(>= 15.0.0)"
else:
return "UNKNOWN"

Expand Down
Loading

0 comments on commit 92844e1

Please sign in to comment.