mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-21 20:59:52 +01:00
cleanup: hca subkeys
This commit is contained in:
parent
e525bd1456
commit
079370b2a1
@ -1,6 +1,7 @@
|
|||||||
#include "meta.h"
|
#include "meta.h"
|
||||||
#include "hca_keys.h"
|
#include "hca_keys.h"
|
||||||
#include "../coding/coding.h"
|
#include "../coding/coding.h"
|
||||||
|
#include <clHCA.h>
|
||||||
|
|
||||||
//#define HCA_BRUTEFORCE
|
//#define HCA_BRUTEFORCE
|
||||||
#ifdef HCA_BRUTEFORCE
|
#ifdef HCA_BRUTEFORCE
|
||||||
@ -15,7 +16,7 @@ VGMSTREAM* init_vgmstream_hca(STREAMFILE* sf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VGMSTREAM* init_vgmstream_hca_subkey(STREAMFILE* sf, uint16_t subkey) {
|
VGMSTREAM* init_vgmstream_hca_subkey(STREAMFILE* sf, uint16_t subkey) {
|
||||||
VGMSTREAM * vgmstream = NULL;
|
VGMSTREAM* vgmstream = NULL;
|
||||||
hca_codec_data* hca_data = NULL;
|
hca_codec_data* hca_data = NULL;
|
||||||
clHCA_stInfo* hca_info;
|
clHCA_stInfo* hca_info;
|
||||||
|
|
||||||
@ -158,20 +159,24 @@ static void find_hca_key(hca_codec_data* hca_data, uint64_t* p_keycode, uint16_t
|
|||||||
|
|
||||||
for (i = 0; i < keys_length; i++) {
|
for (i = 0; i < keys_length; i++) {
|
||||||
uint64_t key = hcakey_list[i].key;
|
uint64_t key = hcakey_list[i].key;
|
||||||
size_t subkeys_size = hcakey_list[i].subkeys_size;
|
|
||||||
const uint16_t *subkeys = hcakey_list[i].subkeys;
|
|
||||||
|
|
||||||
test_key(hca_data, key, subkey, &best_score, p_keycode);
|
test_key(hca_data, key, subkey, &best_score, p_keycode);
|
||||||
if (best_score == 1)
|
if (best_score == 1)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (subkeys_size > 0 && subkey == 0) {
|
#if 0
|
||||||
for (j = 0; j < subkeys_size; j++) {
|
{
|
||||||
test_key(hca_data, key, subkeys[j], &best_score, p_keycode);
|
size_t subkeys_size = hcakey_list[i].subkeys_size;
|
||||||
if (best_score == 1)
|
const uint16_t *subkeys = hcakey_list[i].subkeys;
|
||||||
goto done;
|
if (subkeys_size > 0 && subkey == 0) {
|
||||||
|
for (j = 0; j < subkeys_size; j++) {
|
||||||
|
test_key(hca_data, key, subkeys[j], &best_score, p_keycode);
|
||||||
|
if (best_score == 1)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -5,8 +5,10 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t key; /* hca key or seed ('user') key */
|
uint64_t key; /* hca key or seed ('user') key */
|
||||||
|
#if 0
|
||||||
const uint16_t* subkeys; /* scramble subkey table for seed key */
|
const uint16_t* subkeys; /* scramble subkey table for seed key */
|
||||||
size_t subkeys_size; /* size of the derivation subkey table */
|
size_t subkeys_size; /* size of the derivation subkey table */
|
||||||
|
#endif
|
||||||
} hcakey_info;
|
} hcakey_info;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user