added runtime patcher, added MemoryUtils, fixes

This commit is contained in:
kitbyte
2025-03-24 14:51:58 +02:00
parent 123307aed7
commit d3ff13a528
33 changed files with 1294 additions and 287 deletions
+17 -1
View File
@@ -1,4 +1,6 @@
namespace WeModPatcher.Models
using System.Collections.Generic;
namespace WeModPatcher.Models
{
public enum EPatchType
@@ -7,4 +9,18 @@
DisableUpdates = 2,
DisableTelemetry = 4
}
public enum EPatchProcessMethod
{
None = 0,
Runtime = 1,
Static = 2
}
public sealed class PatchConfig
{
public HashSet<EPatchType> PatchTypes { get; set; }
public EPatchProcessMethod PatchMethod { get; set; }
public string Path { get; set; }
}
}
+25
View File
@@ -0,0 +1,25 @@
using WeModPatcher.Utils;
namespace WeModPatcher.Models
{
public sealed class Signature
{
public readonly byte[] OriginalBytes;
public readonly byte[] PatchBytes;
public readonly byte[] Sequence;
public readonly byte[] Mask;
public readonly int Offset;
public int Length => Sequence.Length;
public static implicit operator byte[](Signature signature) => signature.Sequence;
public Signature(string signature, int offset, byte[] patchBytes, byte[] originalBytes)
{
MemoryUtils.ParseSignature(signature, out Sequence, out Mask);
PatchBytes = patchBytes;
OriginalBytes = originalBytes;
Offset = offset;
}
}
}