READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Help to decompress game file

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
andrevictor18
ultra-n00b
Posts: 6
Joined: Sun Sep 11, 2016 7:38 am
Has thanked: 5 times

Help to decompress game file

Post by andrevictor18 » Mon Mar 13, 2017 7:56 am

the game is: 舞力全开:活力派 (download: adl.netease.com/d/g/justdance/c/gw_pcclient). In the pastes of installed game there is a paste called Setting, in older versions of the game this paste contained files .json that can be easily readed.

But in the current version, the paste Setting contains .z files that cannot be extracted or readed. I want to read the text in the setting files but it is kind compressed. So I decided to use dotPeek to decompile the Assembly-CSharp.dll (an dll from the game) and I discover that it uses sevenzip lzma comprfession, So I got some interesting codes that can be useful to decode these files.

Here is the Setting old and current files https://www.dropbox.com/sh/d64b1pjx3sp8 ... uHNxa?dl=0

and here it is the codes I decompiled https://www.dropbox.com/sh/frejsrezln9y ... -Hiaa?dl=0

If someone can help me I will be thankful
Last edited by andrevictor18 on Wed Mar 15, 2017 11:49 pm, edited 1 time in total.

User avatar
MaKiPL
advanced
Posts: 57
Joined: Sat Sep 13, 2014 2:05 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Help to decompress game file with sevenzip lzma compress

Post by MaKiPL » Mon Mar 13, 2017 8:40 pm

It's indeed 7Zip algorithm you IL-generated code posted:
http://www.7-zip.org/sdk.html
Download LZMA SDK for C# and you will get 1:1 code as is inside assembly-CSharp.dll
Neither of the official SDK tools for decompression works as this is not an archive. I'll try to test algorithms on raw data now.

EDIT: grr, I can't decode it, maybe there's something additional?
EDIT2: Yeah, the SettingsManager uses JDCStreamReader.messageParse()... (not LZMA)

Code: Select all

public string messageParse(byte[] message, int startIndex, int messageLength, out int totalLen, out bool readSuccess)
{
	totalLen = 0;
	readSuccess = false;
	int num = messageLength - startIndex;
	if (num < 5)
	{
		return string.Empty;
	}
	int num2 = BasicFunc.stringConvertToNumber(Encoding.UTF8.GetString(message, startIndex, 5), 36);
	int num3 = (num2 & 29360128) >> 22;
	int num4 = num2 & 4194303;
	totalLen = num4 + 5;
	if (num4 <= num - 5)
	{
		byte[] buffer = BufferPool<byte>.GetBuffer((long)num4);
		Array.Copy(message, startIndex + 5, buffer, 0, num4);
		string result = Singleton<JDCZlibWrapper>.GetInstance().doDeCompress(buffer, num4);
		BufferPool<byte>.Release(buffer, true);
		readSuccess = true;
		return result;
	}
	return string.Empty;
}
JDCZlib:

Code: Select all

[DllImport("JDCZlibForUnity")]
private static extern IntPtr JDCZlibDeCompress([MarshalAs(UnmanagedType.LPArray)] byte[] source, int length);
Ah, not the first time I see this... They are coding the file via streamer and/or password/key that is stored in unmanaged binary (Mobius: Final Fantasy uses external assembly to get AES key for example)
Let's see if there's something special about this Zlib stream

UPDATE:
Basically, the first 5 characters in .z file are used to get final size of decompressed file. File content is after these five characters.

Done!
I'm coding a tool for you
Last edited by MaKiPL on Mon Mar 13, 2017 10:37 pm, edited 1 time in total.

User avatar
MaKiPL
advanced
Posts: 57
Joined: Sat Sep 13, 2014 2:05 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Help to decompress game file with sevenzip lzma compress

Post by MaKiPL » Mon Mar 13, 2017 10:24 pm

Last edited by MaKiPL on Thu Mar 16, 2017 12:45 am, edited 1 time in total.

andrevictor18
ultra-n00b
Posts: 6
Joined: Sun Sep 11, 2016 7:38 am
Has thanked: 5 times

Re: Help to decompress game file with sevenzip lzma compress

Post by andrevictor18 » Tue Mar 14, 2017 11:32 pm

Thank you very much for your effort! But can you send a example of a decompressed file? No, better can you show me some tutorial How to use the decompressor?

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Help to decompress game file with sevenzip lzma compress

Post by merlinsvk » Wed Mar 15, 2017 6:29 am

Just download the binary and run it. MaKi made really simple but useful graphical interface there.

User avatar
MaKiPL
advanced
Posts: 57
Joined: Sat Sep 13, 2014 2:05 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Help to decompress game file with sevenzip lzma compress

Post by MaKiPL » Thu Mar 16, 2017 12:08 am

andrevictor18 wrote:Thank you very much for your effort! But can you send a example of a decompressed file? No, better can you show me some tutorial How to use the decompressor?
andrevictor18 wrote:do I need visual studio?
No, you don't need it. :)
Just get on this link: https://github.com/MaKiPL/JAP_JustDance ... tag/1.0.0b
download 'debug.7z' from there, unpack the archive and run "JAP_JustDance_JDCZlib_Decompressor.exe". You should see a window like on this image:

Image

If you are getting error about ".NET Framework" then please download Microsoft .NET Framework 4.5 (you can get it from official Microsoft site: https://www.microsoft.com/pl-pl/downloa ... x?id=30653)

Right in software you have labels for "input file" and "output file". In input file please click on "Browse..." button on it's right and file browser will appear allowing you to choose a .z file (e.g. currency.z) that is compressed. Next step is choosing the output file, do the same, use "Browse..." button (the second one) and type the filename of the decompressed file (e.g. currency.Unpacked). If you did the both, then the last step is clicking on "DECOMPRESS" button. If everything worked well a "DONE!" message box should appear.

:wv:

andrevictor18
ultra-n00b
Posts: 6
Joined: Sun Sep 11, 2016 7:38 am
Has thanked: 5 times

Re: Help to decompress game file

Post by andrevictor18 » Thu Mar 16, 2017 12:17 am

THank you very much! You are amazing

User avatar
MaKiPL
advanced
Posts: 57
Joined: Sat Sep 13, 2014 2:05 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Help to decompress game file

Post by MaKiPL » Sun Apr 16, 2017 1:14 pm

I'm so sorry I couldn't done it faster. Here:
https://github.com/MaKiPL/JAP_JustDance ... es/tag/1.1

The compression support :)

jmticon
ultra-n00b
Posts: 1
Joined: Sat Apr 27, 2019 8:12 pm

Re: Help to decompress game file

Post by jmticon » Sat Apr 27, 2019 8:19 pm

Hi. Does anyone know how to decompress common and secondscreen files in game Just Dance Vitality School? These files you can find in \舞力全开:活力派\PCMonitor64_Data\StreamingAssets\preinstall\songdata\dance and select any dancesong folder.

User avatar
MaKiPL
advanced
Posts: 57
Joined: Sat Sep 13, 2014 2:05 pm
Has thanked: 7 times
Been thanked: 19 times

Re: Help to decompress game file

Post by MaKiPL » Tue Sep 10, 2019 6:42 pm

The files you mentioned are casual "unityFS" with lz4 compression- I was able to open them without problem with UnityPack. Here's content of xmas/common:

Code: Select all

0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset '{\r\
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Sprite
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 Sprite
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Texture2D
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 AssetBundle
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Sprite
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset '[\r\
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Texture2D
0x7ac4042a8b5c8ff3 TextAsset '{\r\
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Texture2D
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset '{\r\
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 Sprite
0x7ac4042a8b5c8ff3 TextAsset b'\x0
0x7ac4042a8b5c8ff3 TextAsset b"\x0
0x7ac4042a8b5c8ff3 Texture2D
just find any Unity package viewer/ unity extractor

Post Reply