disunity icon indicating copy to clipboard operation
disunity copied to clipboard

How to unpack encrypted .unity3d?

Open asdqwe3124 opened this issue 8 years ago • 4 comments

Anyone know how to unpack encrypted .unity3d? There is a "ENCRYPT_HEADER" string when I open the file with hex editor.

this is the function from Assembly-CSharp.dll

public static byte[] RemoveEncryptHeader(MemoryStream ms)
{
	byte[] result = null;
	if (ms != null)
	{
		BinaryReader binaryReader = new BinaryReader(ms);
		byte b = binaryReader.ReadByte();
		if (b == 2)
		{
			string text = binaryReader.ReadString();
			if (text == "ENCRYPT_HEADER")
			{
				result = binaryReader.ReadBytes(Convert.ToInt32(ms.get_Length() - ms.get_Position()));
			}
		}
	}
	return result;
}

Thanks

asdqwe3124 avatar Mar 20 '17 10:03 asdqwe3124

How would you get the Assembly-CSharp.dll from the unity asset bundle (.unity3d) if it is encrypted?

Mactastic1-5 avatar Mar 20 '17 15:03 Mactastic1-5

Assembly-CSharp.dll is not in asset bundle. It's located on managed folder and the encrypted assets bundle is in resources folder.

asdqwe3124 avatar Mar 20 '17 15:03 asdqwe3124

You just contradicted yourself. You've already unpacked the Unity asset bundle (.unity3d) Libraries for Unity games and apps can not be outside the Unity asset bundle, it wouldn't work. You decompiled the library to get the code and you want to export the assets from the asset bundle (.assets, .asset, etc.) What you should have done is opened the asset bundle in a hex editor and showed what the header says. However, you probably won't be able to use DisUnity to do what you want to do, I suggest you use Unity Studio, the latest version, which you can see on my Starred repositories page.

Mactastic1-5 avatar Mar 20 '17 16:03 Mactastic1-5

There is lot of asset bundle files (.unity3d), some of them unencrypted so I can unpack it with Disunity or Unity Studio.

But, some .unity3d is encrypted, when I open it in a hex editor, I've found this: 00000000 02 0E 45 4E 43 52 59 50 54 5F 48 45 41 44 45 52 ENCRYPT_HEADER

asdqwe3124 avatar Mar 20 '17 16:03 asdqwe3124