├── LICENSE ├── README.md ├── kuchima.sln └── kuchima ├── App.config ├── CSGO.cs ├── Hacks └── ESP.cs ├── Memory.cs ├── Native.cs ├── Offsets.cs ├── Program.cs ├── Properties └── AssemblyInfo.cs ├── kuchima.csproj └── packages.config /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 awawr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # external-csgo-esp 2 | 3 | Simple external CSGO ESP/wallhack. Uses overlay and `SetWindowDisplayAffinity` to exclude from screen capture/OBS. 4 | 5 | Offsets are automatically retrieved at runtime from the [hazedumper](https://github.com/frk1/hazedumper) repository. 6 | 7 | ![image](https://github.com/awawr/external-csgo-esp/assets/128203465/0c70bb23-78c8-4111-9a89-143832155f89) 8 | -------------------------------------------------------------------------------- /kuchima.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32210.238 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kuchima", "kuchima\kuchima.csproj", "{27EA7EB1-630B-4965-9249-2AB1E0F1C83A}" 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 | {27EA7EB1-630B-4965-9249-2AB1E0F1C83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {27EA7EB1-630B-4965-9249-2AB1E0F1C83A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {27EA7EB1-630B-4965-9249-2AB1E0F1C83A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {27EA7EB1-630B-4965-9249-2AB1E0F1C83A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EB7CD1C7-46E3-439D-A451-D141523418FC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /kuchima/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /kuchima/CSGO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Collections.Generic; 4 | using GameMath; 5 | 6 | using static kuchima.Offsets; 7 | 8 | namespace kuchima 9 | { 10 | public class CSGO 11 | { 12 | public static Memory memory; 13 | public static IntPtr client; 14 | public static IntPtr engine; 15 | 16 | public static bool Load() 17 | { 18 | Process[] procs = Process.GetProcessesByName("csgo"); 19 | if (procs.Length < 1) return false; 20 | memory = new Memory(procs[0]); 21 | client = memory.GetModuleBaseAddress("client.dll"); 22 | engine = memory.GetModuleBaseAddress("engine.dll"); 23 | if (client == IntPtr.Zero || engine == IntPtr.Zero) return false; 24 | return true; 25 | } 26 | 27 | public static IntPtr GetClientState() => memory.Read(engine + (int)hazedumper.signatures.dwClientState); 28 | public static IntPtr GetLocalPlayer() => memory.Read(client + (int)hazedumper.signatures.dwLocalPlayer); 29 | public static int GetTeamId(IntPtr entity) => memory.Read(entity + (int)hazedumper.netvars.m_iTeamNum); 30 | public static IntPtr GetEntity(int idx) => memory.Read(client + (int)hazedumper.signatures.dwEntityList + idx * 0x10); 31 | public static int GetHealth(IntPtr entity) => memory.Read(entity + (int)hazedumper.netvars.m_iHealth); 32 | public static Matrix4x4 GetViewMatrix() => memory.Read(client + (int)hazedumper.signatures.dwViewMatrix); 33 | public static bool IsInGame() => memory.Read(GetClientState() + (int)hazedumper.signatures.dwClientState_State) == 6; 34 | public static bool IsDormant(IntPtr entity) => memory.Read(entity + (int)hazedumper.signatures.m_bDormant); 35 | 36 | public static IntPtr[] GetEntityList(IntPtr localplayer) 37 | { 38 | int maxPlayers = memory.Read(GetClientState() + (int)hazedumper.signatures.dwClientState_MaxPlayer); 39 | List entities = new(); 40 | for (int i = 0; i < maxPlayers; i++) 41 | { 42 | IntPtr ent = GetEntity(i); 43 | if (ent != localplayer) 44 | { 45 | entities.Add(ent); 46 | } 47 | } 48 | return entities.ToArray(); 49 | } 50 | 51 | public static bool IsVisible(IntPtr entity) 52 | { 53 | int localPlayer = memory.Read(GetClientState() + (int)hazedumper.signatures.dwClientState_GetLocalPlayer); 54 | int spotted = memory.Read(entity + (int)hazedumper.netvars.m_bSpottedByMask); 55 | return Convert.ToBoolean(spotted & (1 << localPlayer)); 56 | } 57 | 58 | public static Vector3 GetBonePos(IntPtr entity, int bone) 59 | { 60 | IntPtr pointer = memory.Read(entity + (int)hazedumper.netvars.m_dwBoneMatrix); 61 | Matrix3x4 boneMatrix = memory.Read(pointer + 0x30 * bone); 62 | return new Vector3(boneMatrix.M14, boneMatrix.M24, boneMatrix.M34); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /kuchima/Hacks/ESP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GameMath; 3 | using GameOverlay.Drawing; 4 | using GameOverlay.Windows; 5 | 6 | using static kuchima.Native; 7 | 8 | namespace kuchima.Hacks 9 | { 10 | public class ESP 11 | { 12 | private static StickyWindow overlay; 13 | public static void StartThread() 14 | { 15 | var graphics = new Graphics(); 16 | graphics.WindowHandle = IntPtr.Zero; 17 | graphics.VSync = false; 18 | graphics.PerPrimitiveAntiAliasing = false; 19 | graphics.UseMultiThreadedFactories = false; 20 | 21 | overlay = new StickyWindow(CSGO.memory.proc.MainWindowHandle, graphics); 22 | overlay.IsTopmost = true; 23 | overlay.IsVisible = true; 24 | overlay.FPS = 60; 25 | overlay.Title = "kuchima Overlay"; 26 | overlay.DrawGraphics += DrawGraphics; 27 | overlay.Create(); 28 | 29 | SetWindowDisplayAffinity(overlay.Handle, 0x11); 30 | } 31 | 32 | private static void DrawGraphics(object sender, DrawGraphicsEventArgs e) 33 | { 34 | e.Graphics.ClearScene(); 35 | IntPtr focusedWindow = GetForegroundWindow(); 36 | if (focusedWindow == CSGO.memory.proc.MainWindowHandle && CSGO.IsInGame()) 37 | { 38 | IntPtr localPlayer = CSGO.GetLocalPlayer(); 39 | int localTeam = CSGO.GetTeamId(localPlayer); 40 | 41 | IntPtr[] entities = CSGO.GetEntityList(localPlayer); 42 | foreach (IntPtr entity in entities) 43 | { 44 | int entityTeam = CSGO.GetTeamId(entity); 45 | if (CSGO.GetHealth(entity) > 0 && !CSGO.IsDormant(entity)) 46 | { 47 | if (entityTeam != localTeam) 48 | { 49 | Matrix4x4 viewmatrix = CSGO.GetViewMatrix(); 50 | Vector3 topPlayerPos = CSGO.GetBonePos(entity, 8); 51 | Vector3 bottomPlayerPos = CSGO.GetBonePos(entity, 1); 52 | topPlayerPos = new Vector3(topPlayerPos.X, topPlayerPos.Y, topPlayerPos.Z + 10); 53 | 54 | Vector2 top2dpos = Math3.WorldToScreen(viewmatrix, topPlayerPos, overlay.Width, overlay.Height); 55 | Vector2 bottom2dpos = Math3.WorldToScreen(viewmatrix, bottomPlayerPos, overlay.Width, overlay.Height); 56 | 57 | float height = bottom2dpos.Y - top2dpos.Y; 58 | float width = (height / 2) * 1.2f; 59 | float x = bottom2dpos.X - (width / 2); 60 | float y = top2dpos.Y; 61 | 62 | SolidBrush defaultBrush = e.Graphics.CreateSolidBrush(138, 43, 226); 63 | SolidBrush visibleBrush = e.Graphics.CreateSolidBrush(255, 255, 0); 64 | SolidBrush fill = e.Graphics.CreateSolidBrush(0, 0, 0, 65); 65 | 66 | e.Graphics.DrawBox2D(e.Graphics.CreateSolidBrush(Color.Transparent), fill, x, y, x + width, y + height, 2); 67 | if (CSGO.IsVisible(entity)) e.Graphics.DrawRectangleEdges(visibleBrush, x, y, x + width, y + height, 2); 68 | else e.Graphics.DrawRectangleEdges(defaultBrush, x, y, x + width, y + height, 2); 69 | } 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /kuchima/Memory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.InteropServices; 4 | using static kuchima.Native; 5 | 6 | namespace kuchima 7 | { 8 | public class Memory 9 | { 10 | public Process proc { get; set; } 11 | private IntPtr handle { get; set; } 12 | 13 | public Memory(Process p) 14 | { 15 | proc = p; 16 | handle = proc.Handle; 17 | } 18 | 19 | public void Dispose() => CloseHandle(handle); 20 | 21 | public IntPtr GetModuleBaseAddress(string modulename) 22 | { 23 | foreach (ProcessModule module in proc.Modules) 24 | { 25 | if (module.ModuleName == modulename) 26 | { 27 | return module.BaseAddress; 28 | } 29 | } 30 | return IntPtr.Zero; 31 | } 32 | 33 | public T Read(IntPtr address) 34 | { 35 | int size = Marshal.SizeOf(typeof(T)); 36 | byte[] buffer = new byte[size]; 37 | ReadProcessMemory(handle, address, buffer, buffer.Length, out _); 38 | 39 | GCHandle ptr = GCHandle.Alloc(buffer, GCHandleType.Pinned); 40 | T data = (T)Marshal.PtrToStructure(ptr.AddrOfPinnedObject(), typeof(T)); 41 | ptr.Free(); 42 | 43 | return data; 44 | } 45 | 46 | public bool Write(IntPtr address, T value) 47 | { 48 | int size = Marshal.SizeOf(value); 49 | byte[] buffer = new byte[size]; 50 | 51 | IntPtr ptr = Marshal.AllocHGlobal(size); 52 | Marshal.StructureToPtr(value, ptr, true); 53 | Marshal.Copy(ptr, buffer, 0, size); 54 | Marshal.FreeHGlobal(ptr); 55 | 56 | return WriteProcessMemory(handle, address, buffer, buffer.Length, out _); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /kuchima/Native.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace kuchima 5 | { 6 | public class Native 7 | { 8 | [DllImport("kernel32.dll")] 9 | public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesRead); 10 | 11 | [DllImport("kernel32.dll")] 12 | public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesWritten); 13 | 14 | [DllImport("kernel32.dll")] 15 | public static extern int CloseHandle(IntPtr hObject); 16 | 17 | [DllImport("user32.dll")] 18 | public static extern bool SetWindowDisplayAffinity(IntPtr hwnd, uint affinity); 19 | 20 | [DllImport("user32.dll")] 21 | public static extern IntPtr GetForegroundWindow(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kuchima/Offsets.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Newtonsoft.Json; 3 | 4 | namespace kuchima 5 | { 6 | public class Offsets 7 | { 8 | public static dynamic hazedumper; 9 | private const string url = "https://raw.githubusercontent.com/frk1/hazedumper/master/csgo.json"; 10 | 11 | public static void Load() 12 | { 13 | WebClient wc = new(); 14 | hazedumper = JsonConvert.DeserializeObject(wc.DownloadString(url)); 15 | wc.Dispose(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /kuchima/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using kuchima.Hacks; 4 | 5 | namespace kuchima 6 | { 7 | internal class Program 8 | { 9 | static void Main() 10 | { 11 | Console.Title = "kuchima"; 12 | 13 | Console.WriteLine("Grabbing offsets..."); 14 | Offsets.Load(); 15 | 16 | Console.WriteLine("Loading..."); 17 | while (!CSGO.Load()) Thread.Sleep(100); 18 | 19 | ESP.StartThread(); 20 | Console.WriteLine("ESP started."); 21 | Thread.Sleep(-1); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /kuchima/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("kuchima")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("kuchima")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 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("27ea7eb1-630b-4965-9249-2ab1e0f1c83a")] 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 | -------------------------------------------------------------------------------- /kuchima/kuchima.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | preview 6 | Debug 7 | AnyCPU 8 | {27EA7EB1-630B-4965-9249-2AB1E0F1C83A} 9 | Exe 10 | kuchima 11 | kuchima 12 | v4.8 13 | 512 14 | true 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\packages\GameMath.Net.1.4.22.6799\lib\GameMath.dll 39 | 40 | 41 | ..\packages\GameOverlay.Net.4.3.1\lib\net48\GameOverlay.dll 42 | 43 | 44 | ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll 45 | 46 | 47 | ..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll 48 | 49 | 50 | ..\packages\SharpDX.Direct2D1.4.2.0\lib\net45\SharpDX.Direct2D1.dll 51 | 52 | 53 | ..\packages\SharpDX.DXGI.4.2.0\lib\net45\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 | -------------------------------------------------------------------------------- /kuchima/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------