Kaplas80 / GuJian3Manager

Tools for GuJian 3 files.
MIT License
27 stars 8 forks source link

Can't run Gujian3Tool.exe correctly #1

Closed PaulWolfgang closed 4 years ago

PaulWolfgang commented 4 years ago

when i trying to decrypting bgm_p1.xxx ,i get :

Gujian3Tool.exe decrypt bgm_p1.xxx arg_test

Gujian3Tool 1.0.0 Copyright (c) 2019 Kaplas

WARNING: Output file already exists. It will be overwritten. Continue? (y/N) y Decrypting...Unhandled exception. System.FormatException: Uninitialized converter. at GuJian3Library.Converter.GuJianFileDecrypter.Convert(BinaryFormat source) in Z:\VS_Repos\src\GuJian3Library\Converter\GuJianFileDecrypter.cs:line 59 at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Yarhl.FileFormat.ConvertFormat.With(IConverter converter, Object src) in Z:\VS_Repos\src\Yarhl\src\Yarhl\FileFormat\ConvertFormat.cs:line 161 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Yarhl.FileFormat.ConvertFormat.With[TConv,TParam](TParam param, Object src) in Z:\VS_Repos\src\Yarhl\src\Yarhl\FileFormat\ConvertFormat.cs:line 124 at Yarhl.FileSystem.Node.TransformWith[TConv,TParam](TParam param) in Z:\VS_Repos\src\Yarhl\src\Yarhl\FileSystem\Node.cs:line 222 at GuJian3Tool.Program.Decrypt(Decrypt opts) in Z:\VS_Repos\src\GuJian3Tool\Program.Decrypt.cs:line 40 at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at GuJian3Tool.Program.Main(String[] args) in Z:\VS_Repos\src\GuJian3Tool\Program.cs:line 18

please help me :)

Kaplas80 commented 4 years ago

Hello!

You need to use the full path in the input file, because the app also uses the directory to identify the file. Gujian3Tool.exe decrypt Z:\GAMES\Gujian3\data\extract\asset\sounds_console\bgm_p1.xxx bgm_p1.decrypted

I still haven't found how to get the encryption keys automatically, so I hardcoded the ones I found:

https://github.com/Kaplas80/GuJian3Manager/blob/78ddd3ead4e18847fa886470a168a59bca62f98a/src/Gujian3Library/Converter/GuJianFileDecrypter.cs#L19-L31

PaulWolfgang commented 4 years ago

thanks,it works.but the decrypted file isn't a standard FSB file. i don't know how to handle it . i unpacked data files using RPGviewer with history version of gujian3,do i need to doing it with this app?

Kaplas80 commented 4 years ago

I'm sorry, but I can't help you with that, I don't know anything about sound file formats.

PaulWolfgang commented 4 years ago

thanks anyway,and could you teach me the format of extract function?

Kaplas80 commented 4 years ago

I'm not sure if I understand your question... what do you exactly want to know?

To extract files, the app first decompresses the index file and gets the file names and the hash values. Then, it reads the compressed data files and extracts each one of the files referenced in the index file.

PaulWolfgang commented 4 years ago

how to write command line ?

Kaplas80 commented 4 years ago

The command line syntax is: Gujian3Tool.exe extract <path to 303.idx> <output folder>

Example: Gujian3Tool.exe extract Z:\GAMES\Gujian3\data\_index\303.idx C:\Gujian3_data

PaulWolfgang commented 4 years ago

after extract data and decrypt new .xxx file again,i got correct FSB file and wav music file form it. Thanks!

SaraKale commented 4 years ago

Excuse me, where can I get the Gujian3Tool.exe program? I didn't find...I can't use C#, can you tell me how to do it? Thank you very much!!

Kaplas80 commented 4 years ago

Hi!

I'm sorry, but the app isn't finished yet and, for this reason, there isn't a precompiled .exe.

If you still want to use it in the current state, you can build it from the source code using Visual Studio or the dotnet build command.

SaraKale commented 4 years ago

I see. Thank you very much! I'll try build.Expect compilation to complete.come on!