mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-13 22:16:45 +00:00
Add a workaround around the update partition dump error
This commit is contained in:
parent
71725059cd
commit
c7ef15aab1
3 changed files with 13 additions and 2 deletions
|
@ -5,6 +5,16 @@
|
||||||
#include "ccolor.h"
|
#include "ccolor.h"
|
||||||
#include "util.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) {
|
bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition) {
|
||||||
u32 handle;
|
u32 handle;
|
||||||
if (R_FAILED(fsDeviceOperatorGetGameCardHandle(fsOperator, &handle))) {
|
if (R_FAILED(fsDeviceOperatorGetGameCardHandle(fsOperator, &handle))) {
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
|
void workaroundPartitionZeroAccess(FsDeviceOperator* fsOperator);
|
||||||
bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition);
|
bool dumpPartitionRaw(FsDeviceOperator* fsOperator, u32 partition);
|
|
@ -21,6 +21,7 @@ void startOperation(const char* title) {
|
||||||
|
|
||||||
void dumpPartitionZero() {
|
void dumpPartitionZero() {
|
||||||
startOperation("Raw Dump Partition 0 (SysUpdate)");
|
startOperation("Raw Dump Partition 0 (SysUpdate)");
|
||||||
|
workaroundPartitionZeroAccess(&fsOperatorInstance);
|
||||||
dumpPartitionRaw(&fsOperatorInstance, 0);
|
dumpPartitionRaw(&fsOperatorInstance, 0);
|
||||||
menuWaitForAnyButton();
|
menuWaitForAnyButton();
|
||||||
}
|
}
|
||||||
|
@ -30,8 +31,7 @@ MenuItem mainMenu[] = {
|
||||||
{ .text = NULL }
|
{ .text = NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv) {
|
||||||
{
|
|
||||||
gfxInitDefault();
|
gfxInitDefault();
|
||||||
consoleInit(NULL);
|
consoleInit(NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue