v3.1.2: Absturz bei der Admin-Prüfung (ACTA_LoadConsoleAccount/AcquireAccountTokenEx mit NULL-Passwort) behoben

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nico Meister
2026-10-26 21:05:54 +01:00
co-authored by Claude Opus 5.5
parent 44c9b7e60c
commit 36f6e5e027
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -28,13 +28,16 @@ static Result read_token(u8 slot, AccountAccessToken *at)
return ACT_GetAccountInfo(at, sizeof(*at), slot, INFO_TYPE_ACCOUNT_ACCESS_TOKEN);
}
// Leeres Passwort-Feld: libctru kopiert das Passwort immer - NULL ließ die App abstürzen (Luma-Dump, far=0)
static AccountPassword noPassword;
// Konto bei act einloggen (wie Spiele vor dem Online-Gehen): mit dem gespeicherten Passwort, Ergebnis per Ereignis
static Result login(u8 slot)
{
Handle done;
Result rc = svcCreateEvent(&done, RESET_ONESHOT);
if (R_FAILED(rc)) return rc;
rc = ACTA_AcquireAccountTokenEx(slot, NULL, true, done); // true = gespeichertes Passwort benutzen
rc = ACTA_AcquireAccountTokenEx(slot, &noPassword, true, done); // true = gespeichertes Passwort benutzen
if (R_SUCCEEDED(rc)) rc = svcWaitSynchronization(done, 15ULL * 1000 * 1000 * 1000);
if (rc == 0) rc = ACT_GetLastResponseResult();
svcCloseHandle(done);
@@ -54,7 +57,7 @@ static void check_once(void)
Result r1 = read_token(slot, &at), r2 = 0, r3 = 0, r4 = 0;
if (R_FAILED(r1) || !at.refreshToken[0]) {
snprintf(why, sizeof(why), "Werkzeuge: Schritt 2/4 - Konto laden ...\n(Lesen: %08lX)", (unsigned long)r1);
r2 = ACTA_LoadConsoleAccount(slot, false, NULL, false, false);
r2 = ACTA_LoadConsoleAccount(slot, false, &noPassword, false, false);
snprintf(why, sizeof(why), "Werkzeuge: Schritt 3/4 - Konto einloggen ...\n(Lesen %08lX, Laden %08lX)", (unsigned long)r1, (unsigned long)r2);
r3 = login(slot);
r4 = read_token(slot, &at);