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

44 lines
2 KiB
C
Raw Normal View History

2018-05-15 17:00:19 +01:00
#pragma once
#ifndef __DUMPER_H__
#define __DUMPER_H__
2018-05-15 17:00:19 +01:00
#include <switch.h>
2019-06-05 23:44:18 +01:00
#include "util.h"
2018-05-15 17:00:19 +01:00
2019-05-01 21:24:13 +01:00
#define DUMP_BUFFER_SIZE (u64)0x100000 // 1 MiB (1048576 bytes)
2019-04-21 17:27:33 +01:00
#define ISTORAGE_PARTITION_CNT 2
2019-05-01 21:24:13 +01:00
#define FAT32_FILESIZE_LIMIT (u64)0xFFFFFFFF // 4 GiB - 1 (4294967295 bytes)
#define SPLIT_FILE_XCI_PART_SIZE (u64)0xFFFF8000 // 4 GiB - 0x8000 (4294934528 bytes) (based on XCI-Cutter)
#define SPLIT_FILE_NSP_PART_SIZE (u64)0xFFFF0000 // 4 GiB - 0x10000 (4294901760 bytes) (based on splitNSP.py)
#define SPLIT_FILE_GENERIC_PART_SIZE SPLIT_FILE_XCI_PART_SIZE
2019-04-21 17:27:33 +01:00
#define CERT_OFFSET 0x7000
#define CERT_SIZE 0x200
2019-06-05 23:44:18 +01:00
#define SMOOTHING_FACTOR (double)0.05
2018-06-26 02:11:18 +01:00
2019-06-28 21:13:54 +01:00
typedef enum {
BATCH_SOURCE_ALL = 0,
BATCH_SOURCE_SDCARD,
BATCH_SOURCE_EMMC
} batchModeSourceStorage;
2019-06-09 02:36:21 +01:00
void workaroundPartitionZeroAccess();
bool dumpCartridgeImage(bool isFat32, bool setXciArchiveBit, bool dumpCert, bool trimDump, bool calcCrc);
2019-06-28 21:13:54 +01:00
bool dumpNintendoSubmissionPackage(nspDumpType selectedNspDumpType, u32 titleIndex, bool isFat32, bool calcCrc, bool removeConsoleData, bool tiklessDump, bool batch);
bool dumpNintendoSubmissionPackageBatch(bool dumpAppTitles, bool dumpPatchTitles, bool dumpAddOnTitles, bool isFat32, bool removeConsoleData, bool tiklessDump, bool skipDumpedTitles, batchModeSourceStorage batchModeSrc);
2019-06-09 02:36:21 +01:00
bool dumpRawHfs0Partition(u32 partition, bool doSplitting);
2019-06-28 21:13:54 +01:00
bool dumpHfs0PartitionData(u32 partition, bool doSplitting);
bool dumpFileFromHfs0Partition(u32 partition, u32 file, char *filename, bool doSplitting);
bool dumpExeFsSectionData(u32 titleIndex, bool usePatch, bool doSplitting);
bool dumpFileFromExeFsSection(u32 titleIndex, u32 fileIndex, bool usePatch, bool doSplitting);
bool dumpRomFsSectionData(u32 titleIndex, bool usePatch, bool doSplitting);
bool dumpFileFromRomFsSection(u32 titleIndex, u32 file_offset, bool usePatch, bool doSplitting);
bool dumpCurrentDirFromRomFsSection(u32 titleIndex, bool usePatch, bool doSplitting);
2019-06-09 02:36:21 +01:00
bool dumpGameCardCertificate();
#endif