Add a 64-bit make_cia.exe and a Warning if you are using a 32-bit OS

This commit is contained in:
Timothy Redaelli 2016-04-22 08:22:05 +02:00
parent 49c73550d7
commit ccfc231a90
3 changed files with 15 additions and 8 deletions

View File

@ -41,6 +41,8 @@ import colorama
VERBOSE = len(sys.argv) > 1 and sys.argv[1] == '-v'
BITS = "64" if platform.machine().endswith("64") else "32"
# Taked from ncchinfo_gen_exh.py (https://github.com/d0k3/Decrypt9WIP)
mediaUnitSize = 0x200
@ -487,8 +489,6 @@ def which(cmd):
return None
def get_tools_path():
bits = "64" if platform.machine().endswith("64") else "32"
if getattr(sys, 'frozen', False):
# we are running in a bundle
bundle_dir = sys._MEIPASS
@ -497,9 +497,9 @@ def get_tools_path():
bundle_dir = os.path.dirname(os.path.abspath(__file__))
if sys.platform == "win32":
return os.path.join(bundle_dir, "tools", "win32")
return os.path.join(bundle_dir, "tools", "win" + BITS)
elif sys.platform == "linux" or sys.platform == "linux2":
return os.path.join(bundle_dir, "tools", "linux" + bits)
return os.path.join(bundle_dir, "tools", "linux" + BITS)
def main_check(filename, remove):
with open(filename, 'rb') as fh:
@ -530,6 +530,11 @@ if __name__ == "__main__":
if not os.path.isdir("cia"):
os.mkdir("cia")
if BITS == "32":
print colorama.Fore.YELLOW + "You are using a 32-bit OS."
print "You won't be able to convert some big roms."
print colorama.Style.RESET_ALL
roms = glob.glob(os.path.join("roms", "*.[3zZ][dDiI][sSpP]"))
tmpdir = tempfile.mkdtemp()
try:

View File

@ -7,9 +7,8 @@ def get_tools_path():
bits = "64" if platform.machine().endswith("64") else "32"
if sys.platform == "win32":
return os.path.join("tools", "win32")
elif sys.platform == "linux" or sys.platform == "linux2":
return os.path.join("tools", "linux" + bits)
return [( os.path.join("tools", "win32"), os.path.join("tools", "win32") ),
( os.path.join("tools", "win64"), os.path.join("tools", "win64") )]
print "Sorry, your OS is not supported yet."
sys.exit(1)
@ -17,7 +16,7 @@ def get_tools_path():
block_cipher = None
a = Analysis(['3ds-to-cia.py'],
binaries=[(get_tools_path(), get_tools_path())],
binaries=get_tools_path(),
datas=None,
hiddenimports=[],
hookspath=[],

View File

@ -20,6 +20,9 @@ in `distro` directory you will find the resulting binary.
Put the binary in a folder with `cia`, `roms` and `xorpads` empty directories, zip it and redistribuite.
## Known Bugs
Big roms cannot be converted (yet) on 32-bit operating systems or if you are using a 32-bit make_cia.
## Credits
* `mid-kid` for the informations about the procedure
* `3DSGuy` for make_cia