1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-26 12:12:02 +00:00

Two quick fixes.

* Fixed segmentation fault on NSP dumping, produced by a change I forgot to revert while testing some stuff.
* Fixed a bug that made file splitting not take place while manually dumping a file bigger than 4 GiB from the RomFS section of any title.
This commit is contained in:
Pablo Curiel 2019-08-17 06:33:50 -04:00
parent ed45a863fa
commit 0dbe126426
3 changed files with 14 additions and 8 deletions

View file

@ -62,6 +62,7 @@ Changelog
**v1.1.4:**
* Fixed building with latest libnx release.
* Optimized RomFS recursive file dump function to not rely on code recursion as much as before, avoiding stack memory exhaustion problems. Fixes crashes while dumping RomFS data from games with lots of file entries.
* Fixed a bug that made file splitting not take place while manually dumping a file bigger than 4 GiB from the RomFS section of any title.
* Reduced max part size for split files to `0xFFFF0000` bytes in all operations (except for XCI dumps when the "Create directory with archive bit set" option is disabled). Fixes file access problems if the parts are used inside a directory with the archive bit set.
* Removed the `removeDirectory()` function. `fsdevDeleteDirectoryRecursively()` is now used instead.
* If a HFS0/ExeFS/RomFS data dump operation is cancelled or fails, a message telling the user to wait until the output directory is fully deleted will now be displayed.

View file

@ -4472,12 +4472,6 @@ bool dumpFileFromRomFsSection(u32 titleIndex, u32 file_offset, bool usePatch, bo
strncat(dumpPath, (char*)entry->name, entry->nameLen);
removeIllegalCharacters(dumpPath + cur_len);
if (progressCtx.totalSize > FAT32_FILESIZE_LIMIT && doSplitting)
{
sprintf(tmp_idx, ".%02u", splitIndex);
strcat(dumpPath, tmp_idx);
}
progressCtx.totalSize = entry->dataSize;
convertSize(progressCtx.totalSize, progressCtx.totalSizeStr, sizeof(progressCtx.totalSizeStr) / sizeof(progressCtx.totalSizeStr[0]));
@ -4493,6 +4487,12 @@ bool dumpFileFromRomFsSection(u32 titleIndex, u32 file_offset, bool usePatch, bo
breaks++;
if (progressCtx.totalSize > FAT32_FILESIZE_LIMIT && doSplitting)
{
sprintf(tmp_idx, ".%02u", splitIndex);
strcat(dumpPath, tmp_idx);
}
// Check if the dump already exists
if (checkIfFileExists(dumpPath))
{
@ -4523,7 +4523,12 @@ bool dumpFileFromRomFsSection(u32 titleIndex, u32 file_offset, bool usePatch, bo
}
// Start dump process
snprintf(strbuf, sizeof(strbuf) / sizeof(strbuf[0]), "Copying \"romfs:%s/%.*s\"...", curRomFsPath, entry->nameLen, entry->name);
if (strlen(curRomFsPath) > 1)
{
snprintf(strbuf, sizeof(strbuf) / sizeof(strbuf[0]), "Copying \"romfs:%s/%.*s\"...", curRomFsPath, entry->nameLen, entry->name);
} else {
snprintf(strbuf, sizeof(strbuf) / sizeof(strbuf[0]), "Copying \"romfs:/%.*s\"...", entry->nameLen, entry->name);
}
uiDrawString(strbuf, 8, (breaks * (font_height + (font_height / 4))) + (font_height / 8), 255, 255, 255);
breaks += 2;

View file

@ -18,7 +18,7 @@
#define MiB (1024.0 * KiB)
#define GiB (1024.0 * MiB)
#define NAME_BUF_LEN 1024
#define NAME_BUF_LEN 4096
#define SOCK_BUFFERSIZE 65536