ToaHartor / GI-cutscenes

A command line program playing with the cutscenes files (USM) from Genshin Impact.
GNU General Public License v3.0
671 stars 76 forks source link

Any tips on how to get a key for the latest version of StarRail? #149

Open mqnowa opened 7 months ago

gszshdzz commented 7 months ago

https://github.com/donmai-me/WannaCRI Maybe

mqnowa commented 7 months ago

https://github.com/donmai-me/WannaCRI Maybe

There is no hint in that repository to get the key. When you get the key, you can use that repository to decrypt.

gszshdzz commented 7 months ago

https://github.com/donmai-me/WannaCRI Maybe

There is no hint in that repository to get the key. When you get the key, you can use that repository to decrypt.

idk, maybe you can refer to #8

Cactism commented 7 months ago

https://github.com/donmai-me/WannaCRI Maybe

There is no hint in that repository to get the key. When you get the key, you can use that repository to decrypt.

You can try looking at this repository: https://github.com/BUnipendix/PyCriUsm

I'm too technically incompetent to understand how they're able to get the keys, but after building, it prints out a .json with the keys — I don't know if it's compatible with GI-cutscenes, but it's a start.

Folder created after building: image

The keys.json file: keys.json

(i literally spent hours trying to figure out how to get the cutscenes in a human readable format, but i haven't had really much luck with a bunch of errors and stuff ⚰️)

For example, after building and running the following script in the repository's folder (with the above screenshot as a reference, it would be Downloads\HSR - PyCriUsm-main):

import asyncio
from PyCriUsm.demux import extract_usm

videos, audios = asyncio.run(extract_usm(r"C:\HoYoverse\Collapse Launcher\APPDATA\SRGlb\Games\StarRail_Data\StreamingAssets\Video\Windows\CS_Chap03_Act230_m.usm", r"C:\Users\danie\Downloads\test", is_async=True))

I then used ffmpeg (.\ffmpeg -i "C:\Users\danie\Downloads\test\CS_Chap02_Act580_m.ivf" -i "C:\Users\danie\Downloads\test\CS_Chap02_Act580_m_0.adx" -c:v copy output.mp4) to merge the the video and audio tracks, but for some reason the Chinese dub didn't work :(

Terminal output after trying to merge video and Chinese audio: output.txt

The other dubs worked however; here's the English output: https://images-ext-1.discordapp.net/external/c1XzKBjLRC6-ngzQMkpFCcgjvf0HABDvuVdbHqEaiPE/https/files.catbox.moe/qq0b3c.mp4

I would love to see more development towards Honkai Star Rail's cutscenes!

Hitachi-Momoka commented 7 months ago

https://github.com/donmai-me/WannaCRI Maybe

There is no hint in that repository to get the key. When you get the key, you can use that repository to decrypt.

You can try looking at this repository: https://github.com/BUnipendix/PyCriUsm

I'm too technically incompetent to understand how they're able to get the keys, but after building, it prints out a .json with the keys — I don't know if it's compatible with GI-cutscenes, but it's a start.

Folder created after building: image

The keys.json file: keys.json

(i literally spent hours trying to figure out how to get the cutscenes in a human readable format, but i haven't had really much luck with a bunch of errors and stuff ⚰️)

For example, after building and running the following script in the repository's folder (with the above screenshot as a reference, it would be Downloads\HSR - PyCriUsm-main):

import asyncio
from PyCriUsm.demux import extract_usm

videos, audios = asyncio.run(extract_usm(r"C:\HoYoverse\Collapse Launcher\APPDATA\SRGlb\Games\StarRail_Data\StreamingAssets\Video\Windows\CS_Chap03_Act230_m.usm", r"C:\Users\danie\Downloads\test", is_async=True))

I then used ffmpeg (.\ffmpeg -i "C:\Users\danie\Downloads\test\CS_Chap02_Act580_m.ivf" -i "C:\Users\danie\Downloads\test\CS_Chap02_Act580_m_0.adx" -c:v copy output.mp4) to merge the the video and audio tracks, but for some reason the Chinese dub didn't work :(

Terminal output after trying to merge video and Chinese audio: output.txt

The other dubs worked however; here's the English output: https://images-ext-1.discordapp.net/external/c1XzKBjLRC6-ngzQMkpFCcgjvf0HABDvuVdbHqEaiPE/https/files.catbox.moe/qq0b3c.mp4

I would love to see more development towards Honkai Star Rail's cutscenes!

不会英文,所以直接中文了,可以去翻译一下。

试了一下,我知道这个key是怎么用了。 他的这个key是Demuxer.EncryptionKey方法返回的值,所以可以重写一下读取json文件的方法去读取这些key。 另外,USM.Demux方法也得修改一下,在171行的位置去添加一下 MaskAudio(ref data, size),path赋值的上面,然后再把对应方法的里面的unit类型修改成int就可以运行了。 解包出来的文件,视频文件(.ivf)是正常可以播放的,音频文件(.hca)可以用ffmpeg转换成常见的格式,自带音频转换报错不能转换,技术有限,没法改源码。

mqnowa commented 7 months ago

PyCriUSM allows you to create a Python library .pyd for decryption by placing a key previously obtained using Iridium-SR. Iridium-SR requires two more files to be prepared, the details of which are not mentioned anywhere. So I am looking for information on the packetIds.json and StarRail.proto to use.

mqnowa commented 7 months ago

PyCriUSM committed the key for 2.1 two days after the HSR update, but I need to solve the Iridium-SR question to get the key immediately after the update. In parallel, we are looking for solutions other than PyCriUSM/Iridium-SR.