Skip to content

Deserialization of ExposedReference<Tile> leads to EndOfFileException #123

@Albeoris

Description

@Albeoris

During GetBaseField for this file:

result = AssetFileInfo
 ByteOffset = {long} 7687736
 ByteSize = {uint} 172
 IsReplacerPreviewable = {bool} false
 OldTypeId = {ushort} 0
 PathId = {long} 673
 Replacer = {IContentReplacer} null
 ReplacerType = {ContentReplacerType} None
 ScriptTypeIndex = {ushort} 0
 Stripped = {byte} 0
 TypeId = {int} 114
 TypeIdOrIndex = {int} 16

In the asset, I get EndOfFileException with such stack trace:

ThrowHelper.ThrowEndOfFileException()
Stream.ReadAtLeastCore()
BinaryReader.InternalRead()
BinaryReader.ReadInt64()
AssetsFileReader.ReadInt64()
AssetTypeTemplateField.ReadType() [7]
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.ReadType()
AssetTypeTemplateField.MakeValue()
AssetTypeTemplateField.MakeValue()
AssetsManager.GetBaseField()

The problem seems to have occurred when deserializing the "endTile" field because of strange PathId:

result = {List<AssetTypeValueField>} Count = 9
 [0] = {AssetTypeValueField} {Children: Count = 2  FieldName: "m_GameObject"  Value: null}
 [1] = {AssetTypeValueField} {Children: Count = 0  FieldName: "m_Enabled"  Value: {AsString: "1"}}
 [2] = {AssetTypeValueField} {Children: Count = 2  FieldName: "m_Script"  Value: null}
 [3] = {AssetTypeValueField} {Children: Count = 0  FieldName: "m_Name"  Value: {AsString: "Unit Movement Marker"}}
 [4] = {AssetTypeValueField} {Children: Count = 0  FieldName: "m_Time"  Value: {AsString: "33,6"}}
 [5] = {AssetTypeValueField} {Children: Count = 0  FieldName: "chosenPathType"  Value: {AsString: "1"}}
 [6] = {AssetTypeValueField} {Children: Count = 0  FieldName: "referenceType"  Value: {AsString: "0"}}
 [7] = {AssetTypeValueField} {Children: Count = 0  FieldName: "stopTimelineTillComplete"  Value: {AsString: "0"}}
 [8] = {AssetTypeValueField} {Children: Count = 1  FieldName: "endTile"  Value: null}
   [0] = {AssetTypeValueField} {Children: Count = 2  FieldName: "defaultValue"  Value: null}
     [0] = {AssetTypeValueField} {Children: Count = 0  FieldName: "m_FileID"  Value: {AsString: "10"}}
     [1] = {AssetTypeValueField} {Children: Count = 0  FieldName: "m_PathID"  Value: {AsString: "3834309553080054577"}}

And after that it led to an attempt to deserialize an array of the wrong size:

valueField = {AssetTypeValueField} {Children: Count = 3384  FieldName: "Array"  Value: null}
  Children = {List<AssetTypeValueField>} Count = 3384
  FieldName = {string} "Array"
capacity = {int} 13365
index = {int} 3384

This fields:

	[Token(Token = "0x4001D69")]
	[FieldOffset(Offset = "0x38")]
	[SerializeField]
	private ExposedReference<Tile> endTile;

	[Token(Token = "0x4001D6A")]
	[FieldOffset(Offset = "0x48")]
	[SerializeField]
	private ExposedReferenceHolder<Tile>[] tiles;

What can I do to help fix this problem?

Is there a way to disable the deserialization of certain types, as a workaround for problems like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions