Skip to content

Commit

Permalink
add safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 27, 2024
1 parent 27560ad commit 292ed05
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/popcorn/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,14 @@ static int myIoRead(int fd, unsigned char *buf, int size)
if (offset == 0) break;

if (offset+0x400 == pos && size-0x20 >= config_size){
memcpy(buf+0x20, custom_config, config_size);
char magic[12];
sceIoLseek(fd, offset, PSP_SEEK_SET);
sceIoRead(fd, magic, sizeof(magic));
sceIoLseek(fd, pos+size, PSP_SEEK_SET);
if (strncmp(magic, "PSISOIMG", 8) == 0){
memcpy(buf+0x20, custom_config, config_size);
}
break;
}
}
}
Expand Down

0 comments on commit 292ed05

Please sign in to comment.