rm-NoobInCoding / UnrealReZen

UnrealReZen is a modding tool for packing utoc and ucas files (Unreal Engine Zen Loader archive files)
GNU General Public License v3.0
96 stars 9 forks source link

Unhandled exception errors when unpacking large files #29

Closed TeronMer closed 5 days ago

TeronMer commented 9 months ago

Receiving the following error when I try to unpack one particularly large .utoc/.ucas file (the .ucas is 52gb). It successfully unpacks the first 7.88gb though, then crashes.

************** Exception Text **************
System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.CopyTo(Array array, Int32 index)
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at UEcastocLib.UCasDataParser.UnpackFile(UTocData utoc, GameFileMetaData fdata, List`1 blockData, String outDir) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\UCas.cs:line 26
   at UEcastocLib.UCasDataParser.UnpackUcasFiles(UTocData utoc, String ucasPath, String outDir, String filter) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\UCas.cs:line 116
   at UnrealUnZen.MainTool.UnpackBTN_Click(Object sender, EventArgs e) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\MainTool.cs:line 70
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

And then with another .utoc/.ucas from the same game I'm not getting the above error at all and am instead receiving the following error, this time immediately when I attempt to load the package though.

************** Exception Text **************
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: byteCount
   at System.Text.ASCIIEncoding.GetString(Byte[] bytes, Int32 byteIndex, Int32 byteCount)
   at UEcastocLib.UTocDataExtensions.ParseDirectoryIndex(Byte[] directoryIndexData, Int32 numberOfChunks) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\UTocDataExtensions.cs:line 53
   at UEcastocLib.UTocDataParser.ParseUtocFile(String utocFile, Byte[] aesKey) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\UEcastocLib\UToc.cs:line 158
   at UnrealUnZen.MainTool.OpenTocBTN_Click(Object sender, EventArgs e) in C:\Users\PCMOD\source\repos\rm-NoobInCoding\UnrealUnZen\UnrealUnZen\MainTool.cs:line 50
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Loaded Assemblies section for both crashes is below:

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
UnrealUnZen
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Cameron/Downloads/UnrealUnZen-B04/UnrealUnZen.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9206.0 built by: NET481REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9200.0 built by: NET481REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9037.0 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------