Skip to content

Commit 110542b

Browse files
committed
Update 2.0.12.0
2 parents e16da17 + f5517ed commit 110542b

File tree

17 files changed

+1294
-382
lines changed

17 files changed

+1294
-382
lines changed

xivModdingFramework/Helpers/IOUtil.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
using System.Collections.Generic;
1718
using System.IO;
1819
using System.IO.Compression;
20+
using System.Linq;
21+
using System.Runtime.InteropServices;
1922
using System.Threading.Tasks;
2023
using xivModdingFramework.General.Enums;
2124
using xivModdingFramework.Items.Interfaces;
@@ -123,5 +126,19 @@ public static string MakeItemSavePath(IItem item, DirectoryInfo saveDirectory, X
123126

124127
return path;
125128
}
129+
130+
/// <summary>
131+
/// Replaces the bytes in a given byte array with the bytes from another array, starting at the given index of the original array.
132+
/// </summary>
133+
/// <param name="original"></param>
134+
/// <param name="toInject"></param>
135+
/// <param name="index"></param>
136+
public static void ReplaceBytesAt(List<byte> original, byte[] toInject, int index)
137+
{
138+
for(var i = 0; i < toInject.Length; i++)
139+
{
140+
original[index + i] = toInject[i];
141+
};
142+
}
126143
}
127144
}

0 commit comments

Comments
 (0)