This repository has been archived on 2022-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Luma3DS-3GX/ninjhax/source/main.c

46 lines
759 B
C

#include <3ds.h>
#include <stdio.h>
#include "brahma.h"
#include "hid.h"
s32 main (void) {
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault();
fsInit();
sdmcInit();
hbInit();
qtmInit();
gfxSwapBuffers();
u32 payload_size = 0x10000;
void *payload = malloc(payload_size);
FILE *fp = fopen("/reiNand.dat", "r");
if (!fp) goto exit;
fseek(fp, 0x12000, SEEK_SET);
fread(payload, payload_size, 1, fp);
fclose(fp);
if (brahma_init()) {
load_arm9_payload_from_mem(payload, payload_size);
firm_reboot();
brahma_exit();
}
exit:
if (payload) free(payload);
hbExit();
sdmcExit();
fsExit();
gfxExit();
hidExit();
aptExit();
srvExit();
return 0;
}