|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | + |
| 5 | +namespace Patcher |
| 6 | +{ |
| 7 | + public static class Patches |
| 8 | + { |
| 9 | + private static readonly List<PatchInfo> WindowsPatches = new List<PatchInfo> |
| 10 | + { |
| 11 | + new PatchInfo |
| 12 | + { |
| 13 | + Version = "2018.2", |
| 14 | + LightPattern = new byte[] {0x75, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30}, |
| 15 | + DarkPattern = new byte[] {0x74, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30} |
| 16 | + }, |
| 17 | + new PatchInfo |
| 18 | + { |
| 19 | + Version = "2018.3", |
| 20 | + LightPattern = new byte[] {0x75, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30}, |
| 21 | + DarkPattern = new byte[] {0x74, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30} |
| 22 | + }, |
| 23 | + new PatchInfo |
| 24 | + { |
| 25 | + Version = "2018.4", |
| 26 | + LightPattern = new byte[] {0x75, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30}, |
| 27 | + DarkPattern = new byte[] {0x74, 0x08, 0x33, 0xC0, 0x48, 0x83, 0xC4, 0x30} |
| 28 | + }, |
| 29 | + new PatchInfo |
| 30 | + { |
| 31 | + Version = "2019.2", |
| 32 | + LightPattern = new byte[] {0x75, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49}, |
| 33 | + DarkPattern = new byte[] {0x74, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49} |
| 34 | + }, |
| 35 | + new PatchInfo |
| 36 | + { |
| 37 | + Version = "2019.3", |
| 38 | + LightPattern = new byte[] {0x75, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49}, |
| 39 | + DarkPattern = new byte[] {0x74, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49} |
| 40 | + }, |
| 41 | + new PatchInfo |
| 42 | + { |
| 43 | + Version = "2020.1", |
| 44 | + LightPattern = new byte[] {0x75, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49}, |
| 45 | + DarkPattern = new byte[] {0x74, 0x15, 0x33, 0xC0, 0xEB, 0x13, 0x90, 0x49} |
| 46 | + } |
| 47 | + }; |
| 48 | + |
| 49 | + private static readonly List<PatchInfo> MacPatches = new List<PatchInfo> |
| 50 | + { |
| 51 | + new PatchInfo |
| 52 | + { |
| 53 | + Version = "2018.4", |
| 54 | + DarkPattern = new byte[] {0x75, 0x03, 0x41, 0x8B, 0x06, 0x4C, 0x3B}, |
| 55 | + LightPattern = new byte[] {0x74, 0x03, 0x41, 0x8B, 0x06, 0x4C, 0x3B} |
| 56 | + }, |
| 57 | + new PatchInfo |
| 58 | + { |
| 59 | + Version = "2019.1.0f2", |
| 60 | + DarkPattern = new byte[] {0x75, 0x03, 0x41, 0x8b, 0x06, 0x48}, |
| 61 | + LightPattern = new byte[] {0x74, 0x03, 0x41, 0x8b, 0x06, 0x48} |
| 62 | + }, |
| 63 | + new PatchInfo |
| 64 | + { |
| 65 | + Version = "2019.3", |
| 66 | + DarkPattern = new byte[] {0x85, 0xD5, 0x00, 0x00, 0x00, 0x8B, 0x03}, |
| 67 | + LightPattern = new byte[] {0x84, 0xD5, 0x00, 0x00, 0x00, 0x8B, 0x03} |
| 68 | + }, |
| 69 | + new PatchInfo |
| 70 | + { |
| 71 | + Version = "2020.1", |
| 72 | + DarkPattern = new byte[] {0x75, 0x5E, 0x8B, 0x03, 0xEB}, |
| 73 | + LightPattern = new byte[] {0x74, 0x5E, 0x8B, 0x03, 0xEB} |
| 74 | + }, |
| 75 | + new PatchInfo |
| 76 | + { |
| 77 | + Version = "2020.2", |
| 78 | + DarkPattern = new byte[] {0x75, 0x5E, 0x8B, 0x03, 0xEB}, |
| 79 | + LightPattern = new byte[] {0x74, 0x5E, 0x8B, 0x03, 0xEB} |
| 80 | + } |
| 81 | + }; |
| 82 | + |
| 83 | + private static readonly List<PatchInfo> LinuxPatches = new List<PatchInfo> |
| 84 | + { |
| 85 | + new PatchInfo |
| 86 | + { |
| 87 | + Version = "2019.2.3f", |
| 88 | + DarkPattern = new byte[] {0x75, 0x02, 0x8b, 0x03, 0x48, 0x83}, |
| 89 | + LightPattern = new byte[] {0x74, 0x02, 0x8b, 0x03, 0x48, 0x83} |
| 90 | + } |
| 91 | + }; |
| 92 | + |
| 93 | + public static List<PatchInfo> GetPatches(OperatingSystem os) |
| 94 | + { |
| 95 | + var patches = os switch |
| 96 | + { |
| 97 | + OperatingSystem.Windows => WindowsPatches, |
| 98 | + OperatingSystem.MacOS => MacPatches, |
| 99 | + OperatingSystem.Linux => LinuxPatches, |
| 100 | + _ => throw new ArgumentOutOfRangeException(nameof(os)) |
| 101 | + }; |
| 102 | + |
| 103 | + return patches.OrderByDescending(info => info.Version).ToList(); |
| 104 | + } |
| 105 | + } |
| 106 | +} |
0 commit comments