1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-23 10:42:09 +00:00

Proper handling of extracted HFS dumps

This commit is contained in:
bilditup1 2023-11-26 19:17:20 -05:00
parent 4e6f91eaa5
commit a4c5bf483c

View file

@ -919,13 +919,14 @@ def usbHandleSendFileProperties(cmd_block: bytes) -> int | None:
match ext: match ext:
case "xci": g_logger.info("\tXCI transfer started!") case "xci": g_logger.info("\tXCI transfer started!")
case "bin": g_logger.info("\tGamecard extra data transfer started!") case "bin": g_logger.info("\tGamecard extra data transfer started!")
case "fs0": g_logger.info("\tHFS0 raw partition transfer started!")
case "nsp": g_logger.info("\tNSP transfer started!") case "nsp": g_logger.info("\tNSP transfer started!")
case "nca": g_logger.info("\tRaw NCA transfer started!") case "nca": g_logger.info("\tRaw NCA transfer started!")
case "tik": g_logger.info("\tTicket transfer started!") case "tik": g_logger.info("\tTicket transfer started!")
case _: g_logger.info("\tTransfer of unknown data type started!") # uh-oh? case _: g_logger.info("\tTransfer of unknown data type started!") # uh-oh?
utilsInitTransferVars(file_size) utilsInitTransferVars(file_size)
g_logger.info(f'\nFile:\t{filename}') g_logger.info(f'\nFile:\t{filename}')
g_logger.info(f'Size:\t{g_formattedFileSize:.2f}{g_formattedFileUnit}') g_logger.info(f'Size:\t{g_formattedFileSize:.2f} {g_formattedFileUnit}')
if(ext == "nsp"): if(ext == "nsp"):
g_logger.info(f'Contents:') g_logger.info(f'Contents:')
else: else:
@ -933,7 +934,10 @@ def usbHandleSendFileProperties(cmd_block: bytes) -> int | None:
fs = file_size / div fs = file_size / div
if g_extractedFsDumpMode: if g_extractedFsDumpMode:
path_array = filename.split("/") path_array = filename.split("/")
fn = '/'.join(path_array[7:]) match path_array[1]:
case 'NCA FS': fn = '/'.join(path_array[7:])
case 'HFS': fn = '/'.join(path_array[4:])
case _: fn = '/'.join(path_array[1:])
elif g_nspTransferMode: elif g_nspTransferMode:
fn = filename fn = filename
g_logger.info(f'\t{fn} ({fs:.2f} {unit})') g_logger.info(f'\t{fn} ({fs:.2f} {unit})')
@ -1213,9 +1217,17 @@ def usbHandleStartExtractedFsDump(cmd_block: bytes) -> int:
path_array = extracted_fs_root_path.split('/') path_array = extracted_fs_root_path.split('/')
if not g_logVerbose: if not g_logVerbose:
g_logger.info(f'\tExtracted FS dump started!') match path_array[1]:
g_logger.info(f'\nSrc:\t{path_array[4]}') case 'HFS':
g_logger.info(f'\t{path_array[5]}, FS section #{path_array[6]}') g_logger.info(f'\tExtracted FS dump from HFS (Gamecard) started!')
g_logger.info(f'\nSrc:\t'+'/'.join(path_array[3:]))
case 'NCA FS':
g_logger.info(f'\tExtracted FS dump from NCA FS (NSP) started!')
g_logger.info(f'\nSrc:\t{path_array[4]}')
g_logger.info(f'\t{path_array[5]}, FS section #{path_array[6]}')
case _:
g__logger.info(f'\tExtracted FS dump from novel source (???) started!')
g_logger.info:(f'\nRoot:\t{extracted_fs_root_path}')
g_logger.info(f'Size:\t{g_formattedFileSize:.2f} {g_formattedFileUnit}') g_logger.info(f'Size:\t{g_formattedFileSize:.2f} {g_formattedFileUnit}')
g_logger.info(f'Files:') g_logger.info(f'Files:')
else: else: