nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.14k stars 145 forks source link

Crash when viewing info #139

Open dazedanon opened 2 years ago

dazedanon commented 2 years ago

When clicking on the info button for certain assets bundles results in the following crash.

Crash report:

Application: UABEAvalonia.exe
CoreCLR Version: 5.0.721.25508
.NET Version: 5.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'value')
   at System.IO.FileStream.set_Position(Int64 value)
   at AssetsTools.NET.AssetsFileReader.set_Position(Int64 value) in C:\Users\nesquack\Documents\GitReposLocal\AssetsTools.NET\AssetTools.NET\Standard\AssetsFileFormat\AssetsFileReader.cs:line 144
   at AssetsTools.NET.Extra.BundleHelper.LoadAssetDataFromBundle(AssetBundleFile bundle, Int32 index) in C:\Users\nesquack\Documents\GitReposLocal\AssetsTools.NET\AssetTools.NET\Extra\BundleHelper.cs:line 22
   at AssetsTools.NET.Extra.AssetsManager.LoadAssetsFileFromBundle(BundleFileInstance bunInst, Int32 index, Boolean loadDeps) in C:\Users\nesquack\Documents\GitReposLocal\AssetsTools.NET\AssetTools.NET\Extra\AssetsManager\AssetsManager.cs:line 178
   at AssetsTools.NET.Extra.AssetsManager.LoadAssetsFileFromBundle(BundleFileInstance bunInst, String name, Boolean loadDeps) in C:\Users\nesquack\Documents\GitReposLocal\AssetsTools.NET\AssetTools.NET\Extra\AssetsManager\AssetsManager.cs:line 198
   at AssetsTools.NET.Extra.AssetsFileInstance.GetDependency(AssetsManager am, Int32 depIdx) in C:\Users\nesquack\Documents\GitReposLocal\AssetsTools.NET\AssetTools.NET\Extra\AssetsManager\AssetsFileInstance.cs:line 67
   at UABEAvalonia.InfoWindow.RecurseGetAllAssets(AssetsFileInstance fromFile, Dictionary`2 conts, List`1 files, HashSet`1 fileNames) in C:\Users\nesquack\Documents\GitRepos\uabequickfixes\UABEA\UABEAvalonia\InfoWindow.axaml.cs:line 844
   at UABEAvalonia.InfoWindow.LoadAllAssetsWithDeps(List`1 files) in C:\Users\nesquack\Documents\GitRepos\uabequickfixes\UABEA\UABEAvalonia\InfoWindow.axaml.cs:line 823
   at UABEAvalonia.InfoWindow..ctor(AssetsManager assetsManager, List`1 assetsFiles, Boolean fromBundle) in C:\Users\nesquack\Documents\GitRepos\uabequickfixes\UABEA\UABEAvalonia\InfoWindow.axaml.cs:line 129
   at UABEAvalonia.MainWindow.BtnInfo_Click(Object sender, RoutedEventArgs e) in C:\Users\nesquack\Documents\GitRepos\uabequickfixes\UABEA\UABEAvalonia\MainWindow.axaml.cs:line 308
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 157
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 107
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 134
   at UABEAvalonia.Program.Main(String[] args) in C:\Users\nesquack\Documents\GitRepos\uabequickfixes\UABEA\UABEAvalonia\Program.cs:line 47
nesrak1 commented 2 years ago

Which files does this happen to? Are they all files that end with resS or resource?

dazedanon commented 2 years ago

No this is for .assets and it happens after a certain number. For example sharedassets1.assets works and opens fine. sharedassets5.assets however will crash.

nesrak1 commented 2 years ago

Can you export (instead of info) sharedassets5.assets to file and open it with a different tool like AssetStudio?

dazedanon commented 2 years ago

Yes there seems to be no issue when I do that.

dazedanon commented 2 years ago

Trying to export resource.assets results in the same crash.

nesrak1 commented 2 years ago

The library that does the actual bundle reading has an update that may fix this (well, I doubt it will but I hope). Give me a bit to update it.

dazedanon commented 2 years ago

This is also breaking the save to .unity3d since the program is unable to export resource.assets. Game ends up crashing. I had to workaround it by using assetstudio to export everything and modifying the .assets files individually.

nesrak1 commented 2 years ago

I forgot to say something earlier but the library has been updated so let me know if it works now.

Fealow commented 2 years ago

This still crashes for me when i try to inspect resources.assets.

nesrak1 commented 2 years ago

@Fealow What do you mean by "inspect resources.assets"? When you open resources.assets or when you open an asset in resources.assets? Are you on the latest nightly build?