Has anyone else looked more at implementing region free? Seeing as how nop90 is hard at work on the spider entry-point and is much deeper than I am, I am trying to find something to fiddle with. Once I get my copy of Cubic, I can start again.
Code:
u32 pad_state = HidWaitForInput();
if (pad_state & BUTTON_B) DrawDebug(1,"Skipping...");
else {
u32 bytesWritten = 0;
u32 currentWritten = 0;
u32 result = 0;
u32 currentSize = 0;
void *dumpAddr = (void*)0x08000000;
u32 fullSize = 0x00100000;
u8 patch6[] = { 0x00, 0x7f, 0xff, 0xff }; //; Region Free: 0x7f ff ff ff
u32 *dest1 = 0x08058804; ///[R4,#0x18]; //; Region Lockout: 0x2018
memcpy(dest1, patch6, 4);
const u32 chunkSize = 0x10000;
EDIT: Can't take credit for the additions. They were added by
@leerz.
mehh, I've been trying to make it work, and not too sure if that is the right address,
0x08058804 is not the addr, it is a sigcheck offset for new 3ds,
https://github.com/capito27/Pasta-CFW/blob/master/CFW_loader/source/main.c#L132
I just copied the sample line cos I'm unsure how to get the proper offset 0x2018 converted;
offsets for the cfw sigchecks are somewhere around 0x08058804; and 0x2018 is far from it, so it seem to be unrelated.
reading 3dbrew, the HM checks for the regions of the titles; ygw and region3/4 bypasses this by booting directly the gamecard, hence it avoids the HM check.
you can see this by observing region4 and ygw automatically booting the gamecard, instead of going back to HM and making the out of region gamecard show in the HM.
I'm having problems making rxtools to load so I can test and see if the rf patch makes the gamecard visible from HM.
if that works; it's just a matter of understanding the right offset for the RF patch.
3dbrew says the offsets for rf and little endian; but I'm just guessing here since I don't know much about the inner workings.
Code:
Debug("Patching RF...");
//test offset1
u8 patch6[] = { 0x00, 0x7f, 0xff, 0xff }; //; Nintendo defines region free as 0x7f ff ff ff
u32 *dest9 = 0x20180000; ///[R4,#0x18] ; //patch region lockout (offset 0x2018), not sure if this is the right offset
memcpy(dest9, patch6, 4);
//test offset1
u32 *dest10 = 0x00001820; ///[R4,#0x18] ; //patch region lockout (offset 0x2018), not sure if this is the right offset
memcpy(dest10, patch6, 4);
I probably have the wrong offset so it doesn't work, again this is just my brief guesswork, buuuuut.. I probably don't know what I'm doing hehe.