diff --git a/source/dumper.c b/source/dumper.c index d6cc319..79d9aa3 100644 --- a/source/dumper.c +++ b/source/dumper.c @@ -5,6 +5,16 @@ #include "ccolor.h" #include "util.h" +void workaroundPartitionZeroAccess(FsDeviceOperator* fsOperator) { + u32 handle; + if (R_FAILED(fsDeviceOperatorGetGameCardHandle(fsOperator, &handle))) + return; + FsStorage gameCardStorage; + if (R_FAILED(fsOpenGameCard(&gameCardStorage, handle, 0))) + return; + fsStorageClose(&gameCardStorage); +} + bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition) { u32 handle; if (R_FAILED(fsDeviceOperatorGetGameCardHandle(fsOperator, &handle))) { diff --git a/source/dumper.h b/source/dumper.h index 5fa7ff5..8ac39d1 100644 --- a/source/dumper.h +++ b/source/dumper.h @@ -2,4 +2,5 @@ #include +void workaroundPartitionZeroAccess(FsDeviceOperator* fsOperator); bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition); \ No newline at end of file diff --git a/source/main.c b/source/main.c index 8f5e8c2..40896bb 100644 --- a/source/main.c +++ b/source/main.c @@ -21,6 +21,7 @@ void startOperation(const char* title) { void dumpPartitionZero() { startOperation("Raw Dump Partition 0 (SysUpdate)"); + workaroundPartitionZeroAccess(&fsOperatorInstance); dumpPartitionRaw(&fsOperatorInstance, 0); menuWaitForAnyButton(); } @@ -30,8 +31,7 @@ MenuItem mainMenu[] = { { .text = NULL } }; -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { gfxInitDefault(); consoleInit(NULL);