-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWar3Version.cs
57 lines (52 loc) · 1.36 KB
/
War3Version.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Text;
namespace eflayMH_WPF
{
class War3Version
{
public static bool IsVs124e(ProcessC war3)
{
byte[] bt = new byte[4];
war3.ReadMemory(new IntPtr(war3.DllBaseAddress + 0x0fb76b), bt, 4);
byte[] bt2 = new byte[] { 0xe8, 0x30, 0x96, 0xff };
for (int i = 0; i < 4; i++)
{
if (bt[i] == bt2[i])
{ }
else
{ return false; }
}
return true;
}
public static bool IsVs120e(ProcessC war3)
{
byte[] bt = new byte[4];
war3.ReadMemory(new IntPtr(war3.DllBaseAddress + 0x0e35d8), bt, 4);
byte[] bt2 = new byte[] { 0xe8, 0xf3, 0x1F, 0xF8 };
for (int i = 0; i < 4; i++)
{
if (bt[i] == bt2[i])
{ }
else
{ return false; }
}
return true;
}
public static string GetWar3Version(ProcessC war3)
{
if (IsVs124e(war3))
{
return "1.24.4.6387";
}
if (IsVs120e(war3))
{
return "1.20.4.6074";
}
else
{
return "";
}
}
}
}