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
Raw Normal View History

2015-08-05 12:31:17 +02:00
#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();
2015-08-05 14:27:35 +02:00
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);
2015-08-05 14:27:35 +02:00
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);
2015-08-05 12:31:17 +02:00
hbExit();
sdmcExit();
fsExit();
gfxExit();
hidExit();
aptExit();
srvExit();
2015-08-05 14:27:35 +02:00
return 0;
2015-08-05 12:31:17 +02:00
}