1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-10 04:31:44 +00:00

Add a workaround around the update partition dump error

This commit is contained in:
MCMrARM 2018-05-16 17:10:30 +02:00
parent 71725059cd
commit c7ef15aab1
3 changed files with 13 additions and 2 deletions

View file

@ -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))) {

View file

@ -2,4 +2,5 @@
#include <switch.h>
void workaroundPartitionZeroAccess(FsDeviceOperator* fsOperator);
bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition);

View file

@ -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);