KillzXGaming / Switch-Toolbox

A tool to edit many video game file formats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Receive an Error Anytime I Replace a Model

HAWTERDAWWG opened this issue · comments

Upon attempting to replace a model inside a .bfres file, I receive an index out of range error, listed below.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.BitConverter.ToUInt32(Byte[] value, Int32 startIndex)
at Syroot.NintenTools.Bfres.RenderState.Syroot.NintenTools.Bfres.Core.IResData.Load(ResFileLoader loader)
at Syroot.NintenTools.Bfres.Core.ResFileLoader.ReadResDataT
at Syroot.NintenTools.Bfres.Core.ResFileLoader.LoadT
at Syroot.NintenTools.Bfres.Material.Syroot.NintenTools.Bfres.Core.IResData.Load(ResFileLoader loader)
at Syroot.NintenTools.Bfres.Core.ResFileLoader.ImportSection(IResData vertexBuffer)
at Syroot.NintenTools.Bfres.Material.Import(String FileName, ResFile ResFile)
at Bfres.Structs.FMDL.AddOjects(String FileName, ResFile resFileNX, ResFile resFileU, Boolean Replace) in C:\projects\switch-toolbox\File_Format_Library\FileFormats\BFRES\Bfres Structs\SubFiles\FMDL.cs:line 972
at Bfres.Structs.FMDL.Replace(String FileName) in C:\projects\switch-toolbox\File_Format_Library\FileFormats\BFRES\Bfres Structs\SubFiles\FMDL.cs:line 607
at Toolbox.Library.NodeWrappers.STGenericWrapper.ReplaceAction(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** 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

Toolbox
Assembly Version: 1.0.2707.0
Win32 Version: 1.0.2707
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Toolbox.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.9032.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

Toolbox.Library
Assembly Version: 1.0.2707.0
Win32 Version: 1.0.2707
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Toolbox.Library.DLL

Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.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.9032.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

DirectXTexNetImpl
Assembly Version: 1.0.0.3
Win32 Version:
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/x64/DirectXTexNetImpl.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.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

OpenTK
Assembly Version: 3.0.1.0
Win32 Version: 3.0.1
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/OpenTK.dll

Octokit
Assembly Version: 0.31.0.0
Win32 Version: 0.31.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Octokit.DLL

SFGraphics
Assembly Version: 1.0.6956.42501
Win32 Version: 1.0.6956.42501
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/SFGraphics.dll

OpenTK.GLControl
Assembly Version: 3.0.1.0
Win32 Version: 3.0.1
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/OpenTK.GLControl.dll

System.Net.Http
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Net.Http/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll

FirstPlugin.Plg
Assembly Version: 1.0.2707.0
Win32 Version: 1.0.2707
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Plugins/FirstPlugin.Plg.dll

GL_EditorFramework
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/GL_EditorFramework.DLL

FlatBuffers
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Plugins/FlatBuffers.DLL

Syroot.NintenTools.NSW.Bfres
Assembly Version: 1.2.3.0
Win32 Version: 1.2.3.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Syroot.NintenTools.NSW.Bfres.dll

Syroot.Maths
Assembly Version: 1.5.3.0
Win32 Version: 1.5.3.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Syroot.Maths.DLL

Syroot.NintenTools.Bfres
Assembly Version: 1.2.3.0
Win32 Version: 1.2.3.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Syroot.NintenTools.Bfres.dll

Syroot.BinaryData
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Syroot.BinaryData.dll

WeifenLuo.WinFormsUI.Docking
Assembly Version: 3.0.6.0
Win32 Version: 3.0.6.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Plugins/WeifenLuo.WinFormsUI.Docking.DLL

Newtonsoft.Json
Assembly Version: 12.0.0.0
Win32 Version: 12.0.1.22727
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Newtonsoft.Json.dll

Syroot.NintenTools.NSW.Bntx
Assembly Version: 1.2.3.0
Win32 Version: 1.2.3.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Syroot.NintenTools.NSW.Bntx.dll

SPICA
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Plugins/SPICA.DLL

ZeldaLib
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/Plugins/ZeldaLib.DLL

System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll

Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

SARCExt
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/Lib/SARCExt.dll

DirectXTexNet
Assembly Version: 1.0.0.3
Win32 Version: 1.0.0.3
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/DirectXTexNet.DLL

AssimpNet
Assembly Version: 4.1.0.0
Win32 Version: 4.1.0
CodeBase: file:///C:/Program%20Files/Toolbox-Latest%20(1)/AssimpNet.DLL

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example: