Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

How to unpack encrypted .unity3d? #220

Open
asdqwe3124 opened this issue Mar 20, 2017 · 4 comments
Open

How to unpack encrypted .unity3d? #220

asdqwe3124 opened this issue Mar 20, 2017 · 4 comments

Comments

@asdqwe3124
Copy link

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

@Mactastic1-5
Copy link

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

@asdqwe3124
Copy link
Author

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

@Mactastic1-5
Copy link

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.

@asdqwe3124
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants