ata4 / disunity

An experimental toolset for Unity asset and asset bundle files.
The Unlicense
2.7k stars 659 forks source link

Illegal Capacity when trying to extract meshes (v0.3.4) #148

Open Devilin-Pixy opened 9 years ago

Devilin-Pixy commented 9 years ago

When extracting Unity .assets files I get a java.lang.IllegalArgumentException as soon as it tries to extract meshes (ClassID: 43).

Error thrown:

[warning] AssetExtractor: Can't deserialize Object #141 (ClassID: 43, Class: Mes
h), caused by java.lang.IllegalArgumentException: Illegal Capacity: -1100211208
        at java.util.ArrayList.<init>(Unknown Source)
        at info.ata4.unity.serdes.Deserializer.readArray(Deserializer.java:238)
        at info.ata4.unity.serdes.Deserializer.readCollection(Deserializer.java:
250)
        at info.ata4.unity.serdes.Deserializer.readValue(Deserializer.java:126)
        at info.ata4.unity.serdes.Deserializer.readObject(Deserializer.java:95)
        at info.ata4.unity.serdes.Deserializer.deserialize(Deserializer.java:72)

        at info.ata4.unity.cli.extract.AssetExtractor.extract(AssetExtractor.jav
a:160)
        at info.ata4.unity.cli.cmd.ExtractCmd.processAsset(ExtractCmd.java:43)
        at info.ata4.unity.cli.cmd.AssetCommand.processAssetFile(AssetCommand.ja
va:100)
        at info.ata4.unity.cli.cmd.AssetCommand.processFile(AssetCommand.java:90
)
        at info.ata4.unity.cli.cmd.FileCommand.processPath(FileCommand.java:58)
        at info.ata4.unity.cli.cmd.FileCommand.run(FileCommand.java:76)
        at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:110)
        at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:123)

[warning] AssetExtractor: Can't deserialize Object #142 (ClassID: 43, Class: Mes
h), caused by java.lang.IllegalArgumentException: Illegal Capacity: -1177143296
        at java.util.ArrayList.<init>(Unknown Source)
        at info.ata4.unity.serdes.Deserializer.readArray(Deserializer.java:238)
        at info.ata4.unity.serdes.Deserializer.readCollection(Deserializer.java:
250)
        at info.ata4.unity.serdes.Deserializer.readValue(Deserializer.java:126)
        at info.ata4.unity.serdes.Deserializer.readObject(Deserializer.java:95)
        at info.ata4.unity.serdes.Deserializer.readValue(Deserializer.java:134)
        at info.ata4.unity.serdes.Deserializer.readObject(Deserializer.java:95)
        at info.ata4.unity.serdes.Deserializer.deserialize(Deserializer.java:72)

        at info.ata4.unity.cli.extract.AssetExtractor.extract(AssetExtractor.jav
a:160)
        at info.ata4.unity.cli.cmd.ExtractCmd.processAsset(ExtractCmd.java:43)
        at info.ata4.unity.cli.cmd.AssetCommand.processAssetFile(AssetCommand.ja
va:100)
        at info.ata4.unity.cli.cmd.AssetCommand.processFile(AssetCommand.java:90
)
        at info.ata4.unity.cli.cmd.FileCommand.processPath(FileCommand.java:58)
        at info.ata4.unity.cli.cmd.FileCommand.run(FileCommand.java:76)
        at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:110)
        at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:123)

[error] DisUnityCli: Fatal error, caused by java.lang.OutOfMemoryError: Java hea
p space
        at java.util.ArrayList.<init>(Unknown Source)
        at info.ata4.unity.serdes.Deserializer.readArray(Deserializer.java:238)
        at info.ata4.unity.serdes.Deserializer.readCollection(Deserializer.java:
250)
        at info.ata4.unity.serdes.Deserializer.readValue(Deserializer.java:126)
        at info.ata4.unity.serdes.Deserializer.readObject(Deserializer.java:95)
        at info.ata4.unity.serdes.Deserializer.readValue(Deserializer.java:134)
        at info.ata4.unity.serdes.Deserializer.readObject(Deserializer.java:95)
        at info.ata4.unity.serdes.Deserializer.deserialize(Deserializer.java:72)

        at info.ata4.unity.cli.extract.AssetExtractor.extract(AssetExtractor.jav
a:160)
        at info.ata4.unity.cli.cmd.ExtractCmd.processAsset(ExtractCmd.java:43)
        at info.ata4.unity.cli.cmd.AssetCommand.processAssetFile(AssetCommand.ja
va:100)
        at info.ata4.unity.cli.cmd.AssetCommand.processFile(AssetCommand.java:90
)
        at info.ata4.unity.cli.cmd.FileCommand.processPath(FileCommand.java:58)
        at info.ata4.unity.cli.cmd.FileCommand.run(FileCommand.java:76)
        at info.ata4.unity.cli.DisUnityCli.run(DisUnityCli.java:110)
        at info.ata4.unity.cli.DisUnityCli.main(DisUnityCli.java:123)

Might want to guard against negatives being passed to the ArrayList I guess. The OutOfMemory can most likely be fixed by giving Java more memory in the batch file.

Hope this can be fixed, because I am mainly using this nice tool to extract models in .obj format.

finscn commented 9 years ago

+1

DerPopo commented 9 years ago

The out of memory is actually caused by wrong type information. More memory won't solve the problem, only updating the type information can fix it.

exilaus commented 9 years ago

+1 same ussue :/ from split files