├── .gitattributes
├── .gitignore
├── App.config
├── CSGO
├── CSGOClassID.cs
└── Enums
│ ├── LifeState.cs
│ ├── SignOnState.cs
│ ├── SpectatorView.cs
│ └── Team.cs
├── CSGOClasses
├── BaseEntity.cs
├── CSLocalPlayer.cs
├── CSPlayer.cs
├── Entity.cs
├── Fields
│ ├── BonesField.cs
│ └── Field.cs
├── Framework.cs
└── Weapon.cs
├── CSGOConfigUtils.cs
├── CSGOOffsets.cs
├── CSGOSample.csproj
├── CSGOSample.sln
├── CSGOScanner.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
└── Resources.resx
├── README.md
├── Resources
└── uc-exclusive.png
├── SignOnState.cs
├── UI
├── PlayerESP.cs
└── PlayerRadar.cs
└── WithOverlay.cs
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 |
9 | # Build results
10 |
11 | [Dd]ebug/
12 | [Rr]elease/
13 | x64/
14 | build/
15 | [Bb]in/
16 | [Oo]bj/
17 |
18 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
19 | !packages/*/build/
20 |
21 | # MSTest test Results
22 | [Tt]est[Rr]esult*/
23 | [Bb]uild[Ll]og.*
24 |
25 | *_i.c
26 | *_p.c
27 | *.ilk
28 | *.meta
29 | *.obj
30 | *.pch
31 | *.pdb
32 | *.pgc
33 | *.pgd
34 | *.rsp
35 | *.sbr
36 | *.tlb
37 | *.tli
38 | *.tlh
39 | *.tmp
40 | *.tmp_proj
41 | *.log
42 | *.vspscc
43 | *.vssscc
44 | .builds
45 | *.pidb
46 | *.log
47 | *.scc
48 |
49 | # Visual C++ cache files
50 | ipch/
51 | *.aps
52 | *.ncb
53 | *.opensdf
54 | *.sdf
55 | *.cachefile
56 |
57 | # Visual Studio profiler
58 | *.psess
59 | *.vsp
60 | *.vspx
61 |
62 | # Guidance Automation Toolkit
63 | *.gpState
64 |
65 | # ReSharper is a .NET coding add-in
66 | _ReSharper*/
67 | *.[Rr]e[Ss]harper
68 |
69 | # TeamCity is a build add-in
70 | _TeamCity*
71 |
72 | # DotCover is a Code Coverage Tool
73 | *.dotCover
74 |
75 | # NCrunch
76 | *.ncrunch*
77 | .*crunch*.local.xml
78 |
79 | # Installshield output folder
80 | [Ee]xpress/
81 |
82 | # DocProject is a documentation generator add-in
83 | DocProject/buildhelp/
84 | DocProject/Help/*.HxT
85 | DocProject/Help/*.HxC
86 | DocProject/Help/*.hhc
87 | DocProject/Help/*.hhk
88 | DocProject/Help/*.hhp
89 | DocProject/Help/Html2
90 | DocProject/Help/html
91 |
92 | # Click-Once directory
93 | publish/
94 |
95 | # Publish Web Output
96 | *.Publish.xml
97 |
98 | # NuGet Packages Directory
99 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
100 | #packages/
101 |
102 | # Windows Azure Build Output
103 | csx
104 | *.build.csdef
105 |
106 | # Windows Store app package directory
107 | AppPackages/
108 |
109 | # Others
110 | sql/
111 | *.Cache
112 | ClientBin/
113 | [Ss]tyle[Cc]op.*
114 | ~$*
115 | *~
116 | *.dbmdl
117 | *.[Pp]ublish.xml
118 | *.pfx
119 | *.publishsettings
120 |
121 | # RIA/Silverlight projects
122 | Generated_Code/
123 |
124 | # Backup & report files from converting an old project file to a newer
125 | # Visual Studio version. Backup files are not needed, because we have git ;-)
126 | _UpgradeReport_Files/
127 | Backup*/
128 | UpgradeLog*.XML
129 | UpgradeLog*.htm
130 |
131 | # SQL Server files
132 | App_Data/*.mdf
133 | App_Data/*.ldf
134 |
135 |
136 | #LightSwitch generated files
137 | GeneratedArtifacts/
138 | _Pvt_Extensions/
139 | ModelManifest.xml
140 |
141 | # =========================
142 | # Windows detritus
143 | # =========================
144 |
145 | # Windows image file caches
146 | Thumbs.db
147 | ehthumbs.db
148 |
149 | # Folder config file
150 | Desktop.ini
151 |
152 | # Recycle Bin used on file shares
153 | $RECYCLE.BIN/
154 |
155 | # Mac desktop service store files
156 | .DS_Store
157 |
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/CSGO/CSGOClassID.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot.CSGO
8 | {
9 | public enum ClassID
10 | {
11 | AK47 = 1,
12 | BaseAnimating = 2,
13 | BaseDoor = 10,
14 | BaseEntity = 11,
15 | BaseTrigger = 20,
16 | C4 = 28,
17 | CSGameRulesProxy = 33,
18 | CSPlayer = 34,
19 | CSPlayerResource = 35,
20 | CSRagdoll = 36,
21 | CSTeam = 37,
22 | CascadeLight = 29,
23 | Chicken = 30,
24 | ColorCorrection = 31,
25 | DEagle = 38,
26 | DecoyGrenade = 39,
27 | DynamicProp = 42,
28 | EnvDetailController = 50,
29 | EnvTonemapController = 57,
30 | EnvWind = 58,
31 | Flashbang = 63,
32 | FogController = 64,
33 | FuncBrush = 69,
34 | FuncOccluder = 74,
35 | FuncRotating = 76,
36 | Func_Dust = 66,
37 | HEGrenade = 81,
38 | Hostage = 82,
39 | IncendiaryGrenade = 84,
40 | Inferno = 85,
41 | Knife = 88,
42 | KnifeGG = 88,
43 | LightGlow = 90,
44 | MolotovGrenade = 92,
45 | ParticleSystem = 97,
46 | PhysicsProp = 100,
47 | PhysicsPropMultiplayer = 101,
48 | PlantedC4 = 103,
49 | PostProcessController = 109,
50 | PredictedViewModel = 112,
51 | PropDoorRotating = 114,
52 | RopeKeyframe = 120,
53 | ShadowControl = 123,
54 | SmokeGrenade = 125,
55 | SmokeStack = 126,
56 | Sprite = 129,
57 | Sun = 134,
58 | VGuiScreen = 190,
59 | VoteController = 191,
60 | WeaponAUG = 194,
61 | WeaponAWP = 195,
62 | WeaponBizon = 196,
63 | WeaponElite = 200,
64 | WeaponFiveSeven = 202,
65 | WeaponG3SG1 = 203,
66 | WeaponGalilAR = 205,
67 | WeaponGlock = 206,
68 | WeaponHKP2000 = 207,
69 | WeaponM249 = 208,
70 | WeaponM4A1 = 210,
71 | WeaponMP7 = 214,
72 | WeaponMP9 = 215,
73 | WeaponMag7 = 212,
74 | WeaponNOVA = 217,
75 | WeaponNegev = 216,
76 | WeaponP250 = 219,
77 | WeaponP90 = 220,
78 | WeaponSCAR20 = 222,
79 | WeaponSG556 = 226,
80 | WeaponSSG08 = 227,
81 | WeaponTaser = 228,
82 | WeaponTec9 = 229,
83 | WeaponUMP45 = 231,
84 | WeaponUMP45x = 232,
85 | WeaponXM1014 = 233,
86 | WeaponM4 = 211,
87 | WeaponNova = 218,
88 | WeaponMAG = 213,
89 | ParticleSmokeGrenade = 237,
90 | ParticleDecoy = 40,
91 | ParticleFlash = 9,
92 | ParticleIncendiaryGrenade = 93,
93 | WeaponG3SG1x = 204,
94 | WeaponDualBerettas = 201,
95 | WeaponTec9x = 230,
96 | WeaponPPBizon = 197,
97 | WeaponP90x = 221,
98 | WeaponSCAR20x = 223,
99 | WeaponXM1014x = 234,
100 | WeaponM249x = 209,
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/CSGO/Enums/LifeState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CSGOTriggerbot.CSGO.Enums
7 | {
8 | public enum LifeState
9 | {
10 | Alive = 0, KillCam = 1, Dead = 2
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CSGO/Enums/SignOnState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot.CSGO.Enums
8 | {
9 | public enum SignOnState
10 | {
11 | SIGNONSTATE_NONE = 0,
12 | SIGNONSTATE_CHALLENGE = 1,
13 | SIGNONSTATE_CONNECTED = 2,
14 | SIGNONSTATE_NEW = 3,
15 | SIGNONSTATE_PRESPAWN = 4,
16 | SIGNONSTATE_SPAWN = 5,
17 | SIGNONSTATE_FULL = 6,
18 | SIGNONSTATE_CHANGELEVEL = 7
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CSGO/Enums/SpectatorView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CSGOTriggerbot.CSGO.Enums
7 | {
8 | public enum SpectatorView
9 | {
10 | NotSpectating = 0, DeathCam = 1, FreezeCam = 2, Fixed = 3, Ego = 4, ThirdPerson = 5, Free = 6
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CSGO/Enums/Team.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace CSGOTriggerbot.CSGO.Enums
7 | {
8 | public enum Team
9 | {
10 | None = 0, Spectator = 1, Terrorists = 2, CounterTerrorists = 3
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/CSGOClasses/BaseEntity.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGOClasses.Fields;
2 | using ExternalUtilsCSharp.MathObjects;
3 | using System;
4 | using System.Collections;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace CSGOTriggerbot.CSGOClasses
11 | {
12 | public class BaseEntity : Entity
13 | {
14 | #region VARIABLES
15 | private uint iClientClass, iClassID;
16 | private string szClassName;
17 | #endregion
18 |
19 | #region PROPERTIES
20 | public uint m_iClientClass
21 | {
22 | get
23 | {
24 | if (iClientClass == 0)
25 | iClientClass = GetClientClass();
26 | return iClientClass;
27 | }
28 | protected set { iClientClass = value; }
29 | }
30 | public uint m_iClassID
31 | {
32 | get
33 | {
34 | if (iClassID == 0)
35 | iClassID = GetClassID();
36 | return iClassID;
37 | }
38 | protected set { iClassID = value; }
39 | }
40 | public string m_szClassName
41 | {
42 | get
43 | {
44 | if (szClassName == "")
45 | szClassName = GetClassName();
46 | return szClassName;
47 | }
48 | protected set { szClassName = value; }
49 | }
50 | #endregion
51 |
52 | #region FIELDS
53 | public int m_iHealth
54 | {
55 | get { return this.ReadFieldProxy("CSPlayer.m_iHealth"); }
56 | }
57 | public int m_iVirtualTable
58 | {
59 | get { return ReadFieldProxy("Entity.m_iVirtualTable"); }
60 | }
61 | public int m_iID
62 | {
63 | get { return ReadFieldProxy("Entity.m_iID"); }
64 | }
65 | public byte m_iDormant
66 | {
67 | get { return ReadFieldProxy("Entity.m_iDormant"); }
68 | }
69 | public int m_hOwnerEntity
70 | {
71 | get { return ReadFieldProxy("Entity.m_hOwnerEntity"); }
72 | }
73 | public int m_iTeamNum
74 | {
75 | get { return ReadFieldProxy("Entity.m_iTeamNum"); }
76 | }
77 | public int m_bSpotted
78 | {
79 | get { return ReadFieldProxy("Entity.m_bSpotted"); }
80 | }
81 | public long m_bSpottedByMask
82 | {
83 | get { return ReadFieldProxy("Entity.m_bSpottedByMask"); }
84 | }
85 | public Vector3 m_vecOrigin
86 | {
87 | get { return ReadFieldProxy("Entity.m_vecOrigin"); }
88 | }
89 | public Vector3 m_angRotation
90 | {
91 | get { return ReadFieldProxy("Entity.m_angRotation"); }
92 | }
93 | #endregion
94 |
95 | #region CONSTRUCTOR
96 | public BaseEntity(int address)
97 | : base(address)
98 | {
99 | this.iClassID = 0;
100 | this.iClientClass = 0;
101 | this.szClassName = "";
102 | }
103 | public BaseEntity(BaseEntity copyFrom)
104 | : base(copyFrom.Address)
105 | {
106 | this.Address = copyFrom.Address;
107 | this.CopyFieldsFrom(copyFrom);
108 | this.iClassID = copyFrom.m_iClassID;
109 | this.iClientClass = copyFrom.m_iClientClass;
110 | this.szClassName = copyFrom.m_szClassName;
111 | }
112 | #endregion
113 |
114 | #region METHODS
115 | protected override void SetupFields()
116 | {
117 | base.SetupFields();
118 | this.AddField("CSPlayer.m_iHealth", CSGOOffsets.NetVars.C_BaseEntity.m_iHealth);
119 | this.AddField("Entity.m_iVirtualTable", 0x08);
120 | this.AddField("Entity.m_iID", CSGOOffsets.NetVars.C_BaseEntity.m_iID);
121 | this.AddField("Entity.m_iDormant", CSGOOffsets.NetVars.C_BaseEntity.m_bDormant);
122 | this.AddField("Entity.m_hOwnerEntity", CSGOOffsets.NetVars.C_BaseEntity.m_hOwnerEntity);
123 | this.AddField("Entity.m_iTeamNum", CSGOOffsets.NetVars.C_BaseEntity.m_iTeamNum);
124 | this.AddField("Entity.m_bSpotted", CSGOOffsets.NetVars.C_BaseEntity.m_bSpotted);
125 | this.AddField("Entity.m_bSpottedByMask", CSGOOffsets.NetVars.C_BaseEntity.m_bSpottedByMask);
126 | this.AddField("Entity.m_vecOrigin", CSGOOffsets.NetVars.C_BaseEntity.m_vecOrigin);
127 | this.AddField("Entity.m_angRotation", CSGOOffsets.NetVars.C_BaseEntity.m_angRotation);
128 | }
129 | public override string ToString()
130 | {
131 | return string.Format("[BaseEntity m_iID={0}, m_iClassID={3}, m_szClassName={4}, m_vecOrigin={1}]\n{2}", this.m_iID, this.m_vecOrigin, base.ToString(), this.m_iClassID, this.m_szClassName);
132 | }
133 | public virtual bool IsValid()
134 | {
135 | return this.Address != 0 /* && this.m_iDormant != 1*/ && this.m_iID > 0 && this.m_iClassID > 0;
136 | }
137 | public bool SeenBy(int entityIndex)
138 | {
139 | return (m_bSpottedByMask & (0x1 << entityIndex)) != 0;
140 | }
141 | public bool SeenBy(BaseEntity ent)
142 | {
143 | return SeenBy(ent.m_iID - 1);
144 | }
145 | protected uint GetClientClass()
146 | {
147 | try
148 | {
149 | if (m_iVirtualTable == 0)
150 | return 0;
151 | uint function = WithOverlay.MemUtils.Read((IntPtr)(m_iVirtualTable + 2 * 0x04));
152 | if (function != 0xFFFFFFFF)
153 | return WithOverlay.MemUtils.Read((IntPtr)(function + 0x01));
154 | else
155 | return 0;
156 | }
157 | catch { return 0; }
158 | }
159 | protected uint GetClassID()
160 | {
161 | try
162 | {
163 | uint clientClass = GetClientClass();
164 | if (clientClass != 0)
165 | return WithOverlay.MemUtils.Read((IntPtr)((long)clientClass + 20));
166 | return clientClass;
167 | }
168 | catch { return 0; }
169 | }
170 | protected string GetClassName()
171 | {
172 | try
173 | {
174 | uint clientClass = GetClientClass();
175 | if (clientClass != 0)
176 | {
177 | int ptr = WithOverlay.MemUtils.Read((IntPtr)(clientClass + 8));
178 | return WithOverlay.MemUtils.ReadString((IntPtr)(ptr), 32, Encoding.ASCII);
179 | }
180 | return "none";
181 | }
182 | catch { return "none"; }
183 | }
184 | public bool IsPlayer()
185 | {
186 | return
187 | this.m_iClassID == (int)CSGO.ClassID.CSPlayer;
188 | }
189 | public bool IsWeapon()
190 | {
191 | return
192 | this.m_iClassID == (int)CSGO.ClassID.AK47 ||
193 | this.m_iClassID == (int)CSGO.ClassID.DEagle ||
194 | this.m_iClassID == (int)CSGO.ClassID.Knife ||
195 | this.m_iClassID == (int)CSGO.ClassID.KnifeGG ||
196 | this.m_iClassID == (int)CSGO.ClassID.WeaponAUG ||
197 | this.m_iClassID == (int)CSGO.ClassID.WeaponAWP ||
198 | this.m_iClassID == (int)CSGO.ClassID.WeaponBizon ||
199 | this.m_iClassID == (int)CSGO.ClassID.WeaponDualBerettas ||
200 | this.m_iClassID == (int)CSGO.ClassID.WeaponElite ||
201 | this.m_iClassID == (int)CSGO.ClassID.WeaponFiveSeven ||
202 | this.m_iClassID == (int)CSGO.ClassID.WeaponG3SG1 ||
203 | this.m_iClassID == (int)CSGO.ClassID.WeaponG3SG1x ||
204 | this.m_iClassID == (int)CSGO.ClassID.WeaponGalilAR ||
205 | this.m_iClassID == (int)CSGO.ClassID.WeaponGlock ||
206 | this.m_iClassID == (int)CSGO.ClassID.WeaponHKP2000 ||
207 | this.m_iClassID == (int)CSGO.ClassID.WeaponM249 ||
208 | this.m_iClassID == (int)CSGO.ClassID.WeaponM249x ||
209 | this.m_iClassID == (int)CSGO.ClassID.WeaponM4 ||
210 | this.m_iClassID == (int)CSGO.ClassID.WeaponM4A1 ||
211 | this.m_iClassID == (int)CSGO.ClassID.WeaponMAG ||
212 | this.m_iClassID == (int)CSGO.ClassID.WeaponMag7 ||
213 | this.m_iClassID == (int)CSGO.ClassID.WeaponMP7 ||
214 | this.m_iClassID == (int)CSGO.ClassID.WeaponMP9 ||
215 | this.m_iClassID == (int)CSGO.ClassID.WeaponNegev ||
216 | this.m_iClassID == (int)CSGO.ClassID.WeaponNova ||
217 | this.m_iClassID == (int)CSGO.ClassID.WeaponNOVA ||
218 | this.m_iClassID == (int)CSGO.ClassID.WeaponP250 ||
219 | this.m_iClassID == (int)CSGO.ClassID.WeaponP90 ||
220 | this.m_iClassID == (int)CSGO.ClassID.WeaponP90x ||
221 | this.m_iClassID == (int)CSGO.ClassID.WeaponPPBizon ||
222 | this.m_iClassID == (int)CSGO.ClassID.WeaponSCAR20 ||
223 | this.m_iClassID == (int)CSGO.ClassID.WeaponSCAR20x ||
224 | this.m_iClassID == (int)CSGO.ClassID.WeaponSG556 ||
225 | this.m_iClassID == (int)CSGO.ClassID.WeaponSSG08 ||
226 | this.m_iClassID == (int)CSGO.ClassID.WeaponTaser ||
227 | this.m_iClassID == (int)CSGO.ClassID.WeaponTec9 ||
228 | this.m_iClassID == (int)CSGO.ClassID.WeaponTec9x ||
229 | this.m_iClassID == (int)CSGO.ClassID.WeaponUMP45 ||
230 | this.m_iClassID == (int)CSGO.ClassID.WeaponUMP45x ||
231 | this.m_iClassID == (int)CSGO.ClassID.WeaponXM1014 ||
232 | this.m_iClassID == (int)CSGO.ClassID.WeaponXM1014x ||
233 | this.m_iClassID == (int)CSGO.ClassID.DecoyGrenade ||
234 | this.m_iClassID == (int)CSGO.ClassID.HEGrenade ||
235 | this.m_iClassID == (int)CSGO.ClassID.IncendiaryGrenade ||
236 | this.m_iClassID == (int)CSGO.ClassID.MolotovGrenade ||
237 | this.m_iClassID == (int)CSGO.ClassID.SmokeGrenade ||
238 | this.m_iClassID == (int)CSGO.ClassID.Flashbang;
239 | }
240 | public bool IsProp()
241 | {
242 | return
243 | this.m_iClassID == (int)CSGO.ClassID.DynamicProp ||
244 | this.m_iClassID == (int)CSGO.ClassID.PhysicsProp ||
245 | this.m_iClassID == (int)CSGO.ClassID.PhysicsPropMultiplayer;
246 | }
247 | #endregion
248 | }
249 | }
250 |
--------------------------------------------------------------------------------
/CSGOClasses/CSLocalPlayer.cs:
--------------------------------------------------------------------------------
1 | using ExternalUtilsCSharp.MathObjects;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace CSGOTriggerbot.CSGOClasses
9 | {
10 | public class CSLocalPlayer : CSPlayer
11 | {
12 | #region FIELDS
13 | public Vector3 m_vecViewOffset
14 | {
15 | get { return this.ReadFieldProxy("CSLocalPlayer.m_vecViewOffset"); }
16 | }
17 | public Vector3 m_vecPunch
18 | {
19 | get { return this.ReadFieldProxy("CSLocalPlayer.m_vecPunch"); }
20 | }
21 | public int m_iShotsFired
22 | {
23 | get { return this.ReadFieldProxy("CSLocalPlayer.m_iShotsFired"); }
24 | }
25 | public int m_iCrosshairIdx
26 | {
27 | get { return this.ReadFieldProxy("CSLocalPlayer.m_iCrosshairIdx"); }
28 | }
29 | #endregion
30 |
31 | #region CONSTRUCTORS
32 | public CSLocalPlayer(int address)
33 | : base(address)
34 | {
35 | this.AddField("CSLocalPlayer.m_vecViewOffset", CSGOOffsets.NetVars.LocalPlayer.m_vecViewOffset);
36 | this.AddField("CSLocalPlayer.m_vecPunch", CSGOOffsets.NetVars.LocalPlayer.m_vecPunch);
37 | this.AddField("CSLocalPlayer.m_iShotsFired", CSGOOffsets.NetVars.LocalPlayer.m_iShotsFired);
38 | this.AddField("CSLocalPlayer.m_iCrosshairIdx", CSGOOffsets.NetVars.LocalPlayer.m_iCrosshairIdx);
39 | }
40 | public CSLocalPlayer(CSPlayer player)
41 | : base(player)
42 | {
43 | this.CopyFieldsFrom(player);
44 | this.AddField("CSLocalPlayer.m_vecViewOffset", CSGOOffsets.NetVars.LocalPlayer.m_vecViewOffset);
45 | this.AddField("CSLocalPlayer.m_vecPunch", CSGOOffsets.NetVars.LocalPlayer.m_vecPunch);
46 | this.AddField("CSLocalPlayer.m_iShotsFired", CSGOOffsets.NetVars.LocalPlayer.m_iShotsFired);
47 | this.AddField("CSLocalPlayer.m_iCrosshairIdx", CSGOOffsets.NetVars.LocalPlayer.m_iCrosshairIdx);
48 | }
49 | #endregion
50 |
51 | #region METHODS
52 | public override string ToString()
53 | {
54 | return string.Format("[CSLocalPlayer m_iCrosshairIdx={1}, m_iShotsFired={2}, m_vecPunch={0}]\n{3}", this.m_vecPunch, this.m_iCrosshairIdx, this.m_iShotsFired, base.ToString());
55 | }
56 | #endregion
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/CSGOClasses/CSPlayer.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGOClasses.Fields;
2 | using ExternalUtilsCSharp.MathObjects;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace CSGOTriggerbot.CSGOClasses
10 | {
11 | public class CSPlayer : BaseEntity
12 | {
13 | #region VARIABLES
14 | private uint iWeaponIndex;
15 | #endregion
16 |
17 | #region FIELDS
18 | public int m_hBoneMatrix
19 | {
20 | get { return this.ReadFieldProxy("CSPlayer.m_hBoneMatrix"); }
21 | }
22 | public int m_iFlags
23 | {
24 | get { return this.ReadFieldProxy("CSPlayer.m_iFlags"); }
25 | }
26 | public uint m_hActiveWeapon
27 | {
28 | get { return this.ReadFieldProxy("CSPlayer.m_hActiveWeapon"); }
29 | }
30 | public Vector3 m_vecVelocity
31 | {
32 | get { return this.ReadFieldProxy("CSPlayer.m_vecVelocity"); }
33 | }
34 | public int m_hObserverTarget
35 | {
36 | get { return this.ReadFieldProxy("CSPlayer.m_hObserverTarget") & 0xFFF; }
37 | }
38 | public int m_iObserverMode
39 | {
40 | get { return this.ReadFieldProxy("CSPlayer.m_iObserverMode"); }
41 | }
42 | public uint m_iWeaponIndex
43 | {
44 | get
45 | {
46 | if (iWeaponIndex == 0)
47 | {
48 | if (this.m_hActiveWeapon != 0xFFFFFFFF)
49 | iWeaponIndex = this.m_hActiveWeapon & 0xFFF;
50 | }
51 | return iWeaponIndex;
52 | }
53 | }
54 | public Skeleton Bones { get; private set; }
55 | #endregion
56 |
57 | #region CONSTRUCTORS
58 | public CSPlayer(int address) : base(address)
59 | {
60 | iWeaponIndex = 0;
61 | this.Bones = new Skeleton(this.m_hBoneMatrix);
62 | }
63 | public CSPlayer(BaseEntity baseEntity)
64 | : base(baseEntity)
65 | {
66 | iWeaponIndex = 0;
67 | this.Bones = new Skeleton(this.m_hBoneMatrix);
68 | }
69 | public CSPlayer(CSPlayer copyFrom) : base(copyFrom)
70 | {
71 | this.CopyFieldsFrom(copyFrom);
72 | iWeaponIndex = 0;
73 | this.Bones = copyFrom.Bones;
74 | }
75 | #endregion
76 |
77 | #region METHODS
78 | protected override void SetupFields()
79 | {
80 | base.SetupFields();
81 | this.AddField("CSPlayer.m_hBoneMatrix", CSGOOffsets.NetVars.C_CSPlayer.m_hBoneMatrix);
82 | this.AddField("CSPlayer.m_hActiveWeapon", CSGOOffsets.NetVars.C_CSPlayer.m_hActiveWeapon);
83 | this.AddField("CSPlayer.m_iFlags", CSGOOffsets.NetVars.C_CSPlayer.m_iFlags);
84 | this.AddField("CSPlayer.m_hObserverTarget", CSGOOffsets.NetVars.C_CSPlayer.m_hObserverTarget);
85 | this.AddField("CSPlayer.m_iObserverMode", CSGOOffsets.NetVars.C_CSPlayer.m_iObserverMode);
86 | this.AddField("CSPlayer.m_vecVelocity", CSGOOffsets.NetVars.C_CSPlayer.m_vecVelocity);
87 | }
88 | public override bool IsValid()
89 | {
90 | return base.IsValid() && (this.m_iTeamNum == 2 ||this.m_iTeamNum == 3);
91 | }
92 | public override string ToString()
93 | {
94 | return string.Format("[CSPlayer m_iHealth={0}, m_iTeamNum={3}, m_iFlags={1}]\n{2}", this.m_iHealth, Convert.ToString(this.m_iFlags, 2).PadLeft(32, '0'), base.ToString(), this.m_iTeamNum);
95 | }
96 | public Weapon GetActiveWeapon()
97 | {
98 | if (this.m_hActiveWeapon == 0xFFFFFFFF)
99 | return null;
100 |
101 | uint handle = this.m_hActiveWeapon & 0xFFF;
102 | if (WithOverlay.Framework.Weapons.Count(x=>x.Item1 == handle - 1) > 0)
103 | {
104 | return WithOverlay.Framework.Weapons.First(x => x.Item1 == handle - 1).Item2;
105 | }
106 | return null;
107 | }
108 | #endregion
109 |
110 | #region CLASSES
111 | public class Skeleton : Entity
112 | {
113 | #region FIELDS
114 | public Vector3 Head
115 | {
116 | get { return ReadFieldProxy("Head"); }
117 | }
118 | public Vector3 Neck
119 | {
120 | get { return ReadFieldProxy("Neck"); }
121 | }
122 | public Vector3 Spine1
123 | {
124 | get { return ReadFieldProxy("Spine1"); }
125 | }
126 | public Vector3 Spine2
127 | {
128 | get { return ReadFieldProxy("Spine2"); }
129 | }
130 | public Vector3 Spine3
131 | {
132 | get { return ReadFieldProxy("Spine3"); }
133 | }
134 | public Vector3 Spine4
135 | {
136 | get { return ReadFieldProxy("Spine4"); }
137 | }
138 | public Vector3 Spine5
139 | {
140 | get { return ReadFieldProxy("Spine5"); }
141 | }
142 | public Vector3 LeftHand
143 | {
144 | get { return ReadFieldProxy("LeftHand"); }
145 | }
146 | public Vector3 LeftElbow
147 | {
148 | get { return ReadFieldProxy("LeftElbow"); }
149 | }
150 | public Vector3 LeftShoulder
151 | {
152 | get { return ReadFieldProxy("LeftShoulder"); }
153 | }
154 | public Vector3 RightShoulder
155 | {
156 | get { return ReadFieldProxy("RightShoulder"); }
157 | }
158 | public Vector3 RightElbow
159 | {
160 | get { return ReadFieldProxy("RightElbow"); }
161 | }
162 | public Vector3 RightHand
163 | {
164 | get { return ReadFieldProxy("RightHand"); }
165 | }
166 | public Vector3 LeftToe
167 | {
168 | get { return ReadFieldProxy("LeftToe"); }
169 | }
170 | public Vector3 LeftFoot
171 | {
172 | get { return ReadFieldProxy("LeftFoot"); }
173 | }
174 | public Vector3 LeftKnee
175 | {
176 | get { return ReadFieldProxy("LeftKnee"); }
177 | }
178 | public Vector3 LeftHip
179 | {
180 | get { return ReadFieldProxy("LeftHip"); }
181 | }
182 | public Vector3 RightHip
183 | {
184 | get { return ReadFieldProxy("RightHip"); }
185 | }
186 | public Vector3 RightKnee
187 | {
188 | get { return ReadFieldProxy("RightKnee"); }
189 | }
190 | public Vector3 RightFoot
191 | {
192 | get { return ReadFieldProxy("RightFoot"); }
193 | }
194 | public Vector3 RightToe
195 | {
196 | get { return ReadFieldProxy("RightToe"); }
197 | }
198 | public Vector3 Weapon1
199 | {
200 | get { return ReadFieldProxy("Weapon1"); }
201 | }
202 | public Vector3 Weapon2
203 | {
204 | get { return ReadFieldProxy("Weapon2"); }
205 | }
206 | #endregion
207 |
208 | #region CONSTRUCTORS
209 | public Skeleton(int address) : base(address)
210 | {
211 | this.AddBone("Head", 11);
212 | this.AddBone("Neck", 10);
213 | this.AddBone("Spine1", 1);
214 | this.AddBone("Spine2", 2);
215 | this.AddBone("Spine3", 3);
216 | this.AddBone("Spine4", 4);
217 | this.AddBone("Spine5", 5);
218 | this.AddBone("LeftHand", 21);
219 | this.AddBone("LeftElbow", 31);
220 | this.AddBone("LeftShoulder", 36);
221 | this.AddBone("RightShoulder", 37);
222 | this.AddBone("RightElbow", 38);
223 | this.AddBone("RightHand", 15);
224 | this.AddBone("LeftToe", 38);
225 | this.AddBone("LeftFoot", 28);
226 | this.AddBone("LeftKnee", 27);
227 | this.AddBone("LeftHip", 26);
228 | this.AddBone("RightHip", 23);
229 | this.AddBone("RightKnee", 24);
230 | this.AddBone("RightFoot", 25);
231 | this.AddBone("RightToe", 37);
232 | this.AddBone("Weapon1", 16);
233 | this.AddBone("Weapon2", 21);
234 | }
235 | #endregion
236 |
237 | #region METHODS
238 | public Vector3 GetBoneByIndex(int index)
239 | {
240 | var fields = this.Fields.Values.Cast();
241 | if (fields.Count(x => x.Offset == index) == 0)
242 | return Vector3.Zero;
243 | BonesField field = fields.First(x => x.Offset == index);
244 | foreach (string name in this.Fields.Keys)
245 | if (this.Fields[name] == field)
246 | return ReadFieldProxy(name);
247 | return Vector3.Zero;
248 | }
249 | protected void AddBone(string name, int index)
250 | {
251 | this.Fields[name] = new BonesField(index);
252 | }
253 | #endregion
254 | }
255 | #endregion
256 | }
257 | }
258 |
--------------------------------------------------------------------------------
/CSGOClasses/Entity.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGOClasses.Fields;
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace CSGOTriggerbot.CSGOClasses
10 | {
11 | ///
12 | /// An abstract class meant for managing Entities
13 | /// Utilizes a hashtable to manage reading data and cache data
14 | ///
15 | public abstract class Entity
16 | {
17 |
18 | #region PROPERTIES
19 | public Hashtable Fields { get; private set; }
20 | public int Address { get; protected set; }
21 | #endregion
22 |
23 | #region CONSTRUCTORS
24 | public Entity(int address)
25 | {
26 | this.Address = address;
27 | this.Fields = new Hashtable();
28 | this.SetupFields();
29 | }
30 | public Entity() : this(0)
31 | { }
32 | #endregion
33 |
34 | #region METHODS
35 | public override string ToString()
36 | {
37 | return string.Format("[Entity Address={0}]", this.Address.ToString("X"));
38 | }
39 | #endregion
40 |
41 | #region HELPERS
42 | protected void AddField(string fieldName, int offset, T value = default(T)) where T : struct
43 | {
44 | Fields[fieldName] = new Field(offset, value);
45 | }
46 | ///
47 | /// Returns the value of the given field if the field has read its value before
48 | /// Makes the field read its value if it did not do so before
49 | ///
50 | ///
51 | ///
52 | ///
53 | protected T ReadFieldProxy(string fieldName) where T : struct
54 | {
55 | Field field = (Field)Fields[fieldName];
56 | if (!field.ValueRead)
57 | field.ReadValue(this.Address);
58 | return field.Value;
59 | }
60 | ///
61 | /// Copies the fields of one Entity to another one;
62 | /// Used for copy-constructors
63 | ///
64 | ///
65 | ///
66 | protected void CopyFieldsFrom(T other) where T : Entity
67 | {
68 | foreach (string key in other.Fields.Keys)
69 | this.Fields[key] = other.Fields[key];
70 | }
71 |
72 | protected virtual void SetupFields()
73 | { }
74 | #endregion
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/CSGOClasses/Fields/BonesField.cs:
--------------------------------------------------------------------------------
1 | using ExternalUtilsCSharp.MathObjects;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace CSGOTriggerbot.CSGOClasses.Fields
9 | {
10 | public class BonesField : Field
11 | {
12 | public BonesField(int index) : base(index)
13 | { }
14 |
15 | public override void ReadValue(int baseAddress)
16 | {
17 | float x, y, z;
18 | x = WithOverlay.MemUtils.Read((IntPtr)(baseAddress + this.Offset * 0x30 + 0x0C));
19 | y = WithOverlay.MemUtils.Read((IntPtr)(baseAddress + this.Offset * 0x30 + 0x1C));
20 | z = WithOverlay.MemUtils.Read((IntPtr)(baseAddress + this.Offset * 0x30 + 0x2C));
21 | this.Value = new Vector3(x, y, z);
22 | this.ValueRead = true;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/CSGOClasses/Fields/Field.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot.CSGOClasses.Fields
8 | {
9 | public class Field where T : struct
10 | {
11 | public bool ValueRead { get; protected set; }
12 | public int Offset { get; protected set; }
13 | public T Value { get; protected set; }
14 |
15 | public Field() : this(0)
16 | { }
17 | public Field(int offset) : this(offset, default(T))
18 | { }
19 | public Field(int offset, T value)
20 | {
21 | this.Offset = offset;
22 | this.Value = value;
23 | this.ValueRead = false;
24 | }
25 |
26 | public virtual void ReadValue(int baseAddress)
27 | {
28 | this.Value = WithOverlay.MemUtils.Read((IntPtr)(baseAddress + this.Offset));
29 | this.ValueRead = true;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CSGOClasses/Framework.cs:
--------------------------------------------------------------------------------
1 | using ExternalUtilsCSharp;
2 | using ExternalUtilsCSharp.MathObjects;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading;
10 | using System.Threading.Tasks;
11 |
12 | namespace CSGOTriggerbot.CSGOClasses
13 | {
14 | public class Framework
15 | {
16 | #region VARIABLES
17 | private int
18 | dwEntityList,
19 | dwViewMatrix,
20 | dwLocalPlayer,
21 | dwClientState,
22 | clientDllBase,
23 | engineDllBase,
24 | dwIGameResources;
25 | private bool mouseEnabled;
26 | private string mapName;
27 | #endregion
28 | #region PROPERTIES
29 | public CSLocalPlayer LocalPlayer { get; private set; }
30 | public BaseEntity Target { get; private set; }
31 | public Tuple[] Players { get; private set; }
32 | public Tuple[] Entities { get; private set; }
33 | public Tuple[] Weapons { get; private set; }
34 | public Matrix ViewMatrix { get; private set; }
35 | public Vector3 ViewAngles { get; private set; }
36 | public Vector3 NewViewAngles { get; private set; }
37 | public int[] Kills { get; private set; }
38 | public int[] Deaths { get; private set; }
39 | public int[] Assists { get; private set; }
40 | public int[] Armor { get; private set; }
41 | public int[] Score { get; private set; }
42 | public string[] Clantags { get; private set; }
43 | public string[] Names { get; private set; }
44 | public SignOnState State { get; set; }
45 | public bool MouseEnabled
46 | {
47 | get { return mouseEnabled; }
48 | set
49 | {
50 | if (value != mouseEnabled)
51 | {
52 | mouseEnabled = value;
53 | //WinAPI.SetCursorPos(WithOverlay.SHDXOverlay.Location.X + WithOverlay.SHDXOverlay.Width / 2, WithOverlay.SHDXOverlay.Location.Y + WithOverlay.SHDXOverlay.Height / 2);
54 | //WithOverlay.MemUtils.Write((IntPtr)(clientDllBase + CSGOOffsets.Misc.MouseEnable), value ? (byte)1 : (byte)0);
55 | }
56 | }
57 | }
58 | public bool AimbotActive { get; set; }
59 | public bool TriggerbotActive { get; set; }
60 | private bool RCSHandled { get; set; }
61 | private int LastShotsFired { get; set; }
62 | private int LastClip { get; set; }
63 | private Vector3 LastPunch { get; set; }
64 | private bool TriggerOnTarget { get; set; }
65 | private long TriggerLastTarget { get; set; }
66 | private long TriggerLastShot { get; set; }
67 | private int TriggerBurstFired { get; set; }
68 | private int TriggerBurstCount { get; set; }
69 | private bool TriggerShooting { get; set; }
70 | private Weapon LocalPlayerWeapon { get; set; }
71 | #endregion
72 |
73 | #region CONSTRUCTOR
74 | public Framework(ProcessModule clientDll, ProcessModule engineDll)
75 | {
76 | CSGOScanner.ScanOffsets(WithOverlay.MemUtils, clientDll, engineDll);
77 | clientDllBase = (int)clientDll.BaseAddress;
78 | engineDllBase = (int)engineDll.BaseAddress;
79 | dwEntityList = clientDllBase + CSGOOffsets.Misc.EntityList;
80 | dwViewMatrix = clientDllBase + CSGOOffsets.Misc.ViewMatrix;
81 | dwClientState = WithOverlay.MemUtils.Read((IntPtr)(engineDllBase + CSGOOffsets.ClientState.Base));
82 | mouseEnabled = true;
83 | AimbotActive = false;
84 | TriggerbotActive = false;
85 | }
86 | #endregion
87 |
88 | #region METHODS
89 | public void Update()
90 | {
91 | List> players = new List>();
92 | List> entities = new List>();
93 | List> weapons = new List>();
94 |
95 | dwLocalPlayer = WithOverlay.MemUtils.Read((IntPtr)(clientDllBase + CSGOOffsets.Misc.LocalPlayer));
96 | dwIGameResources = WithOverlay.MemUtils.Read((IntPtr)(clientDllBase + CSGOOffsets.GameResources.Base));
97 |
98 | State = (SignOnState)WithOverlay.MemUtils.Read((IntPtr)(dwClientState + CSGOOffsets.ClientState.m_dwInGame));
99 | if (State != SignOnState.SIGNONSTATE_FULL)
100 | return;
101 |
102 | ViewMatrix = WithOverlay.MemUtils.ReadMatrix((IntPtr)dwViewMatrix, 4, 4);
103 | ViewAngles = WithOverlay.MemUtils.Read((IntPtr)(dwClientState + CSGOOffsets.ClientState.m_dwViewAngles));
104 | NewViewAngles = ViewAngles;
105 | RCSHandled = false;
106 |
107 | #region Read entities
108 | byte[] data = new byte[16 * 8192];
109 | WithOverlay.MemUtils.Read((IntPtr)(dwEntityList), out data, data.Length);
110 |
111 | for (int i = 0; i < data.Length / 16; i++)
112 | {
113 | int address = BitConverter.ToInt32(data, 16 * i);
114 | if (address != 0)
115 | {
116 | BaseEntity ent = new BaseEntity(address);
117 | if (!ent.IsValid())
118 | continue;
119 | if (ent.IsPlayer())
120 | players.Add(new Tuple(i, new CSPlayer(ent)));
121 | else if (ent.IsWeapon())
122 | weapons.Add(new Tuple(i, new Weapon(ent)));
123 | else
124 | entities.Add(new Tuple(i, ent));
125 | }
126 | }
127 |
128 | Players = players.ToArray();
129 | Entities = entities.ToArray();
130 | Weapons = weapons.ToArray();
131 | #endregion
132 |
133 | #region LocalPlayer and Target
134 | if (players.Exists(x => x.Item2.Address == dwLocalPlayer))
135 | {
136 | LocalPlayer = new CSLocalPlayer(players.First(x => x.Item2.Address == dwLocalPlayer).Item2);
137 | LocalPlayerWeapon = LocalPlayer.GetActiveWeapon();
138 | }
139 | else
140 | {
141 | LocalPlayer = null;
142 | LocalPlayerWeapon = null;
143 | }
144 |
145 | if (LocalPlayer != null)
146 | {
147 | if (entities.Exists(x => x.Item1 == LocalPlayer.m_iCrosshairIdx - 1))
148 | Target = entities.First(x => x.Item1 == LocalPlayer.m_iCrosshairIdx - 1).Item2;
149 | if (players.Exists(x => x.Item1 == LocalPlayer.m_iCrosshairIdx - 1))
150 | Target = players.First(x => x.Item1 == LocalPlayer.m_iCrosshairIdx - 1).Item2;
151 | else
152 | Target = null;
153 | }
154 | #endregion
155 |
156 | if (LocalPlayer == null)
157 | return;
158 |
159 | #region IGameResources
160 | if (dwIGameResources != 0)
161 | {
162 | Kills = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Kills), 65);
163 | Deaths = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Deaths), 65);
164 | Armor = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Armor), 65);
165 | Assists = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Assists), 65);
166 | Score = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Score), 65);
167 |
168 | byte[] clantagsData = new byte[16 * 65];
169 | WithOverlay.MemUtils.Read((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Clantag), out clantagsData, clantagsData.Length);
170 | string[] clantags = new string[65];
171 | for (int i = 0; i < 65; i++)
172 | clantags[i] = Encoding.Unicode.GetString(clantagsData, i * 16, 16);
173 | Clantags = clantags;
174 |
175 | int[] namePtrs = WithOverlay.MemUtils.ReadArray((IntPtr)(dwIGameResources + CSGOOffsets.GameResources.Names), 65);
176 | string[] names = new string[65];
177 | for (int i = 0; i < 65; i++)
178 | try
179 | {
180 | names[i] = WithOverlay.MemUtils.ReadString((IntPtr)namePtrs[i], 32, Encoding.ASCII);
181 | }
182 | catch { }
183 | Names = names;
184 | }
185 | #endregion
186 |
187 | #region Aimbot
188 | if (WithOverlay.ConfigUtils.GetValue("aimEnabled"))
189 | {
190 | if (WithOverlay.ConfigUtils.GetValue("aimToggle"))
191 | {
192 | if (WithOverlay.KeyUtils.KeyWentUp(WithOverlay.ConfigUtils.GetValue("aimKey")))
193 | AimbotActive = !AimbotActive;
194 | }
195 | else if (WithOverlay.ConfigUtils.GetValue("aimHold"))
196 | {
197 | AimbotActive = WithOverlay.KeyUtils.KeyIsDown(WithOverlay.ConfigUtils.GetValue("aimKey"));
198 | }
199 | if (AimbotActive)
200 | DoAimbot();
201 | }
202 | #endregion
203 |
204 | #region RCS
205 | DoRCS();
206 | #endregion
207 |
208 | #region Set view angles
209 | if (NewViewAngles != ViewAngles)
210 | SetViewAngles(NewViewAngles);
211 | #endregion
212 |
213 | #region triggerbot
214 | if (WithOverlay.ConfigUtils.GetValue("triggerEnabled"))
215 | {
216 | if (WithOverlay.ConfigUtils.GetValue("triggerToggle"))
217 | {
218 | if (WithOverlay.KeyUtils.KeyWentUp(WithOverlay.ConfigUtils.GetValue("triggerKey")))
219 | TriggerbotActive = !TriggerbotActive;
220 | }
221 | else if (WithOverlay.ConfigUtils.GetValue("triggerHold"))
222 | {
223 | TriggerbotActive = WithOverlay.KeyUtils.KeyIsDown(WithOverlay.ConfigUtils.GetValue("triggerKey"));
224 | }
225 | if (TriggerbotActive && !WithOverlay.KeyUtils.KeyIsDown(WinAPI.VirtualKeyShort.LBUTTON))
226 | DoTriggerbot();
227 | }
228 | #endregion
229 |
230 | #region triggerbot-burst
231 | if (TriggerShooting)
232 | {
233 | if (LocalPlayerWeapon == null)
234 | {
235 | TriggerShooting = false;
236 | }
237 | else
238 | {
239 | if (WithOverlay.ConfigUtils.GetValue("triggerBurstEnabled"))
240 | {
241 | if (TriggerBurstFired >= TriggerBurstCount)
242 | {
243 | TriggerShooting = false;
244 | TriggerBurstFired = 0;
245 | }
246 | else
247 | {
248 | if (LocalPlayerWeapon.m_iClip1 != LastClip)
249 | {
250 | TriggerBurstFired += Math.Abs(LocalPlayerWeapon.m_iClip1 - LastClip);
251 | }
252 | else
253 | {
254 | Shoot();
255 | }
256 | }
257 | }
258 | else
259 | {
260 | Shoot();
261 | TriggerShooting = false;
262 | }
263 | }
264 | }
265 |
266 | #endregion
267 | if (LocalPlayerWeapon != null)
268 | LastClip = LocalPlayerWeapon.m_iClip1;
269 | else
270 | LastClip = 0;
271 | LastShotsFired = LocalPlayer.m_iShotsFired;
272 | LastPunch = LocalPlayer.m_vecPunch;
273 | }
274 |
275 | public void SetViewAngles(Vector3 viewAngles, bool clamp = true)
276 | {
277 | if (clamp)
278 | viewAngles = MathUtils.ClampAngle(viewAngles);
279 | WithOverlay.MemUtils.Write((IntPtr)(dwClientState + CSGOOffsets.ClientState.m_dwViewAngles), viewAngles);
280 | }
281 |
282 | public bool IsPlaying()
283 | {
284 | return State == SignOnState.SIGNONSTATE_FULL && LocalPlayer != null;
285 | }
286 |
287 | public void DoAimbot()
288 | {
289 | if (LocalPlayer == null)
290 | return;
291 | var valid = Players.Where(x => x.Item2.IsValid() && x.Item2.m_iHealth != 0 && x.Item2.m_iDormant != 1);
292 | if (WithOverlay.ConfigUtils.GetValue("aimFilterSpotted"))
293 | valid = valid.Where(x => x.Item2.SeenBy(LocalPlayer));
294 | if (WithOverlay.ConfigUtils.GetValue("aimFilterSpottedBy"))
295 | valid = valid.Where(x => LocalPlayer.SeenBy(x.Item2));
296 | if (WithOverlay.ConfigUtils.GetValue("aimFilterEnemies"))
297 | valid = valid.Where(x => x.Item2.m_iTeamNum != LocalPlayer.m_iTeamNum);
298 | if (WithOverlay.ConfigUtils.GetValue("aimFilterAllies"))
299 | valid = valid.Where(x => x.Item2.m_iTeamNum == LocalPlayer.m_iTeamNum);
300 |
301 | valid = valid.OrderBy(x => (x.Item2.m_vecOrigin - LocalPlayer.m_vecOrigin).Length());
302 | Vector3 closest = Vector3.Zero;
303 | float closestFov = float.MaxValue;
304 | foreach (Tuple tpl in valid)
305 | {
306 | CSPlayer plr = tpl.Item2;
307 | Vector3 newAngles = MathUtils.CalcAngle(LocalPlayer.m_vecOrigin + LocalPlayer.m_vecViewOffset, plr.Bones.GetBoneByIndex(WithOverlay.ConfigUtils.GetValue("aimBone"))) - NewViewAngles;
308 | newAngles = MathUtils.ClampAngle(newAngles);
309 | float fov = newAngles.Length() % 360f;
310 | if (fov < closestFov && fov < WithOverlay.ConfigUtils.GetValue("aimFov"))
311 | {
312 | closestFov = fov;
313 | closest = newAngles;
314 | }
315 | }
316 | if (closest != Vector3.Zero)
317 | {
318 | DoRCS(true);
319 | if (WithOverlay.ConfigUtils.GetValue("aimSmoothEnabled"))
320 | NewViewAngles = MathUtils.SmoothAngle(NewViewAngles, NewViewAngles + closest, WithOverlay.ConfigUtils.GetValue("aimSmoothValue"));
321 | else
322 | NewViewAngles += closest;
323 | NewViewAngles = NewViewAngles;
324 | }
325 | }
326 |
327 | public void DoRCS(bool aimbot = false)
328 | {
329 | if (WithOverlay.ConfigUtils.GetValue("rcsEnabled"))
330 | {
331 | if (LocalPlayerWeapon != null)
332 | {
333 | if (!RCSHandled && (LocalPlayerWeapon.m_iClip1 != LastClip || LocalPlayer.m_iShotsFired > 0 || WithOverlay.KeyUtils.KeyIsDown(WinAPI.VirtualKeyShort.LBUTTON)))
334 | {
335 | if (aimbot)
336 | {
337 | NewViewAngles -= LocalPlayer.m_vecPunch * (2f / 100f * WithOverlay.ConfigUtils.GetValue("rcsForce"));
338 | }
339 | else
340 | {
341 | Vector3 punch = LocalPlayer.m_vecPunch - LastPunch;
342 | NewViewAngles -= punch * (2f / 100f * WithOverlay.ConfigUtils.GetValue("rcsForce"));
343 | }
344 | RCSHandled = true;
345 | }
346 | }
347 | }
348 | }
349 |
350 | public void DoTriggerbot()
351 | {
352 | if (LocalPlayer != null && !TriggerShooting)
353 | {
354 | if (Players.Count(x => x.Item2.m_iID == LocalPlayer.m_iCrosshairIdx) > 0)
355 | {
356 | CSPlayer player = Players.First(x=>x.Item2.m_iID == LocalPlayer.m_iCrosshairIdx).Item2;
357 | if ((WithOverlay.ConfigUtils.GetValue("triggerFilterEnemies") && player.m_iTeamNum != LocalPlayer.m_iTeamNum) ||
358 | (WithOverlay.ConfigUtils.GetValue("triggerFilterAllies") && player.m_iTeamNum == LocalPlayer.m_iTeamNum))
359 | {
360 | if (!TriggerOnTarget)
361 | {
362 | TriggerOnTarget = true;
363 | TriggerLastTarget = DateTime.Now.Ticks;
364 | }
365 | else
366 | {
367 | if (new TimeSpan(DateTime.Now.Ticks - TriggerLastTarget).TotalMilliseconds >= WithOverlay.ConfigUtils.GetValue("triggerDelayFirstShot"))
368 | {
369 | if (new TimeSpan(DateTime.Now.Ticks - TriggerLastShot).TotalMilliseconds >= WithOverlay.ConfigUtils.GetValue("triggerDelayShots"))
370 | {
371 | TriggerLastShot = DateTime.Now.Ticks;
372 | if(!TriggerShooting)
373 | {
374 | if (WithOverlay.ConfigUtils.GetValue("triggerBurstRandomize"))
375 | TriggerBurstCount = new Random().Next(1, (int)WithOverlay.ConfigUtils.GetValue("triggerBurstShots"));
376 | else TriggerBurstCount = (int)WithOverlay.ConfigUtils.GetValue("triggerBurstShots");
377 | }
378 | TriggerShooting = true;
379 | }
380 | }
381 | }
382 | }
383 | else
384 | {
385 | TriggerOnTarget = false;
386 | }
387 | }
388 | }
389 | }
390 |
391 | private void Shoot()
392 | {
393 | WinAPI.mouse_event(WinAPI.MOUSEEVENTF.LEFTDOWN, 0, 0, 0, 0);
394 | Thread.Sleep(1);
395 | WinAPI.mouse_event(WinAPI.MOUSEEVENTF.LEFTUP, 0, 0, 0, 0);
396 | }
397 | #endregion
398 | }
399 | }
400 |
--------------------------------------------------------------------------------
/CSGOClasses/Weapon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot.CSGOClasses
8 | {
9 | public class Weapon : BaseEntity
10 | {
11 | #region VARIABLES
12 | #endregion
13 |
14 | #region FIELDS
15 | public int m_iItemDefinitionIndex
16 | {
17 | get { return this.ReadFieldProxy("Weapon.m_iItemDefinitionIndex"); }
18 | }
19 | public int m_iState
20 | {
21 | get { return this.ReadFieldProxy("Weapon.m_iState"); }
22 | }
23 | public int m_iClip1
24 | {
25 | get { return this.ReadFieldProxy("Weapon.m_iClip1"); }
26 | }
27 | public float m_flNextPrimaryAttack
28 | {
29 | get { return this.ReadFieldProxy("Weapon.m_flNextPrimaryAttack"); }
30 | }
31 | public int m_bCanReload
32 | {
33 | get { return this.ReadFieldProxy("Weapon.m_bCanReload"); }
34 | }
35 | public int m_iWeaponTableIndex
36 | {
37 | get { return this.ReadFieldProxy("Weapon.m_iWeaponTableIndex"); }
38 | }
39 | public float m_fAccuracyPenalty
40 | {
41 | get { return this.ReadFieldProxy("Weapon.m_fAccuracyPenalty"); }
42 | }
43 | public int m_iWeaponID
44 | {
45 | get { return this.ReadFieldProxy("Weapon.m_iWeaponID"); }
46 | }
47 | #endregion
48 |
49 | #region CONSTRUCTORS
50 | public Weapon(int address) : base(address)
51 | {
52 | }
53 | public Weapon(BaseEntity baseEntity)
54 | : base(baseEntity)
55 | {
56 | }
57 | public Weapon(Weapon other)
58 | : base(other)
59 | {
60 | this.CopyFieldsFrom(other);
61 | }
62 | #endregion
63 |
64 | #region METHODS
65 | protected override void SetupFields()
66 | {
67 | base.SetupFields();
68 | this.AddField("Weapon.m_iItemDefinitionIndex", CSGOOffsets.NetVars.Weapon.m_iItemDefinitionIndex);
69 | this.AddField("Weapon.m_iState", CSGOOffsets.NetVars.Weapon.m_iState);
70 | this.AddField("Weapon.m_iClip1", CSGOOffsets.NetVars.Weapon.m_iClip1);
71 | this.AddField("Weapon.m_flNextPrimaryAttack", CSGOOffsets.NetVars.Weapon.m_flNextPrimaryAttack);
72 | this.AddField("Weapon.m_bCanReload", CSGOOffsets.NetVars.Weapon.m_bCanReload);
73 | this.AddField("Weapon.m_iWeaponTableIndex", CSGOOffsets.NetVars.Weapon.m_iWeaponTableIndex);
74 | this.AddField("Weapon.m_fAccuracyPenalty", CSGOOffsets.NetVars.Weapon.m_fAccuracyPenalty);
75 | this.AddField("Weapon.m_iWeaponID", CSGOOffsets.NetVars.Weapon.m_iWeaponID);
76 | }
77 | public override bool IsValid()
78 | {
79 | return base.IsValid() && this.m_iWeaponID > 0 && this.m_iItemDefinitionIndex > 0;
80 | }
81 | public bool IsCarried()
82 | {
83 | return this.m_hOwnerEntity != 0;
84 | }
85 | #endregion
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/CSGOConfigUtils.cs:
--------------------------------------------------------------------------------
1 | using ExternalUtilsCSharp;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace CSGOTriggerbot
9 | {
10 | public class CSGOConfigUtils : ConfigUtils
11 | {
12 | #region PROPERTIES
13 | public List UIntegerSettings { get; set; }
14 | public List IntegerSettings { get; set; }
15 | public List FloatSettings { get; set; }
16 | public List KeySettings { get; set; }
17 | public List BooleanSettings { get; set; }
18 | #endregion
19 |
20 | #region CONSTRUCTOR
21 | public CSGOConfigUtils() : base()
22 | {
23 | this.IntegerSettings = new List();
24 | this.UIntegerSettings = new List();
25 | this.FloatSettings = new List();
26 | this.KeySettings = new List();
27 | this.BooleanSettings = new List();
28 | }
29 | #endregion
30 |
31 | #region METHODS
32 | public void FillDefaultValues()
33 | {
34 | foreach (string integerV in IntegerSettings)
35 | this.SetValue(integerV, 0);
36 | foreach (string uintegerV in UIntegerSettings)
37 | this.SetValue(uintegerV, 0);
38 | foreach (string floatV in FloatSettings)
39 | this.SetValue(floatV, 0f);
40 | foreach (string keyV in KeySettings)
41 | this.SetValue(keyV, WinAPI.VirtualKeyShort.LBUTTON);
42 | foreach (string booleanV in BooleanSettings)
43 | this.SetValue(booleanV, false);
44 | }
45 | public override void ReadSettings(byte[] data)
46 | {
47 | string text = Encoding.Unicode.GetString(data);
48 |
49 | //Split text into lines
50 | string[] lines = text.Contains("\r\n") ? text.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) : text.Split("\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
51 |
52 | foreach (string line in lines)
53 | {
54 | //Trim current line
55 | string tmpLine = line.Trim();
56 | //Skip invalid ones
57 | if (tmpLine.StartsWith("#")) // comment
58 | continue;
59 | else if (!tmpLine.Contains("=")) // it's no key-value pair!
60 | continue;
61 |
62 | //Trim both parts of the key-value pair
63 | string[] parts = tmpLine.Split('=');
64 | parts[0] = parts[0].Trim();
65 | parts[1] = parts[1].Trim();
66 | if (string.IsNullOrEmpty(parts[0]) || string.IsNullOrEmpty(parts[1]))
67 | continue;
68 | if (parts[1].Contains('#')) //If value-part contains comment, split it
69 | parts[1] = parts[1].Split('#')[0];
70 | InterpretSetting(parts[0], parts[1]);
71 | }
72 | }
73 |
74 | private void InterpretSetting(string name, string value)
75 | {
76 | try
77 | {
78 | if (this.FloatSettings.Contains(name))
79 | this.SetValue(name, Convert.ToSingle(value));
80 | else if (this.IntegerSettings.Contains(name))
81 | this.SetValue(name, Convert.ToInt32(value));
82 | else if (this.UIntegerSettings.Contains(name))
83 | this.SetValue(name, Convert.ToUInt32(value));
84 | else if (this.BooleanSettings.Contains(name))
85 | this.SetValue(name, Convert.ToBoolean(value));
86 | else if (this.KeySettings.Contains(name))
87 | this.SetValue(name, ParseEnum(value));
88 | else
89 | WithOverlay.PrintError("Unknown settings-field \"{0}\" (value: \"{1}\")", name, value);
90 | }
91 | catch(Exception ex)
92 | {
93 | WithOverlay.PrintException(ex);
94 | }
95 | }
96 |
97 | public override byte[] SaveSettings()
98 | {
99 | StringBuilder builder = new StringBuilder();
100 | builder.AppendLine(@"# .____ ____ ____________ ___________ .__ .__ ____. ");
101 | builder.AppendLine(@"# | _| | | \_ ___ \ \_ _____/__ ___ ____ | | __ __ _____|__|__ __ ____ |_ | ");
102 | builder.AppendLine(@"# | | | | / \ \/ ______ | __)_\ \/ // ___\| | | | \/ ___/ \ \/ // __ \ | | ");
103 | builder.AppendLine(@"# | | | | /\ \____ /_____/ | \> <\ \___| |_| | /\___ \| |\ /\ ___/ | | ");
104 | builder.AppendLine(@"# | |_ |______/ \______ / /_______ /__/\_ \\___ >____/____//____ >__| \_/ \___ > _| | ");
105 | builder.AppendLine(@"# |____| \/ puddin tells lies\/ \/ \/ \/ \/ |____| ");
106 | builder.AppendLine(@"# __________ __ /\ _________ _________ ________ ________ _____ .__ __ .__.__ __ ____ ____________ ");
107 | builder.AppendLine(@"# \____ /____ _/ |)/ ______ \_ ___ \ / _____// _____/ \_____ \ / \ __ __| |_/ |_|__| |__ _____ ____ | | __ \ \ / /\_____ \ ");
108 | builder.AppendLine(@"# / /\__ \\ __\/ ___/ / \ \/ \_____ \/ \ ___ / | \ ______ / \ / \| | \ |\ __\ | | \\__ \ _/ ___\| |/ / \ Y / _(__ < ");
109 | builder.AppendLine(@"# / /_ / __ \| | \___ \ \ \____/ \ \_\ \/ | \ /_____/ / Y \ | / |_| | | | Y \/ __ \\ \___| < \ / / \");
110 | builder.AppendLine(@"# /_______ (____ /__| /____ > \______ /_______ /\______ /\_______ / \____|__ /____/|____/__| |__|___| (____ /\___ >__|_ \ \___/ /______ /");
111 | builder.AppendLine(@"# \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ ");
112 | object[] keys = new object[this.GetKeys().Count];
113 | this.GetKeys().CopyTo(keys, 0);
114 | var keysSorted = keys.OrderBy(x => x);
115 | foreach (string key in keysSorted)
116 | {
117 | builder.AppendFormat("{0} = {1}\n", key, this.GetValue(key));
118 | }
119 | return Encoding.Unicode.GetBytes(builder.ToString());
120 | }
121 | #endregion
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/CSGOOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot
8 | {
9 | class CSGOOffsets
10 | {
11 | public class Misc
12 | {
13 | public static int EntityList = 0x00;
14 | public static int LocalPlayer = 0x00;
15 | public static int Jump = 0x00;
16 | public static int GlowManager = 0x00;
17 | public static int SignOnState = 0xE8;
18 | public static int WeaponTable = 0x04A5DC4C;
19 | public static int ViewMatrix = 0x00;
20 | public static int MouseEnable = 0xA7A4C0;
21 | }
22 | public class ClientState
23 | {
24 | public static int Base = 0x00;
25 | public static int m_dwInGame = 0xE8;
26 | public static int m_dwViewAngles = 0x00;
27 | public static int m_dwMapname = 0x26c;
28 | public static int m_dwMapDirectory = 0x168;
29 | }
30 | public class GameResources
31 | {
32 | public static int Base = 0x04A38E2C;
33 | public static int Names = 0x9D0;
34 | public static int Kills = 0xBD8;
35 | public static int Assists = 0xCDC;
36 | public static int Deaths = 0xDE0;
37 | public static int Armor = 0x182C;
38 | public static int Score = 0x192C;
39 | public static int Clantag = 0x4110;
40 | }
41 | public class NetVars
42 | {
43 | public class C_BaseEntity
44 | {
45 | public static int m_iHealth = 0x00;
46 | public static int m_iID = 0x00;
47 | public static int m_iTeamNum = 0x00;
48 | public static int m_vecOrigin = 0x134;
49 | public static int m_angRotation = 0x128;
50 | public static int m_bSpotted = 0x935;
51 | public static int m_bSpottedByMask = 0x978;
52 | public static int m_hOwnerEntity = 0x148;
53 | public static int m_bDormant = 0xE9;
54 | }
55 |
56 | public class C_CSPlayer
57 | {
58 | public static int m_lifeState = 0x25B;
59 | public static int m_hBoneMatrix = 0x00;
60 | public static int m_hActiveWeapon = 0x12C0; // m_hActiveWeapon
61 | public static int m_iFlags = 0x100;
62 | public static int m_hObserverTarget = 0x173C;
63 | public static int m_iObserverMode = 0x1728;
64 | public static int m_vecVelocity = 0x110;
65 | }
66 |
67 | public class LocalPlayer
68 | {
69 | public static int m_vecViewOffset = 0x104;
70 | public static int m_vecPunch = 0x13E8;
71 | public static int m_iShotsFired = 0x1d6C;
72 | public static int m_iCrosshairIdx = 0x2410;
73 | }
74 |
75 | public class Weapon
76 | {
77 | public static int m_iItemDefinitionIndex = 0x131C;
78 | public static int m_iState = 0x15B4;
79 | public static int m_iClip1 = 0x15c0;
80 | public static int m_flNextPrimaryAttack = 0x159C;
81 | public static int m_iWeaponID = 0x1690; // Search for weaponid
82 | public static int m_bCanReload = 0x15F9;
83 | public static int m_iWeaponTableIndex = 0x162C;
84 | public static int m_fAccuracyPenalty = 0x1670;
85 | }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/CSGOSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}
8 | Exe
9 | Properties
10 | CSGOTriggerbot
11 | CSGOTriggerbot
12 | v4.5
13 | 512
14 | 93867c7d
15 |
16 |
17 | x86
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | true
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 | CSGOTriggerbot.WithOverlay
38 |
39 |
40 |
41 | .\ExternalUtilsCSharp.dll
42 |
43 |
44 | .\ExternalUtilsCSharp.SharpDXRenderer.dll
45 |
46 |
47 | .\SharpDX.dll
48 |
49 |
50 | .\SharpDX.Direct2D1.dll
51 |
52 |
53 | .\SharpDX.DXGI.dll
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 | True
85 | True
86 | Resources.resx
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | ResXFileCodeGenerator
102 | Resources.Designer.cs
103 |
104 |
105 |
106 |
113 |
--------------------------------------------------------------------------------
/CSGOSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSGOSample", "CSGOSample.csproj", "{0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {0C392DB2-895E-4F2A-B2A0-1D79849FC5B2}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/CSGOScanner.cs:
--------------------------------------------------------------------------------
1 | using ExternalUtilsCSharp;
2 | using ExternalUtilsCSharp.MemObjects;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace CSGOTriggerbot
11 | {
12 | public static class CSGOScanner
13 | {
14 | static ScanResult scan;
15 |
16 | static ProcessModule clientDll;
17 | static int clientDllBase;
18 | static ProcessModule engineDll;
19 | static int engineDllBase;
20 | public static void ScanOffsets(MemUtils memUtils,ProcessModule client,ProcessModule engine)
21 | {
22 | clientDll = client;
23 | engineDll = engine;
24 | clientDllBase = clientDll.BaseAddress.ToInt32();
25 | engineDllBase = engineDll.BaseAddress.ToInt32();
26 | EntityOff(memUtils);
27 | LocalPlayer(memUtils);
28 | Jump(memUtils);
29 | GameResources(memUtils);
30 | ClientState(memUtils);
31 | SetViewAngles(memUtils);
32 | SignOnState(memUtils);
33 | GlowManager(memUtils);
34 | WeaponTable(memUtils);
35 | EntityID(memUtils);
36 | EntityHealth(memUtils);
37 | EntityVecOrigin(memUtils);
38 | PlayerTeamNum(memUtils);
39 | PlayerBoneMatrix(memUtils);
40 | PlayerWeaponHandle(memUtils);
41 | vMatrix(memUtils);
42 | clientDll = null;
43 | engineDll = null;
44 | clientDllBase = 0;
45 | engineDllBase = 0;
46 | }
47 | #region MISC
48 |
49 | private static void GameResources(MemUtils memUtils)
50 | {
51 | scan = memUtils.PerformSignatureScan(new byte[]{
52 | 0x89, 0x4D, 0xF4, //mov [ebp-0C],ecx
53 | 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, //mov ecx,[engine.dll+xxxx]
54 | 0x53, //push ebx
55 | 0x56, //push esi
56 | 0x57, //push edi
57 | 0x8B, 0x01 }, "xxxxx????xxxxx", engineDll);
58 | if (scan.Success)
59 | {
60 | int address, pointer, offset;
61 | pointer = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 5)) - engineDllBase;
62 |
63 | scan = memUtils.PerformSignatureScan(new byte[] {
64 | 0xCC, //int 3
65 | 0xCC, //int 3
66 | 0x55, //push ebp
67 | 0x8B, 0xEC, //mov ebp,esp
68 | 0x8B, 0x45, 0x08, //mov eax,[ebp+08]
69 | 0x8B, 0x44, 0xC1, 0x00, //mov eax,[acx+eax*8+xx]
70 | 0x5D, //pop ebp
71 | 0xC2, 0x00, 0x00, //ret 0004
72 | 0xCC, //int 3
73 | 0xCC }, "xxxxxxxxxxx?xx??xx", clientDll);
74 | if (scan.Success)
75 | {
76 | offset = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 11));
77 |
78 | address = memUtils.Read((IntPtr)(engineDllBase + pointer));
79 | address = address + 0x46 * 8 + offset;
80 | address -= clientDllBase;
81 | CSGOOffsets.GameResources.Base = address;
82 | }
83 | }
84 | }
85 | static void vMatrix(MemUtils memUtils)
86 | {
87 | scan = memUtils.PerformSignatureScan(new byte[] {
88 | 0x53, 0x8B, 0xDC, 0x83, 0xEC, 0x08, 0x83, 0xE4,
89 | 0xF0, 0x83, 0xC4, 0x04, 0x55, 0x8B, 0x6B, 0x04,
90 | 0x89, 0x6C, 0x24, 0x04, 0x8B, 0xEC, 0xA1, 0x00,
91 | 0x00, 0x00, 0x00, 0x81, 0xEC, 0x98, 0x03, 0x00,
92 | 0x00 }, "xxxxxxxxxxxxxxxxxxxxxxx????xxxxxx", clientDll);
93 | if (scan.Success)
94 | {
95 | int address = memUtils.Read((IntPtr)(scan.Address.ToInt32() + +0x4EE));
96 | address -= clientDllBase;
97 | address += 0x80;
98 | CSGOOffsets.Misc.ViewMatrix = address;
99 | }
100 | }
101 | static void EntityOff(MemUtils memUtils)
102 | {
103 | scan = memUtils.PerformSignatureScan(new byte[] { 0x05, 0x00, 0x00, 0x00, 0x00, 0xC1, 0xe9, 0x00, 0x39, 0x48, 0x04 }, "x????xx?xxx", clientDll);
104 | if (scan.Success)
105 | {
106 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 1));
107 | byte tmp2 = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 7));
108 | CSGOOffsets.Misc.EntityList = tmp + tmp2 - clientDllBase;
109 | }
110 | }
111 | static void LocalPlayer(MemUtils memUtils)
112 | {
113 | scan = memUtils.PerformSignatureScan(new byte[] { 0x8D, 0x34, 0x85, 0x00, 0x00, 0x00, 0x00, 0x89, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x41, 0x08, 0x8B, 0x48 }, "xxx????xx????xxxxx", clientDll);
114 | if (scan.Success)
115 | {
116 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 3));
117 | byte tmp2 = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 18));
118 | CSGOOffsets.Misc.LocalPlayer = tmp + tmp2 - clientDllBase;
119 | }
120 | }
121 | static void Jump(MemUtils memUtils)
122 | {
123 | scan = memUtils.PerformSignatureScan(new byte[] { 0x89, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x15, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xC2, 0x03, 0x74, 0x03, 0x83, 0xCE, 0x08, 0xA8, 0x08, 0xBF }, "xx????xx????xxxxxxxxxxx", clientDll);
124 | if (scan.Success)
125 | {
126 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 2));
127 | CSGOOffsets.Misc.Jump = tmp - clientDllBase;
128 | }
129 | }
130 | static void ClientState(MemUtils memUtils)
131 | {
132 | scan = memUtils.PerformSignatureScan(new byte[] { 0xC2, 0x00, 0x00, 0xCC, 0xCC, 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x33, 0xC0, 0x83, 0xB9 }, "x??xxxx????xxxx", engineDll);
133 | if (scan.Success)
134 | {
135 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 7));
136 | CSGOOffsets.ClientState.Base = tmp - engineDllBase;
137 | }
138 | }
139 | static void SetViewAngles(MemUtils memUtils)
140 | {
141 | scan = memUtils.PerformSignatureScan(new byte[] { 0x8B, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x4D, 0x08, 0x8B, 0x82, 0x00, 0x00, 0x00, 0x00, 0x89, 0x01, 0x8B, 0x82, 0x00, 0x00, 0x00, 0x00, 0x89, 0x41, 0x04 }, "xx????xxxxx????xxxx????xxx", engineDll);
142 | if (scan.Success)
143 | {
144 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 11));
145 | CSGOOffsets.ClientState.m_dwViewAngles = tmp;
146 | }
147 | }
148 | static void SignOnState(MemUtils memUtils)
149 | {
150 | scan = memUtils.PerformSignatureScan(
151 | new byte[] { 0x51, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x51, 0x00, 0x83, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x40, 0x3B, 0xD1 },
152 | "xx????xx?xx?????xxxx", engineDll);
153 | if (scan.Success)
154 | {
155 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 11));
156 | CSGOOffsets.Misc.SignOnState = tmp;
157 | }
158 | }
159 | static void GlowManager(MemUtils memUtils)
160 | {
161 | scan = memUtils.PerformSignatureScan(new byte[] { 0x8D, 0x8F, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x89, 0x35, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x51 }, "xx????x????xxx????xx????xx", clientDll);
162 | if (scan.Success)
163 | {
164 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 7));
165 | CSGOOffsets.Misc.GlowManager = tmp - clientDllBase;
166 | }
167 | }
168 | static void WeaponTable(MemUtils memUtils)
169 | {
170 | scan = memUtils.PerformSignatureScan(new byte[] { 0xA1, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xB7, 0xC9, 0x03, 0xC9, 0x8B, 0x44, 0x00, 0x0C, 0xC3 }, "x????xxxxxxx?xx", clientDll);
171 | if (scan.Success)
172 | {
173 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 1));
174 | CSGOOffsets.Misc.WeaponTable = tmp - clientDllBase;
175 | }
176 | }
177 | #endregion
178 | #region ENTITY
179 | static void EntityID(MemUtils memUtils)
180 | {
181 | scan = memUtils.PerformSignatureScan(
182 | new byte[] { 0x74, 0x72, 0x80, 0x79, 0x00, 0x00, 0x8B, 0x56, 0x00, 0x89, 0x55, 0x00, 0x74, 0x17 },
183 | "xxxx??xx?xx?xx", clientDll);
184 | if (scan.Success)
185 | {
186 | byte tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 8));
187 | CSGOOffsets.NetVars.C_BaseEntity.m_iID = tmp;
188 | }
189 | }
190 | static void EntityHealth(MemUtils memUtils)
191 | {
192 | scan = memUtils.PerformSignatureScan(
193 | new byte[] { 0x8B, 0x41, 0x00, 0x89, 0x41, 0x00, 0x8B, 0x41, 0x00, 0x89, 0x41, 0x00, 0x8B, 0x41, 0x00, 0x89, 0x41, 0x00, 0x8B, 0x4F, 0x00, 0x83, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x2E },
194 | "xx?xx?xx?xx?xx?xx?xx?xx????xxx", clientDll);
195 | if (scan.Success)
196 | {
197 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 23));
198 | CSGOOffsets.NetVars.C_BaseEntity.m_iHealth = tmp;
199 | }
200 | }
201 | static void EntityVecOrigin(MemUtils memUtils)
202 | {
203 | scan = memUtils.PerformSignatureScan(
204 | new byte[] { 0x8A, 0x0E, 0x80, 0xE1, 0xFC, 0x0A, 0xC8, 0x88, 0x0E, 0xF3, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x00, 0x9F },
205 | "xxxxxxxxxx??x??????x????x", clientDll);
206 | if (scan.Success)
207 | {
208 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 13));
209 | CSGOOffsets.NetVars.C_BaseEntity.m_vecOrigin = tmp;
210 | }
211 | }
212 | #endregion
213 | #region PLAYER
214 | static void PlayerTeamNum(MemUtils memUtils)
215 | {
216 | scan = memUtils.PerformSignatureScan(
217 | new byte[] { 0xCC, 0xCC, 0xCC, 0x8B, 0x89, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8B, 0x81, 0x00, 0x00, 0x00, 0x00, 0xC3, 0xCC, 0xCC },
218 | "xxxxx????x????xxxxxxx????xxx", clientDll);
219 | if (scan.Success)
220 | {
221 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 5));
222 | CSGOOffsets.NetVars.C_BaseEntity.m_iTeamNum = tmp;
223 | }
224 | }
225 | static void PlayerBoneMatrix(MemUtils memUtils)
226 | {
227 | scan = memUtils.PerformSignatureScan(
228 | new byte[] { 0x83, 0x3C, 0xB0, 0xFF, 0x75, 0x15, 0x8B, 0x87, 0x00, 0x00, 0x00, 0x00, 0x8B, 0xCF, 0x8B, 0x17, 0x03, 0x44, 0x24, 0x0C, 0x50 },
229 | "xxxxxxxx????xxxxxxxxx", clientDll);
230 | if (scan.Success)
231 | {
232 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 8));
233 | CSGOOffsets.NetVars.C_CSPlayer.m_hBoneMatrix = tmp;
234 | }
235 | }
236 | static void PlayerWeaponHandle(MemUtils memUtils)
237 | {
238 | scan = memUtils.PerformSignatureScan(
239 | new byte[] { 0x0F, 0x45, 0xF7, 0x5F, 0x8B, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x83, 0xF9, 0xFF },
240 | "xxxxxx????xxxx", clientDll);
241 | if (scan.Success)
242 | {
243 | int tmp = memUtils.Read((IntPtr)(scan.Address.ToInt32() + 6));
244 | CSGOOffsets.NetVars.C_CSPlayer.m_hActiveWeapon = tmp;
245 | }
246 | }
247 | #endregion
248 | }
249 |
250 | }
251 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CSGOTriggerbot")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CSGOTriggerbot")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c303b232-9109-4117-91a9-9cca8d653c1d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.34014
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CSGOTriggerbot.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
17 | ///
18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CSGOTriggerbot.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap uc_exclusive {
67 | get {
68 | object obj = ResourceManager.GetObject("uc_exclusive", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\uc-exclusive.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Closed project; No support
2 | Neither will I develop this project any further nor will I offer any support.
3 |
4 | More info: https://www.unknowncheats.me/forum/counterstrike-global-offensive/152400-zats-csgo-multihack-v3-esp-aim-trigger-rcs-radar-xhair.html
5 |
--------------------------------------------------------------------------------
/Resources/uc-exclusive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BigMo/Zat-s-External-CSGO-Multihack-v3/74ab4990e2bafa2936b81e0de0738ac743e80635/Resources/uc-exclusive.png
--------------------------------------------------------------------------------
/SignOnState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CSGOTriggerbot
8 | {
9 | public enum SignOnState
10 | {
11 | SIGNONSTATE_NONE = 0,
12 | SIGNONSTATE_CHALLENGE = 1,
13 | SIGNONSTATE_CONNECTED = 2,
14 | SIGNONSTATE_NEW = 3,
15 | SIGNONSTATE_PRESPAWN = 4,
16 | SIGNONSTATE_SPAWN = 5,
17 | SIGNONSTATE_FULL = 6,
18 | SIGNONSTATE_CHANGELEVEL = 7
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/UI/PlayerESP.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGO.Enums;
2 | using CSGOTriggerbot.CSGOClasses;
3 | using ExternalUtilsCSharp;
4 | using ExternalUtilsCSharp.SharpDXRenderer;
5 | using ExternalUtilsCSharp.SharpDXRenderer.Controls;
6 | using SharpDX;
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 |
13 | namespace CSGOTriggerbot.UI
14 | {
15 | public class PlayerESP : SharpDXControl
16 | {
17 | public static float MAX_DISTANCE = float.MaxValue;
18 | public static float BORDER_SIZE = 2f;
19 | public static float BORDER_MARGIN = 8f;
20 | public CSPlayer Player { get; set; }
21 | public override void Draw(ExternalUtilsCSharp.SharpDXRenderer.SharpDXRenderer renderer)
22 | {
23 | if (!WithOverlay.ConfigUtils.GetValue("espEnabled"))
24 | return;
25 | Framework fw = WithOverlay.Framework;
26 |
27 | if (!fw.IsPlaying())
28 | return;
29 | if (Player == null || fw.LocalPlayer == null)
30 | return;
31 | if (Player.Address == fw.LocalPlayer.Address)
32 | return;
33 |
34 | float distance = Player.m_vecOrigin.DistanceTo(fw.LocalPlayer.m_vecOrigin);
35 | if (!Player.IsValid() || Player.m_vecOrigin == ExternalUtilsCSharp.MathObjects.Vector3.Zero || distance > MAX_DISTANCE || Player.m_iHealth == 0)
36 | return;
37 |
38 | #region Bones + W2S
39 | ExternalUtilsCSharp.MathObjects.Vector3[] arms = new ExternalUtilsCSharp.MathObjects.Vector3[]
40 | {
41 | Player.Bones.LeftHand,
42 | Player.Bones.LeftElbow,
43 | Player.Bones.LeftShoulder,
44 | Player.Bones.Spine5,
45 | Player.Bones.RightShoulder,
46 | Player.Bones.RightElbow,
47 | Player.Bones.RightHand
48 | };
49 | ExternalUtilsCSharp.MathObjects.Vector3[] legs = new ExternalUtilsCSharp.MathObjects.Vector3[]
50 | {
51 | Player.Bones.LeftFoot,
52 | Player.Bones.LeftKnee,
53 | Player.Bones.LeftHip,
54 | Player.Bones.Spine1,
55 | Player.Bones.RightHip,
56 | Player.Bones.RightKnee,
57 | Player.Bones.RightFoot
58 | };
59 | ExternalUtilsCSharp.MathObjects.Vector3[] spine = new ExternalUtilsCSharp.MathObjects.Vector3[]
60 | {
61 | Player.Bones.Spine1,
62 | Player.Bones.Spine2,
63 | Player.Bones.Spine3,
64 | Player.Bones.Spine4,
65 | Player.Bones.Spine5,
66 | Player.Bones.Neck + new ExternalUtilsCSharp.MathObjects.Vector3(0,0,5)
67 | };
68 | ExternalUtilsCSharp.MathObjects.Vector3[] body = MiscUtils.MergeArrays(arms, legs, spine);
69 |
70 | if (body.Count(x=>x == ExternalUtilsCSharp.MathObjects.Vector3.Zero) > 0)
71 | return;
72 | if (body.Count(x => x.DistanceTo(Player.m_vecOrigin) > 100) > 0)
73 | return;
74 |
75 | Vector2[] w2sArms = W2S(arms);
76 | Vector2[] w2sLegs = W2S(legs);
77 | Vector2[] w2sSpine = W2S(spine);
78 |
79 | Vector2[] w2sBody = MiscUtils.MergeArrays(w2sArms, w2sLegs, w2sSpine);
80 | if (w2sBody.Count(x=>x == Vector2.Zero) > 0)
81 | return;
82 | Vector2 left = w2sBody.First(x => x.X == w2sBody.Min(x2 => x2.X));
83 | Vector2 right = w2sBody.First(x => x.X == w2sBody.Max(x2 => x2.X));
84 | Vector2 upper = w2sBody.First(x => x.Y == w2sBody.Min(x2 => x2.Y));
85 | Vector2 lower = w2sBody.First(x => x.Y == w2sBody.Max(x2 => x2.Y));
86 |
87 | Vector2 outerSize = new Vector2(right.X - left.X + BORDER_MARGIN * 2, lower.Y - upper.Y + BORDER_MARGIN * 2) + Vector2.One * BORDER_SIZE * 2;
88 | Vector2 outerLocation = new Vector2(left.X - BORDER_MARGIN, upper.Y - BORDER_MARGIN) - Vector2.One * BORDER_SIZE;
89 | #endregion
90 |
91 | #region Color
92 | if (this.Player.m_iTeamNum == (int)Team.Terrorists)
93 | this.BackColor = new Color(1f, 0f, 0f, 1f);
94 | else
95 | this.BackColor = new Color(0.5f, 0.8f, 0.9f, 0.9f);
96 | #endregion
97 |
98 | #region Box
99 | if (WithOverlay.ConfigUtils.GetValue("espBox"))
100 | {
101 | renderer.DrawRectangle(this.ForeColor, outerLocation, outerSize, BORDER_SIZE + 2f);
102 | renderer.DrawRectangle(this.BackColor, outerLocation, outerSize, BORDER_SIZE);
103 | }
104 | #endregion
105 |
106 | #region Skeleton
107 | if (WithOverlay.ConfigUtils.GetValue("espSkeleton"))
108 | {
109 | renderer.DrawLines(this.ForeColor, 3f, w2sArms);
110 | renderer.DrawLines(this.ForeColor, 3f, w2sLegs);
111 | renderer.DrawLines(this.ForeColor, 3f, w2sSpine);
112 | renderer.DrawLines(this.BackColor, w2sArms);
113 | renderer.DrawLines(this.BackColor, w2sLegs);
114 | renderer.DrawLines(this.BackColor, w2sSpine);
115 | }
116 | #endregion
117 |
118 | #region Name + Stats
119 | string name = string.Format("{0} [{1}/{2}]", fw.Names[Player.m_iID], fw.Kills[Player.m_iID], fw.Deaths[Player.m_iID]);
120 | Vector2 nameSize = renderer.MeasureString(name, this.Font);
121 | Vector2 nameBoxSize = new Vector2((float)Math.Max(outerSize.X, nameSize.X), nameSize.Y);
122 | Vector2 nameBoxLocation = outerLocation - Vector2.UnitY * (BORDER_SIZE + 2f) - Vector2.UnitY * nameSize.Y + Vector2.UnitX * (outerSize.X/2f - nameBoxSize.X/2f);
123 | Vector2 nameLocation = nameBoxLocation + Vector2.UnitX * (nameBoxSize.X / 2f - nameSize.X / 2f);
124 |
125 | if (WithOverlay.ConfigUtils.GetValue("espName"))
126 | {
127 | renderer.FillRectangle(this.BackColor, nameBoxLocation, nameBoxSize);
128 | renderer.DrawRectangle(this.ForeColor, nameBoxLocation, nameBoxSize);
129 |
130 | renderer.DrawText(name, this.ForeColor, this.Font, nameLocation);
131 | }
132 | #endregion
133 |
134 | #region Health
135 | Vector2 hpLocation = outerLocation + (Vector2.UnitX * outerSize.X) + (Vector2.UnitX * BORDER_MARGIN);
136 | Vector2 hpSize = new Vector2(1, outerSize.Y);
137 | Vector2 hpFillSize = new Vector2(1, hpSize.Y / 100f * (float)(Math.Min(100, Player.m_iHealth)));
138 | Vector2 hpFillLocation = hpLocation + Vector2.UnitY * (hpSize.Y - hpFillSize.Y);
139 |
140 | if (WithOverlay.ConfigUtils.GetValue("espHealth"))
141 | {
142 | renderer.DrawLine(this.ForeColor, hpLocation, hpLocation + hpSize, BORDER_SIZE * 2f + 2f);
143 | renderer.DrawLine(Color.Green, hpFillLocation, hpFillLocation + hpFillSize, BORDER_SIZE * 2f);
144 | }
145 | #endregion
146 | base.Draw(renderer);
147 | }
148 |
149 | private Vector2 W2S(ExternalUtilsCSharp.MathObjects.Vector3 point)
150 | {
151 | ExternalUtilsCSharp.MathObjects.Matrix vMatrix = WithOverlay.Framework.ViewMatrix;
152 | ExternalUtilsCSharp.MathObjects.Vector2 screenSize = new ExternalUtilsCSharp.MathObjects.Vector2(WithOverlay.SHDXOverlay.Width, WithOverlay.SHDXOverlay.Height);
153 |
154 | return SharpDXConverter.Vector2EUCtoSDX(MathUtils.WorldToScreen(vMatrix, screenSize, point));
155 | }
156 |
157 | private Vector2[] W2S(ExternalUtilsCSharp.MathObjects.Vector3[] points)
158 | {
159 | ExternalUtilsCSharp.MathObjects.Matrix vMatrix = WithOverlay.Framework.ViewMatrix;
160 | ExternalUtilsCSharp.MathObjects.Vector2 screenSize = new ExternalUtilsCSharp.MathObjects.Vector2(WithOverlay.SHDXOverlay.Width, WithOverlay.SHDXOverlay.Height);
161 | ExternalUtilsCSharp.MathObjects.Vector3 origin = Player.m_vecOrigin;
162 |
163 | return SharpDXConverter.Vector2EUCtoSDX(MathUtils.WorldToScreen(vMatrix, screenSize, points));
164 | }
165 |
166 | private Color FadeColor(Color color, float amount)
167 | {
168 | return new Color(this.BackColor.R, this.BackColor.G, this.BackColor.B, (byte)(this.BackColor.A * amount));
169 | }
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/UI/PlayerRadar.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGO.Enums;
2 | using CSGOTriggerbot.CSGOClasses;
3 | using ExternalUtilsCSharp.SharpDXRenderer;
4 | using ExternalUtilsCSharp.SharpDXRenderer.Controls;
5 | using SharpDX;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 |
12 | namespace CSGOTriggerbot.UI
13 | {
14 | public class PlayerRadar : SharpDXRadar
15 | {
16 | public override void Update(double secondsElapsed, ExternalUtilsCSharp.KeyUtils keyUtils, SharpDX.Vector2 cursorPoint, bool checkMouse = false)
17 | {
18 | base.Update(secondsElapsed, keyUtils, cursorPoint, checkMouse);
19 | Framework fw = WithOverlay.Framework;
20 | if (fw.LocalPlayer == null)
21 | return;
22 | if (!fw.LocalPlayer.IsValid())
23 | return;
24 |
25 | this.Scaling = WithOverlay.ConfigUtils.GetValue("radarScale");
26 | this.Width = WithOverlay.ConfigUtils.GetValue("radarWidth");
27 | this.Height = WithOverlay.ConfigUtils.GetValue("radarHeight");
28 |
29 | if(fw.LocalPlayer.m_iTeamNum == (int)Team.Terrorists)
30 | {
31 | this.AlliesColor = Color.Red;
32 | this.EnemiesColor = Color.LightBlue;
33 | }
34 | else
35 | {
36 | this.AlliesColor = Color.LightBlue;
37 | this.EnemiesColor = Color.Red;
38 | }
39 |
40 | this.RotationDegrees = fw.ViewAngles.Y + 90;
41 | this.CenterCoordinate = new SharpDX.Vector2(fw.LocalPlayer.m_vecOrigin.X, fw.LocalPlayer.m_vecOrigin.Y);
42 |
43 | if (WithOverlay.ConfigUtils.GetValue("radarEnemies"))
44 | {
45 | var enemies = fw.Players.Where(x => x.Item2.IsValid() && x.Item2.m_iHealth > 0 && x.Item2.m_iTeamNum != fw.LocalPlayer.m_iTeamNum);
46 | this.Enemies = enemies.Select(x => new Vector2(x.Item2.m_vecOrigin.X, x.Item2.m_vecOrigin.Y)).ToArray();
47 | }
48 | else { this.Enemies = null; }
49 |
50 | if (WithOverlay.ConfigUtils.GetValue("radarAllies"))
51 | {
52 | var allies = fw.Players.Where(x => x.Item2.IsValid() && x.Item2.m_iHealth > 0 && x.Item2.m_iTeamNum == fw.LocalPlayer.m_iTeamNum);
53 | this.Allies = allies.Select(x => new Vector2(x.Item2.m_vecOrigin.X, x.Item2.m_vecOrigin.Y)).ToArray();
54 | }
55 | else { this.Allies = null; }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/WithOverlay.cs:
--------------------------------------------------------------------------------
1 | using CSGOTriggerbot.CSGO.Enums;
2 | using CSGOTriggerbot.CSGOClasses;
3 | using CSGOTriggerbot.Properties;
4 | using CSGOTriggerbot.UI;
5 | using ExternalUtilsCSharp;
6 | using ExternalUtilsCSharp.MathObjects;
7 | using ExternalUtilsCSharp.SharpDXRenderer;
8 | using ExternalUtilsCSharp.SharpDXRenderer.Controls;
9 | using ExternalUtilsCSharp.SharpDXRenderer.Controls.Crosshairs;
10 | using ExternalUtilsCSharp.SharpDXRenderer.Controls.Layouts;
11 | using ExternalUtilsCSharp.UI.UIObjects;
12 | using SharpDX.Direct2D1;
13 | using SharpDX.DirectWrite;
14 | using System;
15 | using System.Collections.Generic;
16 | using System.Diagnostics;
17 | using System.IO;
18 | using System.Linq;
19 | using System.Runtime.InteropServices;
20 | using System.Text;
21 | using System.Threading;
22 | using System.Threading.Tasks;
23 | using System.Windows.Forms;
24 |
25 | namespace CSGOTriggerbot
26 | {
27 | public class WithOverlay
28 | {
29 | #region CONSTANTS
30 | private const string GAME_PROCESS = "csgo";
31 | private const string GAME_TITLE = "Counter-Strike: Global Offensive";
32 | #endregion
33 |
34 | #region VARIABLES
35 | public static KeyUtils KeyUtils;
36 | private static IntPtr hWnd;
37 | private static double seconds = 0;
38 | public static Framework Framework;
39 | public static ProcUtils ProcUtils;
40 | public static MemUtils MemUtils;
41 | public static CSGOConfigUtils ConfigUtils;
42 | private static string scrollText = "~~~ [CSGO] Zat's Multihack v3 ~~~ UC-exclusive ~~~ www.unknowncheats.me - Leading the game hacking scene since 2000 ";
43 | private static int scrollIndex = 0;
44 | private static int scrollLength = 32;
45 | #endregion
46 |
47 | #region CONTROLS
48 | public static SharpDXOverlay SHDXOverlay;
49 |
50 | private static SharpDXCursor cursor;
51 | //Menu-window
52 | private static SharpDXWindow windowMenu;
53 | private static SharpDXTabControl tabsMenu;
54 |
55 | private static SharpDXLabel labelHotkeys;
56 | private static SharpDXPanel panelESPContent;
57 | private static SharpDXCheckBox checkBoxESPEnabled;
58 | private static SharpDXCheckBox checkBoxESPBox;
59 | private static SharpDXCheckBox checkBoxESPSkeleton;
60 | private static SharpDXCheckBox checkBoxESPName;
61 | private static SharpDXCheckBox checkBoxESPHealth;
62 | private static SharpDXCheckBox checkBoxESPAllies;
63 | private static SharpDXCheckBox checkBoxESPEnemies;
64 |
65 | private static SharpDXPanel panelAimContent;
66 | private static SharpDXCheckBox checkBoxAimEnabled;
67 | private static SharpDXCheckBox checkBoxAimDrawFov;
68 | private static SharpDXCheckBox checkBoxAimFilterSpotted;
69 | private static SharpDXCheckBox checkBoxAimFilterSpottedBy;
70 | private static SharpDXCheckBox checkBoxAimFilterEnemies;
71 | private static SharpDXCheckBox checkBoxAimFilterAllies;
72 | private static SharpDXRadioButton radioAimToggle;
73 | private static SharpDXRadioButton radioAimHold;
74 | private static SharpDXTrackbar trackBarAimFov;
75 | private static SharpDXCheckBox checkBoxAimSmoothEnaled;
76 | private static SharpDXTrackbar trackBarAimSmoothValue;
77 | private static SharpDXButtonKey keyAimKey;
78 | private static SharpDXComboValue comboValueAimBone;
79 |
80 | private static SharpDXPanel panelRCSContent;
81 | private static SharpDXCheckBox checkBoxRCSEnabled;
82 | private static SharpDXTrackbar trackBarRCSForce;
83 |
84 | private static SharpDXPanel panelTriggerContent;
85 | private static SharpDXCheckBox checkBoxTriggerEnabled;
86 | private static SharpDXCheckBox checkBoxTriggerFilterEnemies;
87 | private static SharpDXCheckBox checkBoxTriggerFilterAllies;
88 | private static SharpDXRadioButton radioTriggerToggle;
89 | private static SharpDXRadioButton radioTriggerHold;
90 | private static SharpDXButtonKey keyTriggerKey;
91 | private static SharpDXTrackbar trackBarTriggerDelayFirstShot;
92 | private static SharpDXTrackbar trackBarTriggerDelayShots;
93 | private static SharpDXCheckBox checkBoxTriggerBurstEnabled;
94 | private static SharpDXCheckBox checkBoxTriggerBurstRandomize;
95 | private static SharpDXTrackbar trackBarTriggerBurstShots;
96 |
97 | private static SharpDXPanel panelRadarContent;
98 | private static SharpDXCheckBox checkBoxRadarEnabled;
99 | private static SharpDXCheckBox checkBoxRadarAllies;
100 | private static SharpDXCheckBox checkBoxRadarEnemies;
101 | private static SharpDXTrackbar trackBarRadarScale;
102 | private static SharpDXTrackbar trackBarRadarWidth;
103 | private static SharpDXTrackbar trackBarRadarHeight;
104 |
105 | private static SharpDXPanel panelCrosshairContent;
106 | private static SharpDXCheckBox checkBoxCrosshairEnabled;
107 | private static SharpDXTrackbar trackBarCrosshairRadius;
108 | private static SharpDXTrackbar trackBarCrosshairWidth;
109 | private static SharpDXTrackbar trackBarCrosshairSpreadScale;
110 | private static SharpDXCheckBox checkBoxCrosshairOutline;
111 | private static SharpDXComboValue comboValueCrosshairType;
112 | private static SharpDXColorControl colorControlCrosshairPrimary;
113 | private static SharpDXColorControl colorControlCrosshairSecondary;
114 |
115 | private static SharpDXPanel panelWindows;
116 | private static SharpDXCheckBox checkBoxGraphsEnabled;
117 | private static SharpDXCheckBox checkBoxSpectatorsEnabled;
118 | private static SharpDXCheckBox checkBoxBotsEnabled;
119 | private static SharpDXCheckBox checkBoxEnemiesEnabled;
120 |
121 | //Performance-window
122 | private static SharpDXWindow windowGraphs;
123 | private static SharpDXGraph graphMemRead;
124 | private static SharpDXGraph graphMemWrite;
125 |
126 | //Spectators-window
127 | private static SharpDXWindow windowSpectators;
128 | private static SharpDXLabel labelSpectators;
129 |
130 | //Aimbot/Triggerbot window
131 | private static SharpDXWindow windowBots;
132 | private static SharpDXLabel labelAimbot;
133 | private static SharpDXLabel labelTriggerbot;
134 |
135 | //Others
136 | private static PlayerRadar ctrlRadar;
137 | private static PlayerESP[] ctrlPlayerESP;
138 | private static Crosshair ctrlCrosshair;
139 | private static SharpDX.Direct2D1.Bitmap ranksBmp;
140 | #endregion
141 |
142 | #region METHODS
143 | public static void Main(string[] args)
144 | {
145 | System.Windows.Forms.Application.EnableVisualStyles();
146 | System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
147 |
148 | PrintSuccess("[>]=-- Zat's CSGO-ESP");
149 | PrintEncolored("[www.unknowncheats.me - Leading the game hacking scene since 2000]", ConsoleColor.Cyan);
150 | Thread scroller = new Thread(new ThreadStart(LoopScroll));
151 | scroller.IsBackground = true;
152 | scroller.Start();
153 | KeyUtils = new KeyUtils();
154 | ConfigUtils = new CSGOConfigUtils();
155 |
156 | //ESP
157 | ConfigUtils.BooleanSettings.AddRange(new string[] {"espEnabled","espBox","espSkeleton", "espName","espHealth", "espAllies", "espEnemies"});
158 | //Aim
159 | ConfigUtils.BooleanSettings.AddRange(new string[] { "aimDrawFov", "aimEnabled", "aimToggle", "aimHold", "aimSmoothEnabled", "aimFilterSpotted", "aimFilterSpottedBy", "aimFilterEnemies", "aimFilterAllies", "aimFilterSpottedBy" });
160 | ConfigUtils.KeySettings.Add("aimKey");
161 | ConfigUtils.FloatSettings.AddRange(new string[] { "aimFov", "aimSmoothValue" });
162 | ConfigUtils.IntegerSettings.Add("aimBone");
163 | //RCS
164 | ConfigUtils.BooleanSettings.Add("rcsEnabled");
165 | ConfigUtils.FloatSettings.Add("rcsForce");
166 | //Trigger
167 | ConfigUtils.BooleanSettings.AddRange(new string[] { "triggerEnabled", "triggerToggle", "triggerHold", "triggerFilterEnemies", "triggerFilterAllies", "triggerBurstEnabled", "triggerBurstRandomize" });
168 | ConfigUtils.KeySettings.Add("triggerKey");
169 | ConfigUtils.FloatSettings.AddRange(new string[] { "triggerDelayFirstShot", "triggerDelayShots", "triggerBurstShots" });
170 | //Radar
171 | ConfigUtils.BooleanSettings.AddRange(new string[] { "radarEnabled", "radarAllies", "radarEnemies" });
172 | ConfigUtils.FloatSettings.AddRange(new string[] { "radarScale", "radarWidth", "radarHeight" });
173 | //Crosshair
174 | ConfigUtils.BooleanSettings.AddRange(new string[] { "crosshairEnabled", "crosshairOutline" });
175 | ConfigUtils.IntegerSettings.AddRange(new string[] { "crosshairType" });
176 | ConfigUtils.UIntegerSettings.AddRange(new string[] { "crosshairPrimaryColor", "crosshairSecondaryColor" });
177 | ConfigUtils.FloatSettings.AddRange(new string[] { "crosshairWidth", "crosshairSpreadScale", "crosshairRadius" });
178 | //Windows
179 | ConfigUtils.BooleanSettings.AddRange(new string[] { "windowSpectatorsEnabled", "windowPerformanceEnabled", "windowBotsEnabled", "windowEnemiesEnabled" });
180 |
181 |
182 | ConfigUtils.FillDefaultValues();
183 |
184 | if (!File.Exists("euc_csgo.cfg"))
185 | ConfigUtils.SaveSettingsToFile("euc_csgo.cfg");
186 | ConfigUtils.ReadSettingsFromFile("euc_csgo.cfg");
187 |
188 | PrintInfo("> Waiting for CSGO to start up...");
189 | while (!ProcUtils.ProcessIsRunning(GAME_PROCESS))
190 | Thread.Sleep(250);
191 |
192 | ProcUtils = new ProcUtils(GAME_PROCESS, WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.VirtualMemoryOperation);
193 | MemUtils = new ExternalUtilsCSharp.MemUtils();
194 | MemUtils.Handle = ProcUtils.Handle;
195 |
196 | PrintInfo("> Waiting for CSGOs window to show up...");
197 | while ((hWnd = WinAPI.FindWindowByCaption(hWnd, GAME_TITLE)) == IntPtr.Zero)
198 | Thread.Sleep(250);
199 |
200 | ProcessModule clientDll, engineDll;
201 | PrintInfo("> Waiting for CSGO to load client.dll...");
202 | while ((clientDll = ProcUtils.GetModuleByName(@"bin\client.dll")) == null)
203 | Thread.Sleep(250);
204 | PrintInfo("> Waiting for CSGO to load engine.dll...");
205 | while ((engineDll = ProcUtils.GetModuleByName(@"engine.dll")) == null)
206 | Thread.Sleep(250);
207 |
208 | Framework = new Framework(clientDll, engineDll);
209 |
210 | PrintInfo("> Initializing overlay");
211 | using (SHDXOverlay = new SharpDXOverlay())
212 | {
213 | SHDXOverlay.Attach(hWnd);
214 | SHDXOverlay.TickEvent += overlay_TickEvent;
215 | SHDXOverlay.BeforeDrawingEvent += SHDXOverlay_BeforeDrawingEvent;
216 | InitializeComponents();
217 | SharpDXRenderer renderer = SHDXOverlay.Renderer;
218 | TextFormat smallFont = renderer.CreateFont("smallFont", "Century Gothic", 10f);
219 | TextFormat largeFont = renderer.CreateFont("largeFont", "Century Gothic", 14f);
220 | TextFormat heavyFont = renderer.CreateFont("heavyFont", "Century Gothic", 14f, FontStyle.Normal, FontWeight.Heavy);
221 |
222 | windowMenu.Font = smallFont;
223 | windowMenu.Caption.Font = largeFont;
224 | windowGraphs.Font = smallFont;
225 | windowGraphs.Caption.Font = largeFont;
226 | windowSpectators.Font = smallFont;
227 | windowSpectators.Caption.Font = largeFont;
228 | windowBots.Font = smallFont;
229 | windowBots.Caption.Font = largeFont;
230 | graphMemRead.Font = smallFont;
231 | graphMemWrite.Font = smallFont;
232 |
233 | for (int i = 0; i < ctrlPlayerESP.Length; i++)
234 | {
235 | ctrlPlayerESP[i].Font = heavyFont;
236 | SHDXOverlay.ChildControls.Add(ctrlPlayerESP[i]);
237 | }
238 | ctrlRadar.Font = smallFont;
239 |
240 | windowMenu.ApplySettings(ConfigUtils);
241 |
242 | SHDXOverlay.ChildControls.Add(ctrlCrosshair);
243 | SHDXOverlay.ChildControls.Add(ctrlRadar);
244 | SHDXOverlay.ChildControls.Add(windowMenu);
245 | SHDXOverlay.ChildControls.Add(windowGraphs);
246 | SHDXOverlay.ChildControls.Add(windowSpectators);
247 | SHDXOverlay.ChildControls.Add(windowBots);
248 | SHDXOverlay.ChildControls.Add(cursor);
249 | PrintInfo("> Running overlay");
250 | System.Windows.Forms.Application.Run(SHDXOverlay);
251 | }
252 | ConfigUtils.SaveSettingsToFile("euc_csgo.cfg");
253 | }
254 |
255 | private static void LoopScroll()
256 | {
257 | scrollText += scrollText;
258 | while(true)
259 | {
260 | scrollIndex++;
261 | scrollIndex %= (scrollText.Length / 2);
262 | Console.Title = string.Format("[ {0} ]", scrollText.Substring(scrollIndex, scrollLength));
263 | Thread.Sleep(150);
264 | }
265 | }
266 |
267 | static void SHDXOverlay_BeforeDrawingEvent(object sender, ExternalUtilsCSharp.UI.Overlay.OverlayEventArgs e)
268 | {
269 | if (ranksBmp == null)
270 | {
271 | System.Drawing.Bitmap bmp = (System.Drawing.Bitmap)Resources.ResourceManager.GetObject("uc_exclusive");
272 | try
273 | {
274 | ranksBmp = SDXBitmapFromSysBitmap(e.Overlay.Renderer.Device, bmp);
275 | }
276 | catch { }
277 | }
278 | else
279 | {
280 | SharpDX.RectangleF source = new SharpDX.RectangleF(0,0,ranksBmp.PixelSize.Width, ranksBmp.PixelSize.Height);
281 |
282 | float mul = 1f + 0.2f * (float)Math.Sin(DateTime.Now.TimeOfDay.TotalSeconds * 0.5f);
283 | SharpDX.RectangleF dest = new SharpDX.RectangleF(e.Overlay.Width / 2f - source.Width / 2f * mul, e.Overlay.Height - source.Height * 2f * mul, source.Width * mul, source.Height * mul);
284 |
285 | e.Overlay.Renderer.Device.DrawBitmap(ranksBmp, dest, 0.9f, BitmapInterpolationMode.Linear, source);
286 | }
287 |
288 | if (ConfigUtils.GetValue("aimEnabled") && ConfigUtils.GetValue("aimDrawFov"))
289 | {
290 | float fov = ConfigUtils.GetValue("aimFov");
291 |
292 | SharpDX.Color foreColor = new SharpDX.Color(0.2f, 0.2f, 0.2f, 0.8f);
293 | SharpDX.Color backColor = new SharpDX.Color(0.8f, 0.8f, 0.8f, 0.9f);
294 | SharpDX.Vector2 size = new SharpDX.Vector2(e.Overlay.Width / 90f * fov);
295 | SharpDX.Vector2 center = new SharpDX.Vector2(e.Overlay.Width / 2f, e.Overlay.Height / 2f);
296 |
297 | e.Overlay.Renderer.DrawEllipse(foreColor, center, size, true, 3f);
298 | e.Overlay.Renderer.DrawEllipse(backColor, center, size, true);
299 | }
300 | }
301 |
302 | private static void overlay_TickEvent(object sender, SharpDXOverlay.DeltaEventArgs e)
303 | {
304 | seconds += e.SecondsElapsed;
305 | //Update logic
306 | KeyUtils.Update();
307 | Framework.Update();
308 | SHDXOverlay.UpdateControls(e.SecondsElapsed, KeyUtils);
309 |
310 | //Process input
311 | if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.DELETE))
312 | SHDXOverlay.Kill();
313 | if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.INSERT))
314 | Framework.MouseEnabled = !Framework.MouseEnabled;
315 | if (KeyUtils.KeyWentUp(WinAPI.VirtualKeyShort.HOME))
316 | windowMenu.Visible = !windowMenu.Visible;
317 |
318 | //Update UI
319 | cursor.Visible = !Framework.MouseEnabled;
320 |
321 | if (seconds >= 1)
322 | {
323 | seconds = 0;
324 | graphMemRead.AddValue(MemUtils.BytesRead);
325 | graphMemWrite.AddValue(MemUtils.BytesWritten);
326 | }
327 |
328 | ctrlRadar.X = SHDXOverlay.Width - ctrlRadar.Width;
329 | ctrlCrosshair.X = SHDXOverlay.Width / 2f;
330 | ctrlCrosshair.Y = SHDXOverlay.Height / 2f;
331 |
332 |
333 | for (int i = 0; i < ctrlPlayerESP.Length; i++)
334 | ctrlPlayerESP[i].Visible = false;
335 |
336 | labelAimbot.Text = string.Format("Aimbot: {0}", Framework.AimbotActive ? "ON" : "OFF");
337 | labelAimbot.ForeColor = Framework.AimbotActive ? SharpDX.Color.Green : windowBots.Caption.ForeColor;
338 | labelTriggerbot.Text = string.Format("Triggerbot: {0}", Framework.TriggerbotActive ? "ON" : "OFF");
339 | labelTriggerbot.ForeColor = Framework.TriggerbotActive ? SharpDX.Color.Green : windowBots.Caption.ForeColor;
340 |
341 | windowGraphs.Visible = ConfigUtils.GetValue("windowPerformanceEnabled");
342 | windowBots.Visible = ConfigUtils.GetValue("windowBotsEnabled");
343 | windowSpectators.Visible = ConfigUtils.GetValue("windowSpectatorsEnabled");
344 | ctrlRadar.Visible = ConfigUtils.GetValue("radarEnabled");
345 | ctrlRadar.Width = ConfigUtils.GetValue("radarWidth");
346 | ctrlRadar.Height = ConfigUtils.GetValue("radarHeight");
347 | if (ctrlCrosshair.PrimaryColor.ToRgba() != colorControlCrosshairPrimary.SDXColor.ToRgba())
348 | ctrlCrosshair.PrimaryColor = colorControlCrosshairPrimary.SDXColor;
349 | if (ctrlCrosshair.SecondaryColor.ToRgba() != colorControlCrosshairSecondary.SDXColor.ToRgba())
350 | ctrlCrosshair.SecondaryColor = colorControlCrosshairSecondary.SDXColor;
351 | ctrlCrosshair.Type = (Crosshair.Types)ConfigUtils.GetValue("crosshairType");
352 | ctrlCrosshair.Visible = ConfigUtils.GetValue("crosshairEnabled");
353 | ctrlCrosshair.Outline = ConfigUtils.GetValue("crosshairOutline");
354 | ctrlCrosshair.Radius = ConfigUtils.GetValue("crosshairRadius");
355 | ctrlCrosshair.Width = ConfigUtils.GetValue("crosshairWidth");
356 | ctrlCrosshair.SpreadScale = ConfigUtils.GetValue("crosshairSpreadScale");
357 |
358 | if (Framework.LocalPlayer != null)
359 | {
360 | Weapon wpn = Framework.LocalPlayer.GetActiveWeapon();
361 | if (wpn != null)
362 | ctrlCrosshair.Spread = wpn.m_fAccuracyPenalty * 10000;
363 | else
364 | ctrlCrosshair.Spread = 1f;
365 | }
366 | else { ctrlCrosshair.Spread = 1f; }
367 | if (Framework.IsPlaying())
368 | {
369 | #region ESP
370 | for (int i = 0; i < ctrlPlayerESP.Length && i < Framework.Players.Length; i++)
371 | {
372 | if (Framework.Players[i].Item2.m_iDormant != 1 &&
373 | (ConfigUtils.GetValue("espEnemies") && Framework.Players[i].Item2.m_iTeamNum != Framework.LocalPlayer.m_iTeamNum) ||
374 | (ConfigUtils.GetValue("espAllies") && Framework.Players[i].Item2.m_iTeamNum == Framework.LocalPlayer.m_iTeamNum))
375 | ctrlPlayerESP[i].Visible = true;
376 | ctrlPlayerESP[i].Player = Framework.Players[i].Item2;
377 | }
378 | #endregion
379 | #region Spectators
380 | if (Framework.LocalPlayer != null)
381 | {
382 | var spectators = Framework.Players.Where(x => x.Item2.m_hObserverTarget == Framework.LocalPlayer.m_iID && x.Item2.m_iHealth == 0 && x.Item2.m_iDormant != 1);
383 | StringBuilder builder = new StringBuilder();
384 | foreach (Tuple spec in spectators)
385 | {
386 | CSPlayer player = spec.Item2;
387 | builder.AppendFormat("{0} [{1}]{2}", Framework.Names[player.m_iID], (SpectatorView)player.m_iObserverMode, builder.Length > 0 ? "\n" : "");
388 | }
389 | if (builder.Length > 0)
390 | labelSpectators.Text = builder.ToString();
391 | else
392 | labelSpectators.Text = "";
393 | }
394 | else
395 | {
396 | labelSpectators.Text = "";
397 | }
398 | #endregion
399 | }
400 | else
401 | {
402 | labelSpectators.Text = "";
403 | //ctrlRadar.Visible = false;
404 | }
405 | }
406 |
407 | private static void InitializeComponents()
408 | {
409 | PrintInfo("> Initializing controls");
410 |
411 | cursor = new SharpDXCursor();
412 |
413 | windowGraphs = new SharpDXWindow();
414 | windowGraphs.Caption.Text = "Performance";
415 |
416 | graphMemRead = new SharpDXGraph();
417 | graphMemRead.DynamicMaximum = true;
418 | graphMemRead.Width = 256;
419 | graphMemRead.Height = 48;
420 | graphMemRead.Text = "RPM data/s";
421 | graphMemWrite = new SharpDXGraph();
422 | graphMemWrite.DynamicMaximum = true;
423 | graphMemWrite.Width = 256;
424 | graphMemWrite.Height = 48;
425 | graphMemWrite.Text = "WPM data/s";
426 |
427 | windowGraphs.Panel.AddChildControl(graphMemRead);
428 | windowGraphs.Panel.AddChildControl(graphMemWrite);
429 |
430 | windowMenu = new SharpDXWindow();
431 | windowMenu.Caption.Text = "[UC|CSGO] Zat's Multihack v3";
432 | windowMenu.X = 500;
433 | windowMenu.Panel.DynamicWidth = true;
434 |
435 | InitLabel(ref labelHotkeys, "[INS] Toggle mouse [HOME] Toggle menu\n[DEL] Terminate hack", false, 150, SharpDXLabel.TextAlignment.Center);
436 |
437 | tabsMenu = new SharpDXTabControl();
438 | tabsMenu.FillParent = false;
439 |
440 | InitPanel(ref panelESPContent, "ESP", false, true, true, false);
441 | panelESPContent.ContentLayout = new TableLayout(2);
442 | InitCheckBox(ref checkBoxESPEnabled, "Enabled", "espEnabled", true);
443 | InitCheckBox(ref checkBoxESPBox, "Draw box", "espBox", false);
444 | InitCheckBox(ref checkBoxESPSkeleton, "Draw skeleton", "espSkeleton", true);
445 | InitCheckBox(ref checkBoxESPName, "Draw name", "espName", false);
446 | InitCheckBox(ref checkBoxESPHealth, "Draw health", "espHealth", true);
447 | InitCheckBox(ref checkBoxESPAllies, "Filter: Draw allies", "espAllies", true);
448 | InitCheckBox(ref checkBoxESPEnemies, "Filter: Draw enemies", "espEnemies", true);
449 |
450 | InitPanel(ref panelAimContent, "Aim", false, true, true, false);
451 | panelAimContent.ContentLayout = TableLayout.TwoColumns;
452 | InitCheckBox(ref checkBoxAimEnabled, "Enabled", "aimEnabled", true);
453 | InitCheckBox(ref checkBoxAimDrawFov, "Draw fov", "aimDrawFov", true);
454 | InitButtonKey(ref keyAimKey, "Key", "aimKey");
455 | InitTrackBar(ref trackBarAimFov, "Aimbot FOV", "aimFov", 1, 180, 20, 0);
456 | InitRadioButton(ref radioAimHold, "Mode: Hold key", "aimHold", true);
457 | InitRadioButton(ref radioAimToggle, "Mode: Toggle", "aimToggle", false);
458 | InitCheckBox(ref checkBoxAimSmoothEnaled, "Smoothing", "aimSmoothEnabled", true);
459 | InitTrackBar(ref trackBarAimSmoothValue, "Smooth-factor", "aimSmoothValue", 0, 1, 0.2f, 4);
460 | InitCheckBox(ref checkBoxAimFilterSpotted, "Filter: Spotted by me", "aimFilterSpotted", false);
461 | InitCheckBox(ref checkBoxAimFilterSpottedBy, "Filter: Spotted me", "aimFilterSpottedBy", false);
462 | InitCheckBox(ref checkBoxAimFilterEnemies, "Filter: Enemies", "aimFilterEnemies", true);
463 | InitCheckBox(ref checkBoxAimFilterAllies, "Filter: Allies", "aimFilterAllies", false);
464 | InitComboValue(ref comboValueAimBone, "Bone", "aimBone", new Tuple("Neck", 10), new Tuple("Chest", 4), new Tuple("Hips", 1));
465 |
466 | InitPanel(ref panelRCSContent, "RCS", false, true, true, false);
467 | InitCheckBox(ref checkBoxRCSEnabled, "Enabled", "rcsEnabled", true);
468 | InitTrackBar(ref trackBarRCSForce, "Force (%)", "rcsForce", 1, 100, 100, 2);
469 |
470 | InitPanel(ref panelTriggerContent, "Trigger", false, true, true, false);
471 | panelTriggerContent.ContentLayout = TableLayout.TwoColumns;
472 | InitCheckBox(ref checkBoxTriggerEnabled, "Enabled", "triggerEnabled", true);
473 | InitButtonKey(ref keyTriggerKey, "Key", "triggerKey");
474 | InitTrackBar(ref trackBarTriggerDelayFirstShot, "Delay (ms, first shot)", "triggerDelayFirstShot", 1, 1000, 30, 0);
475 | InitTrackBar(ref trackBarTriggerDelayShots, "Delay (ms)", "triggerDelayShots", 1, 1000, 30, 0);
476 | InitRadioButton(ref radioTriggerHold, "Mode: Hold key", "triggerHold", true);
477 | InitRadioButton(ref radioTriggerToggle, "Mode: Toggle", "triggerToggle", false);
478 | InitCheckBox(ref checkBoxTriggerFilterEnemies, "Filter: Enemies", "triggerFilterEnemies", true);
479 | InitCheckBox(ref checkBoxTriggerFilterAllies, "Filter: Allies", "triggerFilterAllies", false);
480 | InitCheckBox(ref checkBoxTriggerBurstEnabled, "Burst enabled", "triggerBurstEnabled", true);
481 | InitCheckBox(ref checkBoxTriggerBurstRandomize, "Burst randomization", "triggerBurstRandomize", true);
482 | InitTrackBar(ref trackBarTriggerBurstShots, "No. of burst-fire shots", "triggerBurstShots", 1, 10, 3, 0);
483 |
484 | InitPanel(ref panelRadarContent, "Radar", false, true, true, false);
485 | panelRadarContent.ContentLayout = TableLayout.ThreeColumns;
486 | InitCheckBox(ref checkBoxRadarEnabled, "Enabled", "radarEnabled", true);
487 | InitCheckBox(ref checkBoxRadarAllies, "Filter: Draw allies", "radarAllies", true);
488 | InitCheckBox(ref checkBoxRadarEnemies, "Filter: Draw enemies", "radarEnemies", true);
489 | InitTrackBar(ref trackBarRadarScale, "Scale", "radarScale", 0, 0.25f, 0.02f, 4);
490 | InitTrackBar(ref trackBarRadarWidth, "Width (px)", "radarWidth", 16, 1024, 256, 0);
491 | InitTrackBar(ref trackBarRadarHeight, "Height (px)", "radarHeight", 16, 1024, 256, 0);
492 |
493 | InitPanel(ref panelCrosshairContent, "Crosshair", false, true, true, false);
494 | panelCrosshairContent.ContentLayout = TableLayout.TwoColumns;
495 | InitCheckBox(ref checkBoxCrosshairEnabled, "Enabled", "crosshairEnabled", true);
496 | InitTrackBar(ref trackBarCrosshairRadius, "Radius (px)", "crosshairRadius", 1, 128, 16f, 1);
497 | InitTrackBar(ref trackBarCrosshairWidth, "Width (px)", "crosshairWidth", 0.1f, 32f, 1f, 1);
498 | InitTrackBar(ref trackBarCrosshairSpreadScale, "Spread-scale", "crosshairSpreadScale", 0.01f, 1f, 1f, 2);
499 | InitCheckBox(ref checkBoxCrosshairOutline, "Outline", "crosshairOutline", true);
500 | InitComboValue(ref comboValueCrosshairType, "Type", "crosshairType",
501 | new Tuple("Default", 0),
502 | new Tuple("Default tilted", 1),
503 | new Tuple("Rectangle", 2),
504 | new Tuple("Rectangle tilted", 3),
505 | new Tuple("Circle", 4));
506 | InitColorControl(ref colorControlCrosshairPrimary, "Primary color", "crosshairPrimaryColor", new Color(255, 255, 255, 255));
507 | InitColorControl(ref colorControlCrosshairSecondary, "Secondary color", "crosshairSecondaryColor", new Color(255, 255, 255, 255));
508 |
509 |
510 | InitPanel(ref panelWindows, "Windows", true, true, true, true);
511 | InitCheckBox(ref checkBoxGraphsEnabled, "Performance-window enabled", "windowPerformanceEnabled", true);
512 | InitCheckBox(ref checkBoxSpectatorsEnabled, "Spectators-window enabled", "windowSpectatorsEnabled", true);
513 | InitCheckBox(ref checkBoxBotsEnabled, "Bots-window enabled", "windowBotsEnabled", true);
514 | InitCheckBox(ref checkBoxEnemiesEnabled, "Enemies-info enaled", "windowEnemiesEnabled", true);
515 |
516 | tabsMenu.AddChildControl(panelAimContent);
517 | tabsMenu.AddChildControl(panelESPContent);
518 | tabsMenu.AddChildControl(panelRadarContent);
519 | tabsMenu.AddChildControl(panelRCSContent);
520 | tabsMenu.AddChildControl(panelTriggerContent);
521 | tabsMenu.AddChildControl(panelCrosshairContent);
522 | tabsMenu.AddChildControl(panelWindows);
523 | windowMenu.Panel.AddChildControl(labelHotkeys);
524 | windowMenu.Panel.AddChildControl(tabsMenu);
525 |
526 | panelESPContent.AddChildControl(checkBoxESPEnabled);
527 | panelESPContent.AddChildControl(checkBoxESPBox);
528 | panelESPContent.AddChildControl(checkBoxESPSkeleton);
529 | panelESPContent.AddChildControl(checkBoxESPName);
530 | panelESPContent.AddChildControl(checkBoxESPHealth);
531 | panelESPContent.AddChildControl(checkBoxESPAllies);
532 | panelESPContent.AddChildControl(checkBoxESPEnemies);
533 |
534 | panelAimContent.AddChildControl(checkBoxAimEnabled);
535 | panelAimContent.AddChildControl(checkBoxAimSmoothEnaled);
536 | panelAimContent.AddChildControl(trackBarAimFov);
537 | panelAimContent.AddChildControl(trackBarAimSmoothValue);
538 | panelAimContent.AddChildControl(radioAimHold);
539 | panelAimContent.AddChildControl(radioAimToggle);
540 | panelAimContent.AddChildControl(checkBoxAimFilterSpotted);
541 | panelAimContent.AddChildControl(checkBoxAimFilterSpottedBy);
542 | panelAimContent.AddChildControl(checkBoxAimFilterEnemies);
543 | panelAimContent.AddChildControl(checkBoxAimFilterAllies);
544 | panelAimContent.AddChildControl(checkBoxAimDrawFov);
545 | panelAimContent.AddChildControl(comboValueAimBone);
546 |
547 | panelAimContent.AddChildControl(keyAimKey);
548 |
549 | panelRCSContent.AddChildControl(checkBoxRCSEnabled);
550 | panelRCSContent.AddChildControl(trackBarRCSForce);
551 |
552 | panelTriggerContent.AddChildControl(checkBoxTriggerEnabled);
553 | panelTriggerContent.AddChildControl(keyTriggerKey);
554 | panelTriggerContent.AddChildControl(trackBarTriggerDelayFirstShot);
555 | panelTriggerContent.AddChildControl(trackBarTriggerDelayShots);
556 | panelTriggerContent.AddChildControl(radioTriggerHold);
557 | panelTriggerContent.AddChildControl(radioTriggerToggle);
558 | panelTriggerContent.AddChildControl(checkBoxTriggerFilterEnemies);
559 | panelTriggerContent.AddChildControl(checkBoxTriggerFilterAllies);
560 | panelTriggerContent.AddChildControl(checkBoxTriggerBurstEnabled);
561 | panelTriggerContent.AddChildControl(checkBoxTriggerBurstRandomize);
562 | panelTriggerContent.AddChildControl(trackBarTriggerBurstShots);
563 |
564 | panelRadarContent.AddChildControl(checkBoxRadarEnabled);
565 | panelRadarContent.AddChildControl(checkBoxRadarAllies);
566 | panelRadarContent.AddChildControl(checkBoxRadarEnemies);
567 | panelRadarContent.AddChildControl(trackBarRadarScale);
568 | panelRadarContent.AddChildControl(trackBarRadarWidth);
569 | panelRadarContent.AddChildControl(trackBarRadarHeight);
570 |
571 | panelCrosshairContent.AddChildControl(checkBoxCrosshairEnabled);
572 | panelCrosshairContent.AddChildControl(checkBoxCrosshairOutline);
573 | panelCrosshairContent.AddChildControl(trackBarCrosshairRadius);
574 | panelCrosshairContent.AddChildControl(trackBarCrosshairWidth);
575 | panelCrosshairContent.AddChildControl(trackBarCrosshairSpreadScale);
576 | panelCrosshairContent.AddChildControl(comboValueCrosshairType);
577 | panelCrosshairContent.AddChildControl(colorControlCrosshairPrimary);
578 | panelCrosshairContent.AddChildControl(colorControlCrosshairSecondary);
579 |
580 | panelWindows.AddChildControl(checkBoxGraphsEnabled);
581 | panelWindows.AddChildControl(checkBoxSpectatorsEnabled);
582 | panelWindows.AddChildControl(checkBoxBotsEnabled);
583 | panelWindows.AddChildControl(checkBoxEnemiesEnabled);
584 |
585 | windowSpectators = new SharpDXWindow();
586 | windowSpectators.Caption.Text = "Spectators";
587 | windowSpectators.Y = 500;
588 | InitLabel(ref labelSpectators, "", false, 200f, SharpDXLabel.TextAlignment.Left);
589 | windowSpectators.Panel.AddChildControl(labelSpectators);
590 |
591 | windowBots = new SharpDXWindow();
592 | windowBots.Caption.Text = "Bot-status";
593 | windowBots.Y = 300;
594 | InitLabel(ref labelAimbot, "Aimbot: -", false, 200f, SharpDXLabel.TextAlignment.Left);
595 | InitLabel(ref labelTriggerbot, "Triggerbot: -", false, 200f, SharpDXLabel.TextAlignment.Left);
596 | windowBots.Panel.AddChildControl(labelAimbot);
597 | windowBots.Panel.AddChildControl(labelTriggerbot);
598 |
599 | ctrlRadar = new PlayerRadar();
600 | ctrlRadar.Width = 128;
601 | ctrlRadar.Height = 128;
602 | ctrlRadar.Scaling = 0.02f;
603 | ctrlRadar.DotRadius = 2f;
604 | ctrlRadar.Rotating = true;
605 |
606 | ctrlPlayerESP = new PlayerESP[64];
607 | for (int i = 0; i < ctrlPlayerESP.Length;i++)
608 | {
609 | ctrlPlayerESP[i] = new PlayerESP();
610 | ctrlPlayerESP[i].Visible = false;
611 | }
612 |
613 | ctrlCrosshair = new Crosshair();
614 | ctrlCrosshair.Radius = 16f;
615 | ctrlCrosshair.Width = 2f;
616 | }
617 |
618 | static void checkBox_CheckedChanged(object sender, EventArgs e)
619 | {
620 | SharpDXCheckBox control = (SharpDXCheckBox)sender;
621 | ConfigUtils.SetValue(control.Tag.ToString(), control.Checked);
622 | }
623 | private static void radioButton_CheckedChanged(object sender, EventArgs e)
624 | {
625 | SharpDXRadioButton control = (SharpDXRadioButton)sender;
626 | ConfigUtils.SetValue(control.Tag.ToString(), control.Checked);
627 | }
628 | private static void trackBar_ValueChangedEvent(object sender, EventArgs e)
629 | {
630 | SharpDXTrackbar control = (SharpDXTrackbar)sender;
631 | ConfigUtils.SetValue(control.Tag.ToString(), control.Value);
632 | }
633 | static void buttonKey_KeyChangedEvent(object sender, EventArgs e)
634 | {
635 | SharpDXButtonKey control = (SharpDXButtonKey)sender;
636 | ConfigUtils.SetValue(control.Tag.ToString(), control.Key);
637 | }
638 | static void button_MouseClickEventUp(object sender, ExternalUtilsCSharp.UI.Control.MouseEventArgs e)
639 | {
640 | if (!e.LeftButton)
641 | return;
642 | SharpDXPanel panel = (SharpDXPanel)((SharpDXButton)sender).Tag;
643 | panel.Visible = !panel.Visible;
644 | }
645 |
646 | private static void comboValue_SelectedIndexChangedEvent(object sender, SharpDXComboValue.ComboValueEventArgs e)
647 | {
648 | ConfigUtils.SetValue(e.Tag.ToString(), e.Value);
649 | }
650 |
651 | static void control_ColorChangedEvent(object sender, EventArgs e)
652 | {
653 | SharpDXColorControl control = (SharpDXColorControl)sender;
654 | ConfigUtils.SetValue(control.Tag.ToString(), control.Color.ToRGBA());
655 | }
656 | #endregion
657 |
658 | #region HELPERS
659 | private static SharpDX.Direct2D1.Bitmap SDXBitmapFromSysBitmap(SharpDX.Direct2D1.WindowRenderTarget device, System.Drawing.Bitmap bitmap)
660 | {
661 | var sourceArea = new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height);
662 | var bitmapProperties = new BitmapProperties(new PixelFormat(SharpDX.DXGI.Format.R8G8B8A8_UNorm, AlphaMode.Premultiplied));
663 | var size = new SharpDX.Size2(bitmap.Width, bitmap.Height);
664 |
665 | // Transform pixels from BGRA to RGBA
666 | int stride = bitmap.Width * sizeof(int);
667 | using (var tempStream = new SharpDX.DataStream(bitmap.Height * stride, true, true))
668 | {
669 | // Lock System.Drawing.Bitmap
670 | var bitmapData = bitmap.LockBits(sourceArea, System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
671 |
672 | // Convert all pixels
673 | for (int y = 0; y < bitmap.Height; y++)
674 | {
675 | int offset = bitmapData.Stride * y;
676 | for (int x = 0; x < bitmap.Width; x++)
677 | {
678 | // Not optimized
679 | byte B = Marshal.ReadByte(bitmapData.Scan0, offset++);
680 | byte G = Marshal.ReadByte(bitmapData.Scan0, offset++);
681 | byte R = Marshal.ReadByte(bitmapData.Scan0, offset++);
682 | byte A = Marshal.ReadByte(bitmapData.Scan0, offset++);
683 | int rgba = R | (G << 8) | (B << 16) | (A << 24);
684 | tempStream.Write(rgba);
685 | }
686 |
687 | }
688 | bitmap.UnlockBits(bitmapData);
689 | tempStream.Position = 0;
690 |
691 | return new SharpDX.Direct2D1.Bitmap(device, size, tempStream, stride, bitmapProperties);
692 | }
693 | }
694 | private static void InitColorControl(ref SharpDXColorControl control, string text, object tag, Color color)
695 | {
696 | control = new SharpDXColorControl();
697 | control.Text = text;
698 | control.Tag = tag;
699 | control.Color = color;
700 | control.ColorChangedEvent += control_ColorChangedEvent;
701 | }
702 |
703 | private static void InitComboValue(ref SharpDXComboValue control, string text, object tag, params Tuple[] values)
704 | {
705 | control = new SharpDXComboValue();
706 | control.Text = text;
707 | control.Tag = tag;
708 | control.Values = values;
709 | control.SelectedIndexChangedEvent += comboValue_SelectedIndexChangedEvent;
710 | }
711 | private static void InitButtonKey(ref SharpDXButtonKey control, string text, object tag)
712 | {
713 | control = new SharpDXButtonKey();
714 | control.Text = text;
715 | control.Tag = tag;
716 | control.KeyChangedEvent += buttonKey_KeyChangedEvent;
717 | }
718 | private static void InitPanel(ref SharpDXPanel control, string text, bool dynamicWidth = true, bool dynamicHeight = true, bool fillParent = true, bool visible = true)
719 | {
720 | control = new SharpDXPanel();
721 | control.Text = text;
722 | control.DynamicHeight = dynamicHeight;
723 | control.DynamicWidth = dynamicWidth;
724 | control.FillParent = fillParent;
725 | control.Visible = visible;
726 | }
727 | private static void InitToggleButton(ref SharpDXButton control, string text, SharpDXPanel tag)
728 | {
729 | control = new SharpDXButton();
730 | control.Text = text;
731 | control.Tag = tag;
732 | control.MouseClickEventUp += button_MouseClickEventUp;
733 | }
734 | private static void InitTrackBar(ref SharpDXTrackbar control, string text, object tag, float min =0, float max = 100, float value = 50, int numberofdecimals = 2)
735 | {
736 | control = new SharpDXTrackbar();
737 | control.Text = text;
738 | control.Tag = tag;
739 | control.Minimum = min;
740 | control.Maximum = max;
741 | control.Value = value;
742 | control.NumberOfDecimals = numberofdecimals;
743 | control.ValueChangedEvent += trackBar_ValueChangedEvent;
744 | }
745 |
746 | private static void InitRadioButton(ref SharpDXRadioButton control, string text, object tag, bool bChecked)
747 | {
748 | control = new SharpDXRadioButton();
749 | control.Text = text;
750 | control.Tag = tag;
751 | control.Checked = bChecked;
752 | control.CheckedChangedEvent += radioButton_CheckedChanged;
753 | }
754 | private static void InitLabel(ref SharpDXLabel control, string text, bool fixedWidth = false, float width = 0f, SharpDXLabel.TextAlignment alignment = SharpDXLabel.TextAlignment.Left)
755 | {
756 | control = new SharpDXLabel();
757 | control.FixedWidth = fixedWidth;
758 | control.Width = width;
759 | control.TextAlign = alignment;
760 | control.Text = text;
761 | control.Tag = null;
762 | }
763 | private static void InitCheckBox(ref SharpDXCheckBox control, string text, object tag, bool bChecked)
764 | {
765 | control = new SharpDXCheckBox();
766 | control.Text = text;
767 | control.Tag = tag;
768 | control.Checked = bChecked;
769 | control.CheckedChangedEvent += checkBox_CheckedChanged;
770 | }
771 | public static void PrintInfo(string text, params object[] arguments)
772 | {
773 | PrintEncolored(text, ConsoleColor.White, arguments);
774 | }
775 | public static void PrintSuccess(string text, params object[] arguments)
776 | {
777 | PrintEncolored(text, ConsoleColor.Green, arguments);
778 | }
779 | public static void PrintError(string text, params object[] arguments)
780 | {
781 | PrintEncolored(text, ConsoleColor.Red, arguments);
782 | }
783 | public static void PrintException(Exception ex)
784 | {
785 | PrintError("An Exception occured: {0}\n\"{1}\"\n{2}", ex.GetType().Name, ex.Message, ex.StackTrace);
786 | }
787 | public static void PrintEncolored(string text, ConsoleColor color, params object[] arguments)
788 | {
789 | ConsoleColor clr = Console.ForegroundColor;
790 | Console.ForegroundColor = color;
791 | Console.WriteLine(text, arguments);
792 | Console.ForegroundColor = clr;
793 | }
794 | #endregion
795 | }
796 | }
797 |
--------------------------------------------------------------------------------