3ds To Cia Converter
Dec 26, 2017 From CIA to Citra: 3DS games from the console to the PC. Regginator729 3DS 2017-10-20 2 Minutes. Our motivation is to get a way on installing software in the Nintendo 3DS using a CIA, and make sure that said software can work on Citra, a 3DS emulator. Our goal is to run 3DS games both in the 3DS and in the PC. Hey everyone im using an 03ds running 9.2, ive installed rxtools and created an emunand etc. With the FBI app and can install and play.cia files fine, however this isnt the case with.3ds (from what ive read) and have been looking at ways to convert.3ds to.cia but all tutorials i have read are either outdated, need gateway cards or are very vague.
Battle in the forgotten city china. I know this question must have been asked (and answered) a million of times, but.The more i read online the less i understand. I have some 3ds roms that i want to convert in cia to play online without worries. Now, i read that thx to a program called '3DS Simple CIA Converter' i should be able to do it, but i should create the.
3ds To Cia Converter Download
#!/usr/bin/env python2 |
import sys, os, binascii, math, subprocess, errno |
deftestcommand(cmd): |
try: |
proc = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait() |
returnTrue |
exceptOSErroras e: |
if e.errno !=2: |
raise |
returnFalse |
defruncommand(cmdargs): |
if verbose: |
print('$ '+''.join(cmdargs)) |
proc = subprocess.Popen(cmdargs, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
proc.wait() |
#print(proc.returncode) |
procoutput = proc.communicate()[0] |
if verbose: |
print(procoutput) |
if proc.returncode !=0: |
print('! '+cmdargs[0]+' had an error.') |
# prevent printing twice |
ifnot verbose: |
print('- full command: '+''.join(cmdargs)) |
print('- output:') |
print(procoutput) |
# used from http://stackoverflow.com/questions/10840533/most-pythonic-way-to-delete-a-file-which-may-not-exist |
defsilentremove(filename): |
try: |
os.remove(filename) |
exceptOSErroras e: # this would be 'except OSError, e:' before Python 2.6 |
if e.errno != errno.ENOENT: # errno.ENOENT = no such file or directory |
raise# re-raise exception if a different error occured |
defdocleanup(): |
silentremove('work/game-orig.cxi') |
silentremove('work/game-conv.cxi') |
silentremove('work/manual.cfa') |
silentremove('work/dlpchild.cfa') |
silentremove('work/ncchheader.bin') |
silentremove('work/exheader.bin') |
silentremove('work/exefs.bin') |
silentremove('work/romfs.bin') |
silentremove('work/logo.bcma.lz') |
silentremove('work/plain.bin') |
iflen(sys.argv) <2: |
print('usage: 3dsconv.py [--force] [--nocleanup] game.3ds [game.3ds ..]') |
print(' --force - run even if 3dstool/makerom aren't found') |
print(' --nocleanup - don't remove temporary files once finished (only applies to last rom used)') |
print(' --verbose - print more information') |
print('') |
print('- an ExHeader XORpad should exist in the working directory') |
print(' named '<TITLEID>.Main.exheader.xorpad'') |
print('- 3dstool and makerom should exist in your PATH') |
print('') |
print('- version 1.01') |
sys.exit(1) |
fail =False |
ifnot testcommand('3dstool') andnot'--force'in sys.argv: |
print('! 3dstool doesn't appear to be in your PATH.') |
print(' you can get it from here:') |
print(' https://github.com/dnasdw/3dstool') |
print('- if you want to force the script to run,') |
print(' add --force as one of the arguments.') |
fail =True |
ifnot testcommand('makerom') andnot'--force'in sys.argv: |
print('! makerom doesn't appear to be in your PATH.') |
print(' you can get it from here:') |
print(' https://github.com/profi200/Project_CTR') |
print('- if you want to force the script to run,') |
print(' add --force as one of the arguments.') |
fail =True |
if fail: |
sys.exit(1) |
try: |
os.makedirs('work') |
exceptOSError: |
ifnot os.path.isdir('work'): |
raise |
cleanup =not'--nocleanup'in sys.argv |
verbose ='--verbose'in sys.argv |
totalroms =0 |
processedroms =0 |
for rom in sys.argv[1:]: |
if rom '--force'or rom '--nocleanup'or rom '--verbose': |
continue |
totalroms +=1 |
ifnot os.path.isfile(rom): |
print('! '+rom+' doesn't exist.') |
continue |
romname = os.path.basename(os.path.splitext(rom)[0]) |
print('- processing: '+romname) |
romf =open(rom, 'rb') |
romf.seek(0x100) |
ncsdmagic = romf.read(4) |
romf.seek(0x190) |
tid = binascii.hexlify(romf.read(8)[::-1]) |
xorpad = tid.upper()+'.Main.exheader.xorpad' |
romf.close() |
if ncsdmagic !='NCSD': |
print('! '+rom+' is probably not a rom.') |
print(' NCSD magic not found.') |
continue |
ifnot os.path.isfile(xorpad): |
print('! '+xorpad+' couldn't be found.') |
print(' use ncchinfo_gen-exh.py with this rom.') |
continue |
docleanup() |
print('- extracting') |
runcommand(['3dstool', '-xvt012f', 'cci', 'work/game-orig.cxi', 'work/manual.cfa', 'work/dlpchild.cfa', rom]) |
runcommand(['3dstool', '-xvtf', 'cxi', 'work/game-orig.cxi', '--header', 'work/ncchheader.bin', '--exh', 'work/exheader.bin', '--exh-xor', xorpad, '--exefs', 'work/exefs.bin', '--romfs', 'work/romfs.bin', '--plain', 'work/plain.bin', '--logo', 'work/logo.bcma.lz']) |
print('- patching') |
exh =open('work/exheader.bin', 'r+b') |
exh.seek(0xD) |
x = exh.read(1) |
y =ord(x) |
z = y 2 |
if verbose: |
print(' offset 0xD of ExHeader:') |
print(' original: '+hex(y)) |
print(' shifted: '+hex(z)) |
exh.seek(0xD) |
exh.write(chr(z)) |
exh.seek(0x1C0) |
savesize = exh.read(4) |
# actually 8 bytes but the TMD only has 4 bytes |
#print(binascii.hexlify(savesize[::-1])) |
exh.close() |
print('- rebuilding') |
# CXI |
cmds1 = ['3dstool', '-cvtf', 'cxi', 'work/game-conv.cxi', '--header', 'work/ncchheader.bin', '--exh', 'work/exheader.bin', '--exh-xor', xorpad, '--exefs', 'work/exefs.bin', '--not-update-exefs-hash', '--romfs', 'work/romfs.bin', '--not-update-romfs-hash', '--plain', 'work/plain.bin'] |
if os.path.isfile('work/logo.bcma.lz'): |
cmds1.extend(['--logo', 'work/logo.bcma.lz']) |
runcommand(cmds1) |
# CIA |
cmds2 = ['makerom', '-f', 'cia', '-o', 'work/game-conv.cia', '-content', 'work/game-conv.cxi:0:0'] |
if os.path.isfile('work/manual.cfa'): |
cmds2.extend(['-content', 'work/manual.cfa:1:1']) |
if os.path.isfile('work/dlpchild.cfa'): |
cmds2.extend(['-content', 'work/dlpchild.cfa:2:2']) |
runcommand(cmds2) |
# makerom doesn't accept custom SaveDataSize for some reason |
# but make_cia makes a bad CIA that doesn't support the Manual or DLP child |
# Archive Header Size |
cia =open('work/game-conv.cia', 'r+b') |
cia.seek(0x0) |
cia_h_ahs = binascii.hexlify(cia.read(0x4)[::-1]) |
cia_h_ahs_align =int(math.ceil(int(cia_h_ahs, 16) /64.0) *64.0) |
# Certificate chain size |
cia.seek(0x8) |
cia_h_cetks = binascii.hexlify(cia.read(0x4)[::-1]) |
cia_h_cetks_align =int(math.ceil(int(cia_h_cetks, 16) /64.0) *64.0) |
# Ticket size |
cia.seek(0xC) |
cia_h_tiks = binascii.hexlify(cia.read(0x4)[::-1]) |
cia_h_tiks_align =int(math.ceil(int(cia_h_tiks, 16) /64.0) *64.0) |
tmdoffset = cia_h_ahs_align + cia_h_cetks_align + cia_h_tiks_align |
cia.seek(tmdoffset +0x140+0x5a) |
cia.write(savesize) |
cia.close() |
os.rename('work/game-conv.cia', romname+'.cia') |
if cleanup: |
docleanup() |
processedroms +=1 |
print('* done converting!') |
print('%i out of %i roms processed'% (processedroms, totalroms)) |
3ds To Cia Converter Mp3
I have many backups I want to convert to Cia. I don't have my console ATM and it will be some time before I do. What's the best way to do this on my PC. Is there an automation of sort so I can load all my backups at once, leave it go and all my files will be completed? Tried simple 3ds converter but it needs some files from my console. It also only does 1 by 1 manually without resuming to the next. I'd like an auto grab next game convert done, repeate. I got too many to do.