mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-29 01:08:51 +00:00
added runtime patcher, added MemoryUtils, fixes
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user