Merge pull request #1127 from bnnm/hca

Fix HCA key misdetection [Iris Mysteria (Android)]
This commit is contained in:
bnnm 2022-04-24 15:20:37 +02:00 committed by GitHub
commit 935edc190b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -203,8 +203,11 @@ STREAMFILE* hca_get_streamfile(hca_codec_data* data) {
* (ex. newer Tales of the Rays files clip a lot) */
#define HCA_KEY_MIN_TEST_FRAMES 3 //7
#define HCA_KEY_MAX_TEST_FRAMES 7 //12
/* score of 10~30 isn't uncommon in a single frame, too many frames over that is unlikely */
#define HCA_KEY_MAX_FRAME_SCORE 150
/* score of 10~30 isn't uncommon in a single frame, too many frames over that is unlikely
* In rare cases of badly mastered frames there are +580. [Iris Mysteria! (Android)]
* Lesser is preferable (faster skips) but high scores are less common in the current detection. */
//TODO: may need to improve detection by counting silent (0) vs valid samples, as bad keys give lots of 0s
#define HCA_KEY_MAX_FRAME_SCORE 600
#define HCA_KEY_MAX_TOTAL_SCORE (HCA_KEY_MAX_TEST_FRAMES * 50*HCA_KEY_SCORE_SCALE)
/* Test a number of frames if key decrypts correctly.
@ -267,7 +270,7 @@ static int test_hca_score(hca_codec_data* data, hca_keytest_t* hk) {
switch(score) {
case 1: score = 1; break;
case 0: score = 3*HCA_KEY_SCORE_SCALE; break; /* blanks after non-blacks aren't very trustable */
default: score = score*HCA_KEY_SCORE_SCALE;
default: score = score * HCA_KEY_SCORE_SCALE;
}
total_score += score;

View File

@ -952,9 +952,6 @@ static const hcakey_info hcakey_list[] = {
// Priconne! Grand Masters (iOS/Android)
{185705658241}, // 0000002B3CEB7781
// Iris Mysteria (Android)
{62049655719861786}, // 00DC71D5479E1E1A
};
#endif/*_HCA_KEYS_H_*/