mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-07 15:01:24 +01:00
Merge pull request #1127 from bnnm/hca
Fix HCA key misdetection [Iris Mysteria (Android)]
This commit is contained in:
commit
935edc190b
@ -203,8 +203,11 @@ STREAMFILE* hca_get_streamfile(hca_codec_data* data) {
|
|||||||
* (ex. newer Tales of the Rays files clip a lot) */
|
* (ex. newer Tales of the Rays files clip a lot) */
|
||||||
#define HCA_KEY_MIN_TEST_FRAMES 3 //7
|
#define HCA_KEY_MIN_TEST_FRAMES 3 //7
|
||||||
#define HCA_KEY_MAX_TEST_FRAMES 7 //12
|
#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 */
|
/* 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
|
* 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)
|
#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.
|
/* 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) {
|
switch(score) {
|
||||||
case 1: score = 1; break;
|
case 1: score = 1; break;
|
||||||
case 0: score = 3*HCA_KEY_SCORE_SCALE; break; /* blanks after non-blacks aren't very trustable */
|
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;
|
total_score += score;
|
||||||
|
@ -952,9 +952,6 @@ static const hcakey_info hcakey_list[] = {
|
|||||||
// Priconne! Grand Masters (iOS/Android)
|
// Priconne! Grand Masters (iOS/Android)
|
||||||
{185705658241}, // 0000002B3CEB7781
|
{185705658241}, // 0000002B3CEB7781
|
||||||
|
|
||||||
// Iris Mysteria (Android)
|
|
||||||
{62049655719861786}, // 00DC71D5479E1E1A
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif/*_HCA_KEYS_H_*/
|
#endif/*_HCA_KEYS_H_*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user