Skip to content

Commit

Permalink
Merge pull request #96 from julesontheroad/Beta
Browse files Browse the repository at this point in the history
Update for release of 0.96d
  • Loading branch information
julesontheroad authored Dec 1, 2019
2 parents b8969a9 + 8fd2f38 commit 14f5f21
Show file tree
Hide file tree
Showing 15 changed files with 442 additions and 771 deletions.
6 changes: 4 additions & 2 deletions py/Linked_Account_Patchable_Games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ Mordheim Warband Skirmish [BASE][010071B009FB6000][v0][US].nsp - NO
Mordheim Warband Skirmish [UPD][010071B009FB6800][v131072][WORLD].nsp - NO
Nintendo Entertainment System - Nintendo Switch Online [BASE][0100D870045B6000][v0][US].nsp - NO
Nintendo Entertainment System - Nintendo Switch Online [UPD][0100D870045B6800][v720896][US].nsp - NO
Overwatch Legendary Edition [0100F8600E21E800][v65536].nsp - NO
Super Nintendo Entertainment System - Nintendo Switch Online [01008D300C50C000][v0].nsp - NO
The Lord of the Rings Adventure Card Game [BASE][010085A00C5E8000][v0][WORLD].nsp - NO
Trivial Pursuit LIVE - DEMO [DEMO][01005BA00BEE6000][v0][US].nsp - NO
Trivial Pursuit LIVE - DEMO [DEMO][UPD][01005BA00BEE6800][v65536][WORLD].nsp - NO
Use Your Words [BASE][01007C0003AEC000][v0][US].nsp - NO
Expand Down Expand Up @@ -149,8 +151,8 @@ Doragonkuesuto Ⅹ onrain be-ta han [DEMO][UPD][0100459000302800][v327680][JAP].
血咒之城:暗夜儀式 [UPD][010025A00DF2A800][v65536][].nsp - UNTESTED
血咒之城:暗夜儀式 [BASE][010025A00DF2A000][v0][HK].nsx - UNTESTED
Rally Rock 'N Racing [0100AFA00F048000][v0].nsx - UNTESTED
Overwatch Legendary Edition [0100F8600E21E800][v65536].nsp - UNTESTED

Dauntless [0100B9500D1B0800][v65536].nsp - UNTESTED
Nyan Cat Lost in Space [010049F00EC30000][v0].nsp

-------------------------------------------------------------------------------------
Thanks to my good friend "the tester"
28 changes: 16 additions & 12 deletions py/NSCB.bat
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%list.txt",mode=folder,ext=nsp xci nsz nsx xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%list.txt",mode=file,ext=nsp xci nsz nsx xcz ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%list.txt" mode=folder ext="nsp xci nsz nsx xcz" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%list.txt" mode=file ext="nsp xci nsz nsx xcz" ) 2>&1>NUL
goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -878,8 +878,8 @@ endlocal

if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" goto start_cleaning
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%list.txt",mode=folder,ext=nsp xci nsz nsx xcz ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%list.txt",mode=file,ext=nsp xci nsz nsx xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%list.txt" mode=folder ext="nsp xci nsz nsx xcz" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%list.txt" mode=file ext="nsp xci nsz nsx xcz" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down Expand Up @@ -1597,8 +1597,9 @@ endlocal
if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" set skip_list_split="true"
if /i "%eval%"=="1" goto multi_start_cleaning
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mlist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mlist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mlist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mlist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL

goto multi_checkagain
echo.
:multi_checkagain
Expand All @@ -1610,6 +1611,8 @@ echo.
echo Input "1" to start processing current list
echo Input "2" to add to saved lists and process them
echo Input "3" to save list for later
echo Input "4" to add another folder to list via selector
echo Input "5" to add another file to list via selector
REM echo Input "2" to set a custom logo from a nsp/nca
echo.
echo Input "e" to exit
Expand All @@ -1635,8 +1638,8 @@ if /i "%eval%"=="2" set "mlistfol=%list_folder%\m_multi"
if /i "%eval%"=="2" goto multi_start_cleaning
if /i "%eval%"=="3" set "mlistfol=%list_folder%\m_multi"
if /i "%eval%"=="3" goto multi_saved_for_later
if /i "%eval%"=="4" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mlist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="5" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mlist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="4" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mlist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="5" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mlist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL
REM if /i "%eval%"=="2" goto multi_set_clogo
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto multi_showlist
Expand Down Expand Up @@ -2341,8 +2344,8 @@ echo+ >"%uinput%"
endlocal

if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%splist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%splist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%splist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%splist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL

echo.
:sp_checkagain
Expand Down Expand Up @@ -2371,8 +2374,9 @@ endlocal

if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" goto sp_start_cleaning
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%splist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%splist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%splist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%splist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL

if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto sp_showlist
if /i "%eval%"=="r" goto sp_r_files
Expand Down
8 changes: 4 additions & 4 deletions py/ztools/ADV.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%advlist.txt",mode=folder,ext=nsp xci nsx nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%advlist.txt",mode=file,ext=nsp xci nsx nsz xcz ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%advlist.txt" mode=folder ext="nsp xci nsx nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%advlist.txt" mode=file ext="nsp xci nsx nsz xcz" ) 2>&1>NUL
goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -108,8 +108,8 @@ endlocal

if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" goto start
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%advlist.txt",mode=folder,ext=nsp xci nsx nsz xcz ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%advlist.txt",mode=file,ext=nsp xci nsx nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%advlist.txt" mode=folder ext="nsp xci nsx nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%advlist.txt" mode=file ext="nsp xci nsx nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down
8 changes: 4 additions & 4 deletions py/ztools/JOINER.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%joinlist.txt",mode=folder,ext=ns0 xc0 00 ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%joinlist.txt",mode=file,ext=ns0 xc0 00 ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%joinlist.txt" mode=folder ext="ns0 xc0 00" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%joinlist.txt" mode=file ext="ns0 xc0 00" ) 2>&1>NUL
goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -108,8 +108,8 @@ endlocal

if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" goto start
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%joinlist.txt",mode=folder,ext=ns0 xc0 00 ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%joinlist.txt",mode=file,ext=ns0 xc0 00 ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%joinlist.txt" mode=folder ext="ns0 xc0 00" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%joinlist.txt" mode=file ext="ns0 xc0 00" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down
9 changes: 5 additions & 4 deletions py/ztools/LEGACY.bat
Original file line number Diff line number Diff line change
Expand Up @@ -1575,8 +1575,9 @@ ECHO.
set /p eval=<"%uinput%"
set eval=%eval:"=%
if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%UPDlist.txt",mode=folder,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%UPDlist.txt",mode=file,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%UPDlist.txt" mode=folder ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%UPDlist.txt" mode=file ext="nsp xci" ) 2>&1>NUL

goto upd_checkagain

echo.
Expand Down Expand Up @@ -1609,8 +1610,8 @@ endlocal

if /i "%eval%"=="0" goto manual_Reentry
if /i "%eval%"=="1" goto upd_starts
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%UPDlist.txt",mode=folder,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%UPDlist.txt",mode=file,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%UPDlist.txt" mode=folder ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%UPDlist.txt" mode=file ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="4" goto upd_ADD_BASE
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto upd_showlist
Expand Down
8 changes: 4 additions & 4 deletions py/ztools/MNG.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mnglist.txt",mode=folder,ext=nsp nsx ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mnglist.txt",mode=file,ext=nsp nsx ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mnglist.txt" mode=folder ext="nsp nsx" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mnglist.txt" mode=file ext="nsp nsx" ) 2>&1>NUL
goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -108,8 +108,8 @@ endlocal

if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" goto start_cleaning
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mnglist.txt",mode=folder,ext=nsp nsx ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%mnglist.txt",mode=file,ext=nsp nsx ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mnglist.txt" mode=folder ext="nsp nsx" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%mnglist.txt" mode=file ext="nsp nsx" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down
8 changes: 4 additions & 4 deletions py/ztools/RST.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%rstlist.txt",mode=folder,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%rstlist.txt",mode=file,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%rstlist.txt" mode=folder ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%rstlist.txt" mode=file ext="nsp xci" ) 2>&1>NUL
goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -108,8 +108,8 @@ endlocal

if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" goto start_cleaning
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%rstlist.txt",mode=folder,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%rstlist.txt",mode=file,ext=nsp xci ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%rstlist.txt" mode=folder ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%rstlist.txt" mode=file ext="nsp xci" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down
14 changes: 9 additions & 5 deletions py/ztools/ZSTD.bat
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ setlocal enabledelayedexpansion
echo+ >"%uinput%"
endlocal
if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%zzlist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%zzlist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="1" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%zzlist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%zzlist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL

goto checkagain
echo.
:checkagain
Expand Down Expand Up @@ -110,8 +111,8 @@ endlocal

if /i "%eval%"=="0" exit /B
if /i "%eval%"=="1" goto start
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%zzlist.txt",mode=folder,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list "%prog_dir%zzlist.txt",mode=file,ext=nsp xci nsz xcz ) 2>&1>NUL
if /i "%eval%"=="2" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%zzlist.txt" mode=folder ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="3" ( %pycommand% "%nut%" -lib_call listmanager selector2list -xarg "%prog_dir%zzlist.txt" mode=file ext="nsp xci nsz xcz" ) 2>&1>NUL
if /i "%eval%"=="e" goto salida
if /i "%eval%"=="i" goto showlist
if /i "%eval%"=="r" goto r_files
Expand Down Expand Up @@ -403,8 +404,11 @@ echo *******************************
echo NSP\XCI PARARELL COMPRESSION
echo *******************************
CD /d "%prog_dir%"
echo Filter extensions from list
%pycommand% "%nut%" -lib_call listmanager filter_list "%prog_dir%zzlist.txt","ext=nsp xci","token=False",Print="False"

echo Arrange list by filesizes
%pycommand% "%nut%" -lib_call listmanager size_sorted_from_tfile -xarg "%prog_dir%zzlist.txt"
echo Start compression by batches of "%workers%"
%pycommand% "%nut%" %buffer% -o "%fold_output%" -tfile "%prog_dir%zzlist.txt" --compress "%level%" --threads "%workers%" --nodelta "%skdelta%" --fexport "%xci_export%" --pararell "true"

ECHO ---------------------------------------------------
Expand Down
98 changes: 98 additions & 0 deletions py/ztools/lib/DBmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def _bytes2int(b):
if not os.path.exists(DATABASE_folder):
os.makedirs(DATABASE_folder)

fwdb=os.path.join(DATABASE_folder,'fw.json')

class Exchange():
def add(titlerights,titlekey):
dbstr=str()
Expand All @@ -98,6 +100,102 @@ def deletefile():
try:os.remove(exchangefile)
except:pass

class FWDB():
def add(FW,filepath):
import sq_tools
dump={};newdict={};fwfiles=list()
if os.path.exists(fwdb):
with open(fwdb) as json_file:
data = json.load(json_file)
for i in data:
dict=data[i]
if len(dict.items())>0:
dump[i]=dict
else: return False
if not FW in dump.items():
if filepath.endswith('nsp'):
files_list=sq_tools.ret_nsp_offsets(filepath,32)
# print(files_list)
# print(len(files_list))
for i in range(len(files_list)):
f=files_list[i]
file=f[0]
# print(file)
fwfiles.append(file)
newdict['files']=fwfiles
dump[FW]=newdict
app_json = json.dumps(dump, indent=4)
with open(fwdb, 'w') as json_file:
json_file.write(app_json)
print('Added firmware {}'.format(FW))
else:
print('Firmware {} is already in json'.format(FW))

def add_specific():
dump={};files=list()
if os.path.exists(fwdb):
with open(fwdb) as json_file:
data = json.load(json_file)
for i in data:
dict=data[i]
if len(dict.items())>0:
dump[i]=dict
else: return False
else: return False
for i in dump:
entry=dump[i]
files=entry['files']
for j in dump:
if j==i:
pass
else:
entry2=dump[j]
files2=entry2['files']
aux=list()
for k in files:
if k not in files2:
aux.append(k)
files=aux
entry['specific']=files
dump[i]=entry
app_json = json.dumps(dump, indent=4)
with open(fwdb, 'w') as json_file:
json_file.write(app_json)
print('Updated firmware json')

def detect_xci_fw(filepath,doprint=True):
import sq_tools
FW=None;dump={}
xcifw=sq_tools.ret_xci_offsets_fw(filepath)
# print(xcifw)
fwfiles=list()
if len(xcifw)>0:
for i in xcifw:
entry=i
fwfiles.append(entry[0])
else:
if doprint==True:
print('- Firmware was deleted from file')
return 'Deleted'
# print(fwfiles)
if os.path.exists(fwdb):
with open(fwdb) as json_file:
data = json.load(json_file)
for i in data:
dict=data[i]
if len(dict.items())>0:
dump[i]=dict
else: return False
for i in fwfiles:
for j in dump:
entry=dump[j]
files=entry['specific']
if i in files:
FW=j
if doprint==True:
print('- Xci includes firmware: '+FW)
return FW

class Dict(dict):
START_FLAG = b'# FILE-DICT v1\n'

Expand Down
6 changes: 6 additions & 0 deletions py/ztools/lib/batchprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ def add_signed_footer(message=None,ifolder=None,tfile=None,ext='all',rewrite=Fal
except:pass
ext=ext.split(',')
if ifolder!=None:
try:
ifolder=eval(ifolder)
except:pass
files=listmanager.folder_to_list(ifolder,ext)
elif tfile!=None:
try:
tfile=eval(tfile)
except:pass
files=read_lines_to_list(tfile,all=True)
else:
return False
Expand Down
Loading

0 comments on commit 14f5f21

Please sign in to comment.