Closed EAxp3 closed 7 years ago
For Kirikiri .xp3 games with tpm files use crass with tpm1 or tpm2 prametr or xp3viewer.
(...I want to support as many games as possible though.)
Provided you have basic knowledge how machine code and disassemblers work, the easiest way to locate decryption routine is:
uncompress
(there are about 3 calls per each game)segm
chunk - it should look roughly like this (arc_unpacker's code), or even more to the letter, like this (open source kirikiri z's code). The call hierarchy I referred to is the Read()
← EnsureSegment()
← SetData()
← uncompress()
call chain.tTVPXP3ArchiveStream::Read
: TVPXP3ArchiveExtractionFilter ( (tTVPXP3ExtractionFilterInfo*) &info );
, so you just need to step into it while hooked.Some of Kirikiri games use basic decryption like famous Fate/Stay Night, that xors all the bytes with one number, and then xors 2 bytes at certain places. But most of the games I know of use CXDEC decryption which is a bit crazy:
cxdec.tpm
- despite its extension, yes, it's a DLL.)switch
statement cases, and two small integers used as seed/key in certain place.I suggest you to try to reverse a game that's already supported by arc_unpacker
to see how it works. It's easier this way cause you already know what to look for thanks to having sources available. A good start would be 「Fate/Stay Night」 to learn how to locate decryption routine and how this routine works, and 「Fate/Hollow Ataraxia」 to understand where to locate CXDEC parameters.
That is somewhat complicated. I'll try. thank you very much for your help. 🎃 debugger use? -->ollydbg ?
IDA, ideally with C decompiler. Trial should be good too, although C decompiler tremendously accelerates the work.
For those having a difficulty in first step:
In IDA string view, search for "V2Link." If you follow cross reference, you will find a subroutine corresponding to this
Follow TVPGetFunctionExporter() -> TVPInitExportFuncs() -> TVPExportFunctions() (source)
TVPExportFunctions calls the uncompress function.
❓ There is some form or manual to find the encryption key, especially for Kirikiri .xp3 based games. 🔍 what happens is that I have many games and would like to help find the keys.
I'm tired of game request, I also want to help. 🔨 I can not help with the code, and I don't understand C / C ++ only C #. 👍