nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.18k stars 152 forks source link

Crashes when opening a .assets file #368

Open mochineko-official opened 2 months ago

mochineko-official commented 2 months ago

Describe the bug Crashes when opening a .assets file

Screenshots ss

Additional context contents of uabeacrash.log are as below System.Runtime.InteropServices.COMException (0x80004005): 不支持此接口 ---> System.Runtime.InteropServices.COMException (0x80004002): GetItemAt failed at Avalonia.Win32.Win32Com.Impl.MicroComIShellItemArrayProxy.GetItemAt(Int32 dwIndex) at Avalonia.Win32.Win32StorageProvider.<>cDisplayClass13_0.b0() at Avalonia.Win32.Win32StorageProvider.<>cDisplayClass13_0.b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Avalonia.Win32.Win32StorageProvider.OpenFilePickerAsync(FilePickerOpenOptions options) at UABEAvalonia.MainWindow.MenuOpen_Click(Object sender, RoutedEventArgs e) in D:\a\UABEA\UABEA\UABEAvalonia\Forms\MainWindow.axaml.cs:line 193 at System.Threading.Tasks.Task.<>c.b__128_0(Object state) at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore() at Avalonia.Threading.DispatcherOperation.Execute() at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job) at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback) at Avalonia.Threading.Dispatcher.Signaled() at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg) at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken) at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode) at UABEAvalonia.Program.Main(String[] args) in D:\a\UABEA\UABEA\UABEAvalonia\Program.cs:line 53

nesrak1 commented 2 months ago

Does this always happen when opening a file or just sometimes? Does the file name have any weird characters?

mochineko-official commented 2 months ago

Thank you for the answer!! It’s always happening both on any .asessts or bundle. File names are like fn

It used to work, but problem happened after I tried fifth release, which was carshing down from the first time.After I deleted the old version, the new version mentioned that it can't find .NET. I reinstalled the .NET as the window described, but it started to crash too.

nesrak1 commented 2 months ago

Definitely an avalonia issue. I probably won't be able to reproduce this on my computer but I can take a look at what might cause that.

nesrak1 commented 2 months ago

If you only care about viewing, you should be able to get away with just dragging files onto the window you want to open.

nesrak1 commented 2 months ago

I can't see any problems with Avalonia's file picker code. Whenever a multi-file file picker returns, it calls IShellItemArray::GetCount to get how many files were selected, then IShellItemArray::GetItemAt on 0..n-1 to get each file. According to the microsoft docs, GetItemAt only returns an error if an array is accessed that isn't within 0..n-1, which should be impossible since the loop to read files never exceeds n. In other words, it should be impossible for you to get this error. Also, I searched around a bit and didn't find anyone else with this problem. This sounds like maybe a system configuration issue. Are other programs on this computer able to open multiple files at once? I don't think there's really anything I can do to fix this.

mochineko-official commented 2 months ago

Thank you for the answer, I guess I'll have to try other methods.