mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-17 19:19:16 +01:00
Add .fish [Wonder Boy: The Dragon's Trap (PC)]
This commit is contained in:
parent
cc78560271
commit
3b61d09fc5
@ -189,6 +189,7 @@ static const char* extension_list[] = {
|
|||||||
"fda",
|
"fda",
|
||||||
"ffw",
|
"ffw",
|
||||||
"filp",
|
"filp",
|
||||||
|
"fish",
|
||||||
//"flac", //common
|
//"flac", //common
|
||||||
"flx",
|
"flx",
|
||||||
"fsb",
|
"fsb",
|
||||||
|
@ -302,6 +302,34 @@ static int _init_vgmstream_ogg_vorbis_tests(STREAMFILE* sf, ogg_vorbis_io_config
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* .fish: Wonder Boy: The Dragon's Trap (PC) */
|
||||||
|
if (read_u32be(0x00,sf) == 0x4E7C0F0E) {
|
||||||
|
|
||||||
|
/* init big-ish table on startup, based on original unrolled code (sub_7FF7670FD990) */
|
||||||
|
cfg->key_len = 0x400;
|
||||||
|
if (sizeof(cfg->key) < cfg->key_len)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
for (int i = 0; i < 0x400 / 4; i++) {
|
||||||
|
uint32_t key = i;
|
||||||
|
for (int round = 0; round < 8; round++) {
|
||||||
|
uint32_t tmp1 = (key >> 1);
|
||||||
|
uint32_t tmp2 = -(key & 1) & 0xEDB88324;
|
||||||
|
key = tmp1 ^ tmp2;
|
||||||
|
}
|
||||||
|
if (key == 0)
|
||||||
|
key = 0xEDB88324;
|
||||||
|
|
||||||
|
put_u32le(cfg->key + (i ^ 0x2A) * 4, key);
|
||||||
|
}
|
||||||
|
cfg->is_encrypted = 1;
|
||||||
|
|
||||||
|
if (!check_extensions(sf,"fish"))
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************/
|
/***************************************/
|
||||||
/* harder to check (could be improved) */
|
/* harder to check (could be improved) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user