Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on opening a .assets file #348

Open
Zirion01 opened this issue Jun 1, 2024 · 3 comments
Open

Crash on opening a .assets file #348

Zirion01 opened this issue Jun 1, 2024 · 3 comments
Labels
assetstools Bug exists in AssetsTools.NET, not here feature New feature or request

Comments

@Zirion01
Copy link

Zirion01 commented Jun 1, 2024

Describe the bug
UABEA crashes when opening a .assets file

To Reproduce
Steps to reproduce the behavior:

  1. Get a copy of HuniePop's Steam files (by buying it or getting a codex crack, whatever)
  2. Open HuniePop_Data/resources.assets
  3. See error

Expected behavior
The assets contained in the file display

Screenshots
image

Additional context
Here is the error I got from UABEA :

System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'. (Parameter 'chars')
   at System.Text.Encoding.ThrowCharsOverflow(DecoderNLS decoder, Boolean nothingDecoded)
   at System.Text.Encoding.GetCharsWithFallback(ReadOnlySpan`1 bytes, Int32 originalBytesLength, Span`1 chars, Int32 originalCharsLength, DecoderNLS decoder)
   at System.Text.UTF8Encoding.GetCharsWithFallback(ReadOnlySpan`1 bytes, Int32 originalBytesLength, Span`1 chars, Int32 originalCharsLength, DecoderNLS decoder)
   at System.Text.Encoding.GetCharsWithFallback(Byte* pOriginalBytes, Int32 originalByteCount, Char* pOriginalChars, Int32 originalCharCount, Int32 bytesConsumedSoFar, Int32 charsWrittenSoFar, DecoderNLS decoder)
   at System.Text.DecoderNLS.GetChars(Byte* bytes, Int32 byteCount, Char* chars, Int32 charCount, Boolean flush)
   at System.Text.Decoder.GetChars(ReadOnlySpan`1 bytes, Span`1 chars, Boolean flush)
   at System.IO.BinaryReader.Read()
   at System.IO.BinaryReader.ReadChar()
   at AssetsTools.NET.AssetsFileReader.ReadNullTerminated()
   at AssetsTools.NET.AssetsFileExternal.Read(AssetsFileReader reader)
   at AssetsTools.NET.AssetsFileMetadata.Read(AssetsFileReader reader, UInt32 version, Int64 dataOffset)
   at AssetsTools.NET.AssetsFileMetadata.Read(AssetsFileReader reader, AssetsFileHeader header)
   at AssetsTools.NET.AssetsFile.Read(AssetsFileReader reader)
   at AssetsTools.NET.Extra.AssetsFileInstance..ctor(Stream stream, String filePath)
   at AssetsTools.NET.Extra.AssetsManager.LoadAssetsFileCacheless(Stream stream, String path, Boolean loadDeps, BundleFileInstance bunInst)
   at AssetsTools.NET.Extra.AssetsManager.LoadAssetsFile(FileStream stream, Boolean loadDeps)
   at AssetsTools.NET.Extra.AssetsManager.LoadAssetsFile(String path, Boolean loadDeps)
   at UABEAvalonia.MainWindow.OpenFiles(String[] files) in D:\a\UABEA\UABEA\UABEAvalonia\Forms\MainWindow.axaml.cs:line 109
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>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
@Zirion01 Zirion01 added the bug Something isn't working label Jun 1, 2024
@nesrak1
Copy link
Owner

nesrak1 commented Jun 1, 2024

According to #345 asked a few days ago, huniepop is unity 4, but AssetsTools.NET only supports 5 and up. I've kept is this way because
A. I don't have any unity 4 games to test with
B. in order to work with unity 4, it will take some work on uabea's side to check between unity 4 and unity 5 to do things differently, making things a bit more complicated.
For now, this is an unsupported feature. Use UABE if you need something similar, which supports way back to unity 3.something.

@nesrak1 nesrak1 added feature New feature or request assetstools Bug exists in AssetsTools.NET, not here and removed bug Something isn't working labels Jun 1, 2024
@Zirion01
Copy link
Author

Zirion01 commented Jun 1, 2024

I could, indeed, open the assets file thanks to UABE.
I feel stupid not noticing this earlier.
I'd be glad the tool had a Unity 4 compatibility, because editing the text assets with UABE (on HuniePop) makes crashs happen...

@nesrak1
Copy link
Owner

nesrak1 commented Jun 10, 2024

I'm looking into making Unity 4 support a thing in the future, but no promises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assetstools Bug exists in AssetsTools.NET, not here feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants