Up the maximum custom path size to 55 characters from 37
This commit is contained in:
parent
f244b95aad
commit
5fe7c7e7e1
@ -49,7 +49,7 @@ diff -uNr a/source/brahma.c b/source/brahma.c
|
|||||||
+ if (p) {
|
+ if (p) {
|
||||||
+ fseek(p , 0, SEEK_END);
|
+ fseek(p , 0, SEEK_END);
|
||||||
+ psize = ftell(p);
|
+ psize = ftell(p);
|
||||||
+ if (psize > 5 && psize < 40) {
|
+ if (psize > 5 && psize < 58) {
|
||||||
+ char path[psize + 1];
|
+ char path[psize + 1];
|
||||||
+
|
+
|
||||||
+ fseek(p, 0, SEEK_SET);
|
+ fseek(p, 0, SEEK_SET);
|
||||||
@ -58,7 +58,7 @@ diff -uNr a/source/brahma.c b/source/brahma.c
|
|||||||
+ if (bytes_read == psize) {
|
+ if (bytes_read == psize) {
|
||||||
+ if (path[psize - 1] == 0xA) psize--;
|
+ if (path[psize - 1] == 0xA) psize--;
|
||||||
+ if (path[psize - 1] == 0xD) psize--;
|
+ if (path[psize - 1] == 0xD) psize--;
|
||||||
+ if (psize > 5 && psize < 38 && path[0] == '/' && memcmp(&path[psize - 4], ".bin", 4)) {
|
+ if (psize > 5 && psize < 56 && path[0] == '/' && memcmp(&path[psize - 4], ".bin", 4)) {
|
||||||
+ path[psize] = 0;
|
+ path[psize] = 0;
|
||||||
+ f = fopen(path, "rb");
|
+ f = fopen(path, "rb");
|
||||||
+ use_default = false;
|
+ use_default = false;
|
||||||
|
@ -41,7 +41,7 @@ void main(void)
|
|||||||
{
|
{
|
||||||
u32 pathSize = f_size(&pathFile);
|
u32 pathSize = f_size(&pathFile);
|
||||||
|
|
||||||
if(pathSize > 5 && pathSize < 40)
|
if(pathSize > 5 && pathSize < 58)
|
||||||
{
|
{
|
||||||
char path[pathSize + 1];
|
char path[pathSize + 1];
|
||||||
unsigned int read;
|
unsigned int read;
|
||||||
@ -49,7 +49,7 @@ void main(void)
|
|||||||
if(path[pathSize - 1] == 0xA) pathSize--;
|
if(path[pathSize - 1] == 0xA) pathSize--;
|
||||||
if(path[pathSize - 1] == 0xD) pathSize--;
|
if(path[pathSize - 1] == 0xD) pathSize--;
|
||||||
|
|
||||||
if(pathSize > 5 && pathSize < 38 && path[0] == '/' && memcmp(&path[pathSize - 4], ".bin", 4) == 0)
|
if(pathSize > 5 && pathSize < 56 && path[0] == '/' && memcmp(&path[pathSize - 4], ".bin", 4) == 0)
|
||||||
{
|
{
|
||||||
path[pathSize] = 0;
|
path[pathSize] = 0;
|
||||||
foundPayload = f_open(&payload, path, FA_READ) == FR_OK;
|
foundPayload = f_open(&payload, path, FA_READ) == FR_OK;
|
||||||
|
@ -72,7 +72,7 @@ bytes_read: .word 0
|
|||||||
fopen: .ascii "OPEN"
|
fopen: .ascii "OPEN"
|
||||||
.pool
|
.pool
|
||||||
fname: .dcw "sdmc:/arm9loaderhax.bin"
|
fname: .dcw "sdmc:/arm9loaderhax.bin"
|
||||||
.word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
.word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
|
||||||
.align 4
|
.align 4
|
||||||
kernelcode_start:
|
kernelcode_start:
|
||||||
|
@ -97,14 +97,14 @@ void patchFirmlaunches(u8 *pos, u32 size, u32 process9MemAddr)
|
|||||||
|
|
||||||
u32 pathSize = getFileSize(pathPath);
|
u32 pathSize = getFileSize(pathPath);
|
||||||
|
|
||||||
if(pathSize > 5 && pathSize < 40)
|
if(pathSize > 5 && pathSize < 58)
|
||||||
{
|
{
|
||||||
u8 path[pathSize];
|
u8 path[pathSize];
|
||||||
fileRead(path, pathPath, 0);
|
fileRead(path, pathPath, 0);
|
||||||
if(path[pathSize - 1] == 0xA) pathSize--;
|
if(path[pathSize - 1] == 0xA) pathSize--;
|
||||||
if(path[pathSize - 1] == 0xD) pathSize--;
|
if(path[pathSize - 1] == 0xD) pathSize--;
|
||||||
|
|
||||||
if(pathSize > 5 && pathSize < 38 && path[0] == '/' && memcmp(&path[pathSize - 4], ".bin", 4) == 0)
|
if(pathSize > 5 && pathSize < 56 && path[0] == '/' && memcmp(&path[pathSize - 4], ".bin", 4) == 0)
|
||||||
{
|
{
|
||||||
u16 finalPath[pathSize + 1];
|
u16 finalPath[pathSize + 1];
|
||||||
for(u32 i = 0; i < pathSize; i++)
|
for(u32 i = 0; i < pathSize; i++)
|
||||||
|
Reference in New Issue
Block a user