Skip to content

Commit

Permalink
Merge pull request #6 from seiya-git/main
Browse files Browse the repository at this point in the history
proper fix for opening xci
  • Loading branch information
themoonisacheese authored Oct 21, 2023
2 parents 5a93c6b + dbfc14e commit e708dbe
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions verif.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
except:pass
import Config
import Status
from pathlib import Path

# # SET ENVIRONMENT
# squirrel_dir=os.path.abspath(os.curdir)
Expand All @@ -42,9 +43,12 @@ def verify(file):
tmpfolder =os.path.join(dir,'tmp')
feed=''
buffer = 65536
if filename.lower().endswith('.nsp') or filename.lower().endswith('.nsz'):
if filename.lower().endswith(('.nsp','.nsz')):
f = Fs.Nsp(filename)
elif filename.lower().endswith('.xcz') or filename.lower().endswith('.xci'):
elif filename.lower().endswith('.xci'):
f = Fs.factory(Path(filename))
f.open(filename, 'rb')
elif filename.lower().endswith('.xcz'):
f = Fs.Xci(filename)
else:
raise Exception("{1} does not have the appropriate extension".format(filename))
Expand All @@ -63,9 +67,9 @@ def verify(file):
f.close()
return False
print(filename)
if filename.endswith('.nsz') :
if filename.endswith('.nsz'):
verdict,feed=f.nsz_hasher(buffer,headerlist,verdict,feed)
elif filename.endswith('.xcz') :
elif filename.endswith('.xcz'):
verdict,feed=f.xcz_hasher(buffer,headerlist,verdict,feed)
else:
verdict,feed=f.verify_hash_nca(buffer,headerlist,verdict,feed)
Expand Down

0 comments on commit e708dbe

Please sign in to comment.