Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Failure to load Texture2D assets from Pokemon UNITE (Switch) (2019.4.4f1) #769

Closed
SciresM opened this issue Jun 25, 2021 · 12 comments
Closed
Labels

Comments

@SciresM
Copy link

SciresM commented Jun 25, 2021

Files are loaded successfully by DevX Unity Editor, supposedly.

I got Texture2Ds to load by adding an extra u32 read to the texture2d deserialization section (before image data size), but I don't think that's actually correct.

As it is, AssetStudio reads size=1 and reads out of bounds data as images.

image

Archive format is 2019.4.4f1.

@SciresM
Copy link
Author

SciresM commented Jun 25, 2021

I think there's also something parsing wrong with meshes, too.

@Perfare
Copy link
Owner

Perfare commented Jun 26, 2021

According to your description, the structure of Texture2D has been modified.
If the file is a bundle file, click the ‘asset classes’ tab in the program to view the structure and code comparison of Texture2D, and then modify the code.

@SciresM
Copy link
Author

SciresM commented Jun 26, 2021

I'm not sure that I understand. There is nothing in the asset classes pane.
image

@Perfare
Copy link
Owner

Perfare commented Jul 6, 2021

Obviously the developer deleted the structural information to prevent others from viewing it. The best thing to do in this case is to try to obtain structural information from the executable file.
Coincidentally, the file for this issue #740 is also from Pokemon UNITE, it’s just that it’s the Android version. Structure information is still retained in this bundle file. I modified the code to verify that the structure of AnimationClip is the same as the file provided by @ElChicoEevee. So you can also consider obtaining bundle files from other platforms that still retain structural information.

@Perfare
Copy link
Owner

Perfare commented Jul 6, 2021

@ElChicoEevee In the #740 file, only the AnimationClip structure is different from the original one. Because I don’t have the latest file, my guess is that the version of NSwitch is newer. In the new version, the developer modified the structure of Texture2D and Mesh. Perhaps you can find the structure information from the latest Android version.

@Perfare
Copy link
Owner

Perfare commented Jul 6, 2021

@ElChicoEevee The structure of these two files has not been modified.

@Perfare
Copy link
Owner

Perfare commented Jul 6, 2021

As long as the code of Mesh/Texture2D.cs is modified to the modified structure, it can be read normally.
According to the information provided by @SciresM, Texture2D only needs to add ReadInt32 before the image data size.
The structure of the mesh is too complicated, and it is difficult to guess the modifications made by the developer before there is no structural information.

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

No branches or pull requests

3 participants
@SciresM @Perfare and others