You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I'm on the latest alpha-build of AssetRipper.
Which release are you using?
Windows x64
Which game did this occur on?
No response
Which Unity version did this occur on?
2022.3.9f1
Is the game Mono or IL2Cpp?
Mono
Describe the issue.
I've been using AssetRipper as a library to read/write certain assets (mostly configuration) within a game, and I noticed that the resulting files came out corrupt/invalid.
Misalignment issues
To be specific: there are alignment issues within the SerializedFile class that misaligns data when writing. One place it fails is at GetNewObjectInfoArray:
Since AlignStream only aligns on 4 byte boundaries, even though object data should be aligned at 8 byte boundaries.
Lastly, the last misalignment happens right before writing the object data. After inspecting numerous SerializedFiles it appears that the first object must be aligned on a 16 byte boundary, making the following code not aligned properly:
AlignStream(writer);//Object data must always be aligned.
Missing ScriptTypes
When reading a SerializedFile, one of the types of data that is being read are the ScriptTypes. The reading is going through normally, however when writing a SerializedFile, this property is forgotten and not written to the resulting output, causing it to emit corrupt files.
When fixing this on my end it all seems to work fine, however they have only been tested on my specific Unity version, as that was the one I was using AssetRipper for.
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Thank you for submitting your first issue here. Please be sure you have uploaded your AssetRipper.log file. It is in the same folder as the exe file. :)
Are you on the latest version of AssetRipper?
Yes, I'm on the latest alpha-build of AssetRipper.
Which release are you using?
Windows x64
Which game did this occur on?
No response
Which Unity version did this occur on?
2022.3.9f1
Is the game Mono or IL2Cpp?
Mono
Describe the issue.
I've been using AssetRipper as a library to read/write certain assets (mostly configuration) within a game, and I noticed that the resulting files came out corrupt/invalid.
Misalignment issues
To be specific: there are alignment issues within the SerializedFile class that misaligns data when writing. One place it fails is at
GetNewObjectInfoArray
:AssetRipper/Source/AssetRipper.IO.Files/SerializedFiles/SerializedFile.cs
Lines 187 to 209 in 608e3ab
where the following code:
should actually be
since object data must be aligned on an 8 byte boundary.
Another thing that is now misaligned is the object data written by
WriteObjectData
:AssetRipper/Source/AssetRipper.IO.Files/SerializedFiles/SerializedFile.cs
Lines 174 to 185 in 608e3ab
Since
AlignStream
only aligns on 4 byte boundaries, even though object data should be aligned at 8 byte boundaries.Lastly, the last misalignment happens right before writing the object data. After inspecting numerous SerializedFiles it appears that the first object must be aligned on a 16 byte boundary, making the following code not aligned properly:
AssetRipper/Source/AssetRipper.IO.Files/SerializedFiles/SerializedFile.cs
Line 159 in 608e3ab
Missing ScriptTypes
When reading a SerializedFile, one of the types of data that is being read are the
ScriptTypes
. The reading is going through normally, however when writing a SerializedFile, this property is forgotten and not written to the resulting output, causing it to emit corrupt files.When fixing this on my end it all seems to work fine, however they have only been tested on my specific Unity version, as that was the one I was using AssetRipper for.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: