Skip to content

Commit

Permalink
fixed ncchinfo.bin gen not happening sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
ihaveamac committed Jun 9, 2016
1 parent a446b96 commit 67cf587
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions 3dsconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
workdir = "work" # temporary folder to store files in

#################
version = "2.14"
version = "2.15"

helptext = """3dsconv.py ~ version %s
"convert" a Nintendo 3DS ROM to a CIA (CTR Importable Archive)
Expand Down Expand Up @@ -125,6 +125,7 @@ def docleanup(tid_dc):
# so I think I can get away with hard-coding some things
def ncchinfoadd(rom_ncchinfo):
if rom_ncchinfo not in ncchinfolist:
print_v("- adding %s to ncchinfo.bin" % rom_ncchinfo)
romf_ncchinfo = open(rom_ncchinfo, "rb")
romf_ncchinfo.seek(0x108)
tid_ncchinfo = romf_ncchinfo.read(8)
Expand Down Expand Up @@ -227,12 +228,16 @@ def bytes2int(string):
if cleanup:
docleanup(tid)
romf.close()
if genncchinfo:
ncchinfoadd(rom[0])
continue
if not decrypted:
if not os.path.isfile(xorpad):
print("! %s couldn't be found." % xorpad)
if not genncchinfo:
print(" use --gen-ncchinfo with this rom.")
else:
ncchinfoadd(rom[0])
romf.close()
continue

Expand Down Expand Up @@ -368,9 +373,6 @@ def bytes2int(string):
if cleanup:
docleanup(tid)

if genncchinfo and genncchall:
ncchinfoadd(rom[0])

processedroms += 1

if totalroms == 0:
Expand Down

0 comments on commit 67cf587

Please sign in to comment.