Skip to content

Commit

Permalink
auto-detect secure game using auto-detected title ID
Browse files Browse the repository at this point in the history
  • Loading branch information
meladroit committed Oct 3, 2015
1 parent d7259a9 commit f5ba3d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions source/main.c
Expand Up @@ -553,6 +553,7 @@ int checkInjectDirectory(char* path, lsDir* dir)

int main()
{
amInit();
filesystemInit();
//if (!doesFileNotExist("/3ds/svdt/no_alpha_sort",&sdmcFsHandle,sdmcArchive))
if (file_exist("no_alpha_sort"))
Expand All @@ -562,6 +563,7 @@ int main()

u64 tid;
u64 tid2 = 0;
char productCodeBuffer[16] = {0};
int titleTitles_available;
char destPath[MAX_PATH_LENGTH];
char tempStr[16] = {0};
Expand Down Expand Up @@ -597,7 +599,12 @@ int main()
}
fclose (pFile);
*/
secureGameFromFilesystem();
AM_GetTitleProductCode(mediatype,tid2,productCodeBuffer);
strncpy(productCode,productCodeBuffer,9);
secureGameFromProductCode(productCode);
if (whichSecureGame == SECURE_UNKNOWN) {
secureGameFromFilesystem();
}
getSecureValue();
}

Expand Down Expand Up @@ -660,7 +667,6 @@ int main()

gfxInitDefault();
gfxSet3D(false);
amInit();

dirOverwriteAll = 0;

Expand Down Expand Up @@ -703,7 +709,7 @@ int main()
}
if (mediatype!=2)
{
printf("Secure game inferred from filesystem:\n ");
printf("Secure game inferred at startup:\n ");
printSecureGame();
if(secureValueSet)
{
Expand Down Expand Up @@ -745,7 +751,6 @@ int main()

u8 sdmcCurrent, sdmcPrevious;
sdmcCurrent = 1;
char productCodeBuffer[16] = {0};

if (mediatype!=2)
machine_state = SET_TARGET_TITLE;
Expand Down
Binary file modified svdt.3dsx
Binary file not shown.

0 comments on commit f5ba3d9

Please sign in to comment.