-
Notifications
You must be signed in to change notification settings - Fork 0
/
Unit.cs
100 lines (85 loc) · 2.33 KB
/
Unit.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Decompiled with JetBrains decompiler
// Type: SimpleCamera.Unit
// Assembly: SimpleCamera, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
using ReplaySeeker;
namespace SimpleCamera
{
public class Unit
{
public int memoryPosition;
private IProcessMemory pMemory;
public float x
{
get
{
return this.pMemory.ReadFloat32(this.memoryPosition + 640);
}
}
public float y
{
get
{
return this.pMemory.ReadFloat32(this.memoryPosition + 644);
}
}
public float z
{
get
{
return this.pMemory.ReadFloat32(this.memoryPosition + 648);
}
}
public float face
{
get
{
return this.pMemory.ReadFloat32(this.memoryPosition + 652);
}
}
public Unit(int memoryPosition, IProcessMemory pMemory)
{
this.memoryPosition = memoryPosition;
this.pMemory = pMemory;
}
public static bool operator ==(Unit a, Unit b)
{
if ((object) a == null || (object) b == null)
return (object) a == (object) b;
return a.memoryPosition == b.memoryPosition;
}
public static bool operator !=(Unit a, Unit b)
{
if ((object) a == null || (object) b == null)
return (object) a != (object) b;
return a.memoryPosition != b.memoryPosition;
}
public int getAddress()
{
return this.memoryPosition;
}
public string getType()
{
int num = this.pMemory.ReadInt32(this.memoryPosition + 48);
return "" + (object) (char) (num >> 24 & (int) byte.MaxValue) + (object) (char) (num >> 16 & (int) byte.MaxValue) + (object) (char) (num >> 8 & (int) byte.MaxValue) + (object) (char) (num & (int) byte.MaxValue);
}
public bool isHero()
{
string str = this.getType().Substring(0, 1);
return str.ToUpperInvariant().Equals(str);
}
public override bool Equals(object o)
{
if ((object) (o as Unit) == null)
return false;
return ((Unit) o).memoryPosition == this.memoryPosition;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public override string ToString()
{
return this.getType() + " - " + this.getAddress().ToString("X");
}
}
}