├── .gitignore ├── ESP ├── CPUZ.sln └── ESP │ ├── 03-102.ico │ ├── 360Tray.csproj │ ├── 360Tray.csproj.user │ ├── App.config │ ├── CPUZ.Designer.cs │ ├── CPUZ.cs │ ├── CPUZ.resx │ ├── Cache.cs │ ├── CommonUtil.cs │ ├── DoGame.cs │ ├── HotKeyManager.cs │ ├── KReader.cs │ ├── Model │ ├── APlayerCameraManager.cs │ ├── JSON_DATA.cs │ └── UEClass.cs │ ├── PUBG-SDK.cs │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── Setting.cs │ ├── main.Designer.cs │ ├── main.cs │ ├── main.resx │ └── packages.config ├── README.md └── node_server ├── Server.js ├── index.html ├── map.jpg ├── package.json └── web.config /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ESP/ESP/bin/ 3 | ESP/ESP/obj/ 4 | */.vs/ 5 | */packages/ 6 | */*/bin/ 7 | */*/obj/ 8 | *.rar 9 | *.sys 10 | *.exe 11 | */X64/ 12 | */*/X64/ 13 | /.vs 14 | node_server/node_modules/ 15 | node_server/package-lock.json 16 | UPSecurityInput/ 17 | kernel driver/ -------------------------------------------------------------------------------- /ESP/CPUZ.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2006 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "360Tray", "ESP\360Tray.csproj", "{9BC48D38-89A1-47C2-9C68-DC2B9881D033}" 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 | {9BC48D38-89A1-47C2-9C68-DC2B9881D033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9BC48D38-89A1-47C2-9C68-DC2B9881D033}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9BC48D38-89A1-47C2-9C68-DC2B9881D033}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9BC48D38-89A1-47C2-9C68-DC2B9881D033}.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 = {C6D7282C-5BA0-486E-A0D7-C2669BA76BC4} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ESP/ESP/03-102.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrytang67/helloworld/a24a59c1bb66be00349a83323bed3ef7652741ef/ESP/ESP/03-102.ico -------------------------------------------------------------------------------- /ESP/ESP/360Tray.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9BC48D38-89A1-47C2-9C68-DC2B9881D033} 8 | WinExe 9 | CPUZ 10 | 360Tray 11 | v4.5.2 12 | 512 13 | true 14 | publish\ 15 | true 16 | Disk 17 | false 18 | Foreground 19 | 7 20 | Days 21 | false 22 | false 23 | true 24 | 0 25 | 1.0.0.%2a 26 | false 27 | false 28 | true 29 | 30 | 31 | 32 | AnyCPU 33 | true 34 | full 35 | false 36 | bin\Debug\ 37 | DEBUG;TRACE 38 | prompt 39 | 4 40 | true 41 | 42 | 43 | AnyCPU 44 | pdbonly 45 | true 46 | bin\Release\ 47 | TRACE 48 | prompt 49 | 4 50 | true 51 | 52 | 53 | 03-102.ico 54 | 55 | 56 | 57 | ..\packages\AutoMapper.6.1.1\lib\net45\AutoMapper.dll 58 | 59 | 60 | ..\packages\MaterialSkin.0.2.1\lib\MaterialSkin.dll 61 | 62 | 63 | ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll 64 | 65 | 66 | ..\packages\SharpDX.4.0.1\lib\net45\SharpDX.dll 67 | 68 | 69 | ..\packages\SharpDX.Direct2D1.4.0.1\lib\net45\SharpDX.Direct2D1.dll 70 | 71 | 72 | ..\packages\SharpDX.DXGI.4.0.1\lib\net45\SharpDX.DXGI.dll 73 | 74 | 75 | ..\packages\SharpDX.Mathematics.4.0.1\lib\net45\SharpDX.Mathematics.dll 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | Form 95 | 96 | 97 | CPUZ.cs 98 | 99 | 100 | 101 | 102 | 103 | Form 104 | 105 | 106 | main.cs 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | CPUZ.cs 117 | 118 | 119 | main.cs 120 | 121 | 122 | ResXFileCodeGenerator 123 | Resources.Designer.cs 124 | Designer 125 | 126 | 127 | True 128 | Resources.resx 129 | True 130 | 131 | 132 | 133 | PublicSettingsSingleFileGenerator 134 | Settings.Designer.cs 135 | 136 | 137 | True 138 | Settings.settings 139 | True 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | False 148 | Microsoft .NET Framework 4.6.2 %28x86 和 x64%29 149 | true 150 | 151 | 152 | False 153 | .NET Framework 3.5 SP1 154 | false 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /ESP/ESP/360Tray.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | zh-CN 11 | false 12 | 13 | -------------------------------------------------------------------------------- /ESP/ESP/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ESP/ESP/CPUZ.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Device; 4 | 5 | namespace CPUZ 6 | { 7 | partial class Cpuz 8 | { 9 | 10 | 11 | 12 | /// 13 | /// 必需的设计器变量。 14 | /// 15 | private System.ComponentModel.IContainer components = null; 16 | 17 | /// 18 | /// 清理所有正在使用的资源。 19 | /// 20 | /// 如果应释放托管资源,为 true;否则为 false。 21 | protected override void Dispose(bool disposing) 22 | { 23 | if (disposing && (components != null)) 24 | { 25 | components.Dispose(); 26 | } 27 | base.Dispose(disposing); 28 | } 29 | 30 | #region Windows 窗体设计器生成的代码 31 | 32 | /// 33 | /// 设计器支持所需的方法 - 不要修改 34 | /// 使用代码编辑器修改此方法的内容。 35 | /// 36 | private void InitializeComponent() 37 | { 38 | this.SuspendLayout(); 39 | // 40 | // Form1 41 | // 42 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 43 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 44 | this.BackColor = System.Drawing.Color.Black; 45 | this.ClientSize = new System.Drawing.Size(284, 261); 46 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; 47 | this.Name = "Form1"; 48 | this.ShowIcon = false; 49 | this.ShowInTaskbar = false; 50 | this.Text = "Form1"; 51 | this.TopMost = true; 52 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized; 53 | this.ResumeLayout(false); 54 | 55 | } 56 | 57 | #endregion 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /ESP/ESP/CPUZ.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Runtime.InteropServices; 5 | using System.Threading; 6 | using System.Windows.Forms; 7 | using CPUZ.Model; 8 | using Newtonsoft.Json; 9 | using SharpDX; 10 | using SharpDX.Direct2D1; 11 | using SharpDX.DXGI; 12 | using SharpDX.Mathematics.Interop; 13 | 14 | using Vector2 = CPUZ.Model.Vector2; 15 | using System.Linq; 16 | using System.Text; 17 | using SharpDX.DirectWrite; 18 | using TextAntialiasMode = SharpDX.Direct2D1.TextAntialiasMode; 19 | using Vector3 = CPUZ.Model.Vector3; 20 | 21 | namespace CPUZ 22 | { 23 | public partial class Cpuz : Form 24 | { 25 | public Cpuz() 26 | { 27 | InitializeComponent(); 28 | //Make the window's border completely transparant 29 | 30 | #region D3D初始化 31 | // ANTI BATTLEYE SIG SCAN ;) 32 | this.Text = Guid.NewGuid().ToString().Replace("-", ""); 33 | 34 | // TRANSPARENCY KEY 35 | this.BackColor = System.Drawing.Color.Black; 36 | 37 | // SETTINGS 38 | this.FormBorderStyle = FormBorderStyle.None; 39 | this.ShowIcon = false; 40 | this.ShowInTaskbar = false; 41 | this.TopMost = true; 42 | this.WindowState = FormWindowState.Maximized; 43 | 44 | // MAKE WINDOW TRANSPARENT 45 | Win32.SetWindowLong(this.Handle, Win32.GWL_EXSTYLE, (IntPtr)(Win32.GetWindowLong(this.Handle, Win32.GWL_EXSTYLE) ^ Win32.WS_EX_LAYERED ^ Win32.WS_EX_TRANSPARENT)); 46 | 47 | // MAKE WINDOW SOLID 48 | Win32.SetLayeredWindowAttributes(this.Handle, 0, 255, Win32.LWA_ALPHA); 49 | 50 | var targetProperties = new HwndRenderTargetProperties 51 | { 52 | Hwnd = this.Handle, 53 | PixelSize = new Size2(this.Bounds.Right - this.Bounds.Left, this.Bounds.Bottom - this.Bounds.Top), 54 | PresentOptions = PresentOptions.Immediately 55 | }; 56 | 57 | var prop = new RenderTargetProperties(RenderTargetType.Hardware, new PixelFormat(Format.B8G8R8A8_UNorm, SharpDX.Direct2D1.AlphaMode.Premultiplied), 0, 0, RenderTargetUsage.None, FeatureLevel.Level_DEFAULT); 58 | 59 | var d3dFactory = new SharpDX.Direct2D1.Factory(); 60 | 61 | var device = new WindowRenderTarget(d3dFactory, prop, targetProperties) 62 | { 63 | TextAntialiasMode = TextAntialiasMode.Cleartype, 64 | AntialiasMode = AntialiasMode.Aliased 65 | }; 66 | 67 | #endregion 68 | 69 | var k = KReader.readPuBase(); 70 | JSON_DATA json_data = null; 71 | var dxthread = new Thread(() => 72 | { 73 | var brushWhite = new SolidColorBrush(device, RawColorFromColor(Color.White)); 74 | var brushBlack = new SolidColorBrush(device, RawColorFromColor(Color.Black)); 75 | var brushGreen = new SolidColorBrush(device, RawColorFromColor(Color.Green)); 76 | var brushRed = new SolidColorBrush(device, RawColorFromColor(Color.Red)); 77 | var brushPurple = new SolidColorBrush(device, RawColorFromColor(Color.Purple)); 78 | var fontFactory = new SharpDX.DirectWrite.Factory(); 79 | var fontConsolas = new SharpDX.DirectWrite.TextFormat(fontFactory, "Consolas", 15); 80 | var fontESP = new SharpDX.DirectWrite.TextFormat(fontFactory, "Consolas", 12); 81 | 82 | while (true) 83 | { 84 | // attempt to download JSON data as a string 85 | try 86 | { 87 | json_data = DoGame.getGameDate(); 88 | 89 | if (json_data != null && json_data.players.Count > 0) 90 | { 91 | mainFrom.STATE = true; 92 | device.BeginDraw(); 93 | device.Clear(null); 94 | 95 | #region RADAR 96 | 97 | int radarSize = 600; 98 | Vector2 centerpoint = new Vector2(2356, 1210); 99 | 100 | if (Setting.雷达) 101 | { 102 | Ellipse el3 = new Ellipse(new RawVector2(2356, 1210), 1, 1); 103 | device.DrawEllipse(el3, brushRed); 104 | device.FillEllipse(el3, brushRed); 105 | 106 | // TODO: INTEGRATE INTO MINIMAP 107 | //if (Setting.雷达) 108 | //{ 109 | // var radarOuterRectangle = new RawRectangleF(radarX, radarY, radarX + radarSize, 110 | // radarY + radarSize); 111 | // var radarRectangle = new RawRectangleF(radarX + radarBorder, radarY + radarBorder, 112 | // radarX + radarSize - radarBorder, radarY + radarSize - radarBorder); 113 | 114 | // var radarCenterRectangle = new RoundedRectangle() 115 | // { 116 | // RadiusX = 4, 117 | // RadiusY = 4, 118 | // Rect = new RawRectangleF(centerpoint.X, centerpoint.Y, centerpoint.X + 4, 119 | // centerpoint.Y + 4) 120 | // }; 121 | 122 | // device.FillRectangle(radarRectangle, brushBlack); 123 | // device.DrawRectangle(radarRectangle, brushWhite); 124 | 125 | // device.FillRoundedRectangle(radarCenterRectangle, brushGreen); 126 | 127 | //} 128 | } 129 | 130 | #endregion 131 | 132 | 133 | var vecLocalLocation = new Model.Vector3 134 | { 135 | X = json_data.camera[1].X, 136 | Y = json_data.camera[1].Y, 137 | Z = json_data.camera[1].Z 138 | }; 139 | 140 | var PlayerCameraManager = new PlayerCameraManager 141 | { 142 | CameraCache = new FCameraCacheEntry 143 | { 144 | POV = new FMinimalViewInfo 145 | { 146 | Fov = json_data.camera[2].X, 147 | Location = new Model.Vector3 148 | { 149 | X = json_data.camera[1].X, 150 | Y = json_data.camera[1].Y, 151 | Z = json_data.camera[1].Z 152 | }, 153 | Rotation = new Model.FRotator 154 | { 155 | Pitch = json_data.camera[0].X, 156 | Yaw = json_data.camera[0].Y, 157 | Roll = json_data.camera[0].Z 158 | } 159 | } 160 | } 161 | }; 162 | 163 | #region 车 164 | 165 | if (Setting.车辆显示) 166 | { 167 | foreach (var v in json_data.vehicles) 168 | { 169 | var vecActorLocation = new Vector3 { X = v.rx, Y = v.ry, Z = v.rz }; 170 | var vecRelativePos = vecLocalLocation - vecActorLocation; 171 | var lDeltaInMeters = vecRelativePos.Length / 100; 172 | if (lDeltaInMeters <= 400) 173 | { 174 | Vector2 screenlocation; 175 | if (WorldToScreen(vecActorLocation, PlayerCameraManager, out screenlocation)) 176 | { 177 | 178 | DrawText($"[{v.v}] {(int)lDeltaInMeters}m", (int)screenlocation.X, 179 | (int)screenlocation.Y, v.v == "Deat" ? brushBlack : brushGreen, 180 | fontFactory, fontESP, device); 181 | } 182 | } 183 | 184 | } 185 | } 186 | 187 | #endregion 188 | 189 | #region 物品 190 | 191 | //todo:有BUG 192 | if (Setting.物品显示) 193 | { 194 | foreach (var v in json_data.items) 195 | { 196 | var vecActorLocation = new Vector3 { X = v.rx, Y = v.ry, Z = v.rz }; 197 | var vecRelativePos = vecLocalLocation - vecActorLocation; 198 | var lDeltaInMeters = vecRelativePos.Length / 100; 199 | 200 | Vector2 screenlocation; 201 | if (WorldToScreen(vecActorLocation, PlayerCameraManager, out screenlocation)) 202 | { 203 | DrawText($"{v.n}", (int)screenlocation.X, 204 | (int)screenlocation.Y, brushWhite, fontFactory, fontESP, device); 205 | } 206 | 207 | } 208 | } 209 | 210 | #endregion 211 | 212 | #region 人物 213 | 214 | var playerList = json_data.players.OrderBy(z => z.id).ToList(); 215 | var localPlayer = playerList[0]; 216 | foreach (var player in playerList) 217 | { 218 | if (player.health > 0 && player.isInactive > 0 && player.id != 0) 219 | { 220 | var vecPlayerLocation = new Vector3 { X = player.rx, Y = player.ry, Z = player.rz }; 221 | var vecRelativePos = vecLocalLocation - vecPlayerLocation; 222 | //距离 223 | var lDeltaInMeters = vecRelativePos.Length / 100.0f; 224 | 225 | 226 | if (lDeltaInMeters >= 750) 227 | { 228 | continue; 229 | } 230 | #region 线条 231 | if (Setting.线条) 232 | if (lDeltaInMeters > 3) 233 | if ( 234 | //超过200米不显示线 235 | lDeltaInMeters <= 200 236 | //超过40人不显示线 237 | && json_data.players.Count <= 40 238 | //队友不显示 239 | && player.t != localPlayer.t 240 | ) 241 | { 242 | if (WorldToScreen(vecPlayerLocation, PlayerCameraManager, 243 | out var screenlocation)) 244 | { 245 | device.DrawLine(new RawVector2(Setting.Screen.Width / 2f, Setting.Screen.Height), 246 | new RawVector2(screenlocation.X, screenlocation.Y), lDeltaInMeters <= 100 ? brushRed : brushWhite); 247 | } 248 | } 249 | #endregion 250 | 251 | #region Distance ESP 252 | if (lDeltaInMeters > 3) 253 | 254 | if (Setting.距离和血量) 255 | { 256 | if (WorldToScreen(vecPlayerLocation, PlayerCameraManager, 257 | out var screenlocation)) 258 | { 259 | SolidColorBrush brush = brushRed; 260 | 261 | if (lDeltaInMeters >= 250) 262 | brush = brushPurple; 263 | if (lDeltaInMeters >= 500) 264 | brush = brushGreen; 265 | if (player.t == localPlayer.t) 266 | brush = brushGreen; 267 | 268 | DrawText($"[{player.id}]{(int)player.health} {(int)lDeltaInMeters}m", 269 | (int)screenlocation.X, 270 | (int)screenlocation.Y, 271 | brush, 272 | fontFactory, fontESP, device); 273 | } 274 | 275 | } 276 | 277 | #endregion 278 | 279 | #region Radar 280 | if (Setting.雷达) 281 | { 282 | var loclalLocation = new Vector3 { X = playerList[0].x, Y = playerList[0].y, Z = playerList[0].z }; 283 | var currentActorLocation = new Vector3 { X = player.x, Y = player.y, Z = player.z }; 284 | 285 | var relativePos = loclalLocation - currentActorLocation; 286 | 287 | if (relativePos.Length / 100.0f <= radarSize / 2 /*DISTANCE FROM CENTER TO EDGE*/) 288 | { 289 | Vector2 screenpos = centerpoint - relativePos.To2D() / 118f; 290 | 291 | Ellipse el22 = new Ellipse(new RawVector2(screenpos.X, screenpos.Y), 3, 3); 292 | device.DrawEllipse(el22, brushRed); 293 | device.FillEllipse(el22, brushRed); 294 | } 295 | } 296 | #endregion 297 | 298 | #region 骨骼 299 | 300 | if (lDeltaInMeters < 250 && lDeltaInMeters > 5) 301 | { 302 | DrawSkeleton(player.mesh, PlayerCameraManager, device, brushRed, fontESP); 303 | } 304 | #endregion 305 | } 306 | 307 | } 308 | #endregion 309 | // DRAW END 310 | device.EndDraw(); 311 | 312 | } 313 | else 314 | { 315 | mainFrom.STATE = false; 316 | } 317 | 318 | } 319 | catch (Exception ex) 320 | { 321 | System.IO.File.WriteAllText("c:\\log\\bug_json.txt", JsonConvert.SerializeObject(json_data)); 322 | } 323 | Thread.Sleep(10); 324 | } 325 | }) 326 | { 327 | IsBackground = true 328 | }; 329 | dxthread.Start(); 330 | 331 | #region Web端 332 | var webThread = new Thread(() => 333 | { 334 | while (true) 335 | { 336 | using (var webClient = new WebClient()) 337 | { 338 | if (Setting.Web端 && json_data.players.Count > 0 && !webClient.IsBusy) 339 | { 340 | try 341 | { 342 | // 指定 WebClient 編碼 343 | webClient.Encoding = Encoding.UTF8; 344 | // 指定 WebClient 的 Content-Type header 345 | webClient.Headers.Add(HttpRequestHeader.ContentType, "application/json"); 346 | // 指定 WebClient 的 authorization header 347 | //webClient.Headers.Add("authorization", "token {apitoken}"); 348 | // 執行 PUT 動作 349 | var result = webClient.UploadString("http://127.0.0.1:3000/api/5", "PUT", JsonConvert.SerializeObject(json_data)); 350 | } 351 | catch (Exception e) 352 | { 353 | continue; 354 | } 355 | 356 | } 357 | } 358 | Thread.Sleep(500); 359 | } 360 | }); 361 | 362 | webThread.IsBackground = true; 363 | webThread.Start(); 364 | #endregion 365 | 366 | 367 | var marg = new Win32.Margins { Left = 0, Top = 0, Right = this.Width, Bottom = this.Height }; 368 | Win32.DwmExtendFrameIntoClientArea(this.Handle, ref marg); 369 | } 370 | 371 | 372 | 373 | private void DrawSkeleton(ulong mesh, PlayerCameraManager CameraManager, WindowRenderTarget device, Brush brush, TextFormat font) 374 | { 375 | Vector2 vHead, vRoot, vCenter; 376 | var bRoot = DoGame.GetBoneWithRotation(mesh, Bones.Root); 377 | var middle = DoGame.GetBoneWithRotation(mesh, Bones.pelvis); 378 | 379 | if (WorldToScreen(bRoot, CameraManager, out vRoot) && WorldToScreen(middle, CameraManager, out vCenter)) 380 | { 381 | var flWidth = Math.Abs(vRoot.Y - vCenter.Y) / 2; 382 | var flHeight = Math.Abs(vRoot.Y - vCenter.Y); 383 | vHead.X = vCenter.X - flWidth; 384 | vHead.Y = vCenter.Y - flHeight; 385 | //2d box drawing 386 | //2d box drawing 387 | DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X + flWidth, vHead.Y, device, brush); // top 388 | DrawLine(vCenter.X - flWidth, vRoot.Y, vCenter.X + flWidth, vRoot.Y, device, brush); // bottom 389 | DrawLine(vCenter.X - flWidth, vHead.Y, vCenter.X - flWidth, vRoot.Y, device, brush); // left 390 | DrawLine(vCenter.X + flWidth, vRoot.Y, vCenter.X + flWidth, vHead.Y, device, brush); // right 391 | } 392 | } 393 | 394 | private bool WorldToScreen(Vector3 worldLocation, PlayerCameraManager cameraManager, out Vector2 screenlocation) 395 | { 396 | screenlocation = new Vector2(0, 0); 397 | 398 | var pov = cameraManager.CameraCache.POV; 399 | var rotation = pov.Rotation; 400 | 401 | rotation.GetAxes(out var vAxisX, out var vAxisY, out var vAxisZ); 402 | 403 | var vDelta = worldLocation - pov.Location; 404 | var vTransformed = new Vector3(Vector3.DotProduct(vDelta, vAxisY), Vector3.DotProduct(vDelta, vAxisZ), Vector3.DotProduct(vDelta, vAxisX)); 405 | 406 | if (vTransformed.Z < 1f) 407 | vTransformed.Z = 1f; 408 | 409 | var fovAngle = pov.Fov; 410 | var screenCenterX = Setting.Screen.Width / 2; 411 | var screenCenterY = Setting.Screen.Height / 2; 412 | 413 | screenlocation.X = screenCenterX + vTransformed.X * (screenCenterX / (float)Math.Tan(fovAngle * (float)Math.PI / 360)) / vTransformed.Z; 414 | screenlocation.Y = screenCenterY - vTransformed.Y * (screenCenterX / (float)Math.Tan(fovAngle * (float)Math.PI / 360)) / vTransformed.Z; 415 | 416 | //超出屏幕边界返回false 417 | return !(screenlocation.X > Setting.Screen.Width | screenlocation.Y > Setting.Screen.Height); 418 | } 419 | 420 | private TextLayout TextLayout(string szText, SharpDX.DirectWrite.Factory factory, SharpDX.DirectWrite.TextFormat font) => 421 | new TextLayout(factory, szText, font, float.MaxValue, float.MaxValue); 422 | 423 | 424 | private void DrawLine(float x, float y, float xx, float yy, RenderTarget device, Brush brush) 425 | { 426 | RawVector2[] dLine = new RawVector2[2]; 427 | 428 | dLine[0].X = x; 429 | dLine[0].Y = y; 430 | 431 | dLine[1].X = xx; 432 | dLine[1].Y = yy; 433 | DrawLines(dLine, device, brush); 434 | 435 | } 436 | 437 | private void DrawLines(RawVector2[] point0, RenderTarget device, Brush brush) 438 | { 439 | if (point0.Length < 2) 440 | return; 441 | 442 | for (var x = 0; x < point0.Length - 1; x++) 443 | device.DrawLine(point0[x], point0[x + 1], brush); 444 | } 445 | 446 | 447 | private void DrawText(string szText, int x, int y, SharpDX.Direct2D1.Brush foregroundBroush, SharpDX.DirectWrite.Factory fontFactory, SharpDX.DirectWrite.TextFormat font, RenderTarget device) 448 | { 449 | var tempTextLayout = TextLayout(szText, fontFactory, font); 450 | 451 | device.DrawTextLayout(new RawVector2(x, y), tempTextLayout, foregroundBroush, DrawTextOptions.NoSnap); 452 | 453 | tempTextLayout.Dispose(); 454 | } 455 | 456 | private RawColor4 RawColorFromColor(Color color) => new RawColor4(color.R, color.G, color.B, color.A); 457 | //color.ToArgb() >> 16 & 255L, color.ToArgb() >> 8 & 255L, (byte)color.ToArgb() & 255L, color.ToArgb() >> 24 & 255L); 458 | 459 | private static class Win32 460 | { 461 | #region Definitions 462 | public const int GWL_EXSTYLE = -20; 463 | 464 | public const int WS_EX_LAYERED = 0x80000; 465 | 466 | public const int WS_EX_TRANSPARENT = 0x20; 467 | 468 | public const int LWA_ALPHA = 0x2; 469 | 470 | public const int LWA_COLORKEY = 0x1; 471 | #endregion 472 | 473 | #region Functions 474 | [DllImport("user32.dll", SetLastError = true)] 475 | public static extern uint GetWindowLong(IntPtr hWnd, int nIndex); 476 | 477 | [DllImport("user32.dll")] 478 | public static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong); 479 | 480 | [DllImport("user32.dll")] 481 | public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags); 482 | 483 | [DllImport("dwmapi.dll")] 484 | public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMargins); 485 | #endregion 486 | 487 | #region Structs 488 | internal struct Margins 489 | { 490 | public int Left, Right, Top, Bottom; 491 | } 492 | #endregion 493 | } 494 | 495 | private void OverlayForm_FormClosing(object sender, FormClosingEventArgs e) 496 | { 497 | Environment.Exit(0); 498 | } 499 | } 500 | } 501 | -------------------------------------------------------------------------------- /ESP/ESP/CPUZ.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 | -------------------------------------------------------------------------------- /ESP/ESP/Cache.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CPUZ 4 | { 5 | public static class Cache 6 | { 7 | public static Dictionary GCahce = new Dictionary(); 8 | 9 | public static string GetGName(int actorId) 10 | { 11 | if (GCahce.TryGetValue(actorId, out var gname)) return gname; 12 | gname = KReader.getGNameFromId(actorId); 13 | GCahce.Add(actorId, gname); 14 | return gname; 15 | } 16 | 17 | public static string GetPlayerName(int playerId) 18 | { 19 | if (PlayerCache.TryGetValue(playerId, out var playerName)) return playerName; 20 | playerName = KReader.getGNameFromId(playerId); 21 | PlayerCache.Add(playerId, playerName); 22 | return playerName; 23 | } 24 | 25 | public static void ClearPlayerCache() 26 | { 27 | PlayerCache.Clear(); 28 | } 29 | 30 | 31 | 32 | public static Dictionary PlayerCache = new Dictionary(); 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /ESP/ESP/CommonUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace CPUZ 5 | { 6 | 7 | [Flags] 8 | public enum EFileAccess : uint 9 | { 10 | /// 11 | /// 12 | /// 13 | GenericRead = 0x80000000, 14 | /// 15 | /// 16 | /// 17 | GenericWrite = 0x40000000, 18 | /// 19 | /// 20 | /// 21 | GenericExecute = 0x20000000, 22 | /// 23 | /// 24 | /// 25 | GenericAll = 0x10000000 26 | } 27 | 28 | [Flags] 29 | public enum EFileShare : uint 30 | { 31 | /// 32 | /// 33 | /// 34 | None = 0x00000000, 35 | /// 36 | /// Enables subsequent open operations on an object to request read access. 37 | /// Otherwise, other processes cannot open the object if they request read access. 38 | /// If this flag is not specified, but the object has been opened for read access, the function fails. 39 | /// 40 | Read = 0x00000001, 41 | /// 42 | /// Enables subsequent open operations on an object to request write access. 43 | /// Otherwise, other processes cannot open the object if they request write access. 44 | /// If this flag is not specified, but the object has been opened for write access, the function fails. 45 | /// 46 | Write = 0x00000002, 47 | /// 48 | /// Enables subsequent open operations on an object to request delete access. 49 | /// Otherwise, other processes cannot open the object if they request delete access. 50 | /// If this flag is not specified, but the object has been opened for delete access, the function fails. 51 | /// 52 | Delete = 0x00000004 53 | } 54 | 55 | public enum ECreationDisposition : uint 56 | { 57 | /// 58 | /// Creates a new file. The function fails if a specified file exists. 59 | /// 60 | New = 1, 61 | /// 62 | /// Creates a new file, always. 63 | /// If a file exists, the function overwrites the file, clears the existing attributes, combines the specified file attributes, 64 | /// and flags with FILE_ATTRIBUTE_ARCHIVE, but does not set the security descriptor that the SECURITY_ATTRIBUTES structure specifies. 65 | /// 66 | CreateAlways = 2, 67 | /// 68 | /// Opens a file. The function fails if the file does not exist. 69 | /// 70 | OpenExisting = 3, 71 | /// 72 | /// Opens a file, always. 73 | /// If a file does not exist, the function creates a file as if dwCreationDisposition is CREATE_NEW. 74 | /// 75 | OpenAlways = 4, 76 | /// 77 | /// Opens a file and truncates it so that its size is 0 (zero) bytes. The function fails if the file does not exist. 78 | /// The calling process must open the file with the GENERIC_WRITE access right. 79 | /// 80 | TruncateExisting = 5 81 | } 82 | 83 | [Flags] 84 | public enum EFileAttributes : uint 85 | { 86 | Readonly = 0x00000001, 87 | Hidden = 0x00000002, 88 | System = 0x00000004, 89 | Directory = 0x00000010, 90 | Archive = 0x00000020, 91 | Device = 0x00000040, 92 | Normal = 0x00000080, 93 | Temporary = 0x00000100, 94 | SparseFile = 0x00000200, 95 | ReparsePoint = 0x00000400, 96 | Compressed = 0x00000800, 97 | Offline = 0x00001000, 98 | NotContentIndexed = 0x00002000, 99 | Encrypted = 0x00004000, 100 | Write_Through = 0x80000000, 101 | Overlapped = 0x40000000, 102 | NoBuffering = 0x20000000, 103 | RandomAccess = 0x10000000, 104 | SequentialScan = 0x08000000, 105 | DeleteOnClose = 0x04000000, 106 | BackupSemantics = 0x02000000, 107 | PosixSemantics = 0x01000000, 108 | OpenReparsePoint = 0x00200000, 109 | OpenNoRecall = 0x00100000, 110 | FirstPipeInstance = 0x00080000 111 | } 112 | 113 | [StructLayout(LayoutKind.Sequential)] 114 | public struct SECURITY_ATTRIBUTES 115 | { 116 | public int nLength; 117 | public IntPtr lpSecurityDescriptor; 118 | public int bInheritHandle; 119 | } 120 | 121 | [StructLayoutAttribute(LayoutKind.Sequential)] 122 | public struct SECURITY_DESCRIPTOR 123 | { 124 | public byte revision; 125 | public byte size; 126 | public short control; 127 | public IntPtr owner; 128 | public IntPtr group; 129 | public IntPtr sacl; 130 | public IntPtr dacl; 131 | } 132 | 133 | class CommonUtil 134 | { 135 | 136 | [DllImport("kernel32.dll")] 137 | public static extern uint GetCurrentProcessId(); 138 | 139 | 140 | [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] 141 | static extern IntPtr CreateFile( 142 | string lpFileName, 143 | EFileAccess dwDesiredAccess, 144 | EFileShare dwShareMode, 145 | IntPtr lpSecurityAttributes, 146 | ECreationDisposition dwCreationDisposition, 147 | EFileAttributes dwFlagsAndAttributes, 148 | IntPtr hTemplateFile); 149 | 150 | [DllImport("kernel32.dll")] 151 | static extern bool ReadFile(IntPtr hFile, byte[] lpBuffer, 152 | uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped); 153 | [DllImport("kernel32.dll")] 154 | static extern bool ReadFile(IntPtr hFile, IntPtr lpBuffer, 155 | uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped); 156 | 157 | [DllImport("kernel32.dll")] 158 | static extern bool WriteFile(IntPtr hFile, byte[] lpBuffer, 159 | uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped); 160 | [DllImport("kernel32.dll")] 161 | static extern bool WriteFile(IntPtr hFile, IntPtr lpBuffer, 162 | uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped); 163 | 164 | [DllImport("kernel32.dll", SetLastError = true)] 165 | [return: MarshalAs(UnmanagedType.Bool)] 166 | static extern bool CloseHandle(IntPtr hObject); 167 | 168 | [DllImport("kernel32.dll")] 169 | static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName); 170 | 171 | [DllImport("kernel32.dll")] 172 | static extern bool SetEvent(IntPtr hEvent); 173 | 174 | [DllImport("kernel32.dll")] 175 | static extern bool ResetEvent(IntPtr hEvent); 176 | 177 | [DllImport("kernel32", SetLastError = true)] 178 | static extern UInt32 WaitForSingleObject(IntPtr handle, uint milliseconds); 179 | [DllImport("kernel32.dll")] 180 | static extern uint WaitForMultipleObjects(uint nCount, IntPtr[] lpHandles, 181 | bool bWaitAll, uint dwMilliseconds); 182 | public const UInt32 INFINITE = 0xFFFFFFFF; 183 | public const UInt32 WAIT_ABANDONED = 0x00000080; 184 | public const UInt32 WAIT_OBJECT_0 = 0x00000000; 185 | public const UInt32 WAIT_TIMEOUT = 0x00000102; 186 | 187 | [DllImport("kernel32.dll", SetLastError = true)] 188 | static extern IntPtr CreateNamedPipe(string lpName, uint dwOpenMode, 189 | uint dwPipeMode, uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize, 190 | uint nDefaultTimeOut, IntPtr lpSecurityAttributes); 191 | public const uint CREATE_NEW = 1; 192 | public const uint CREATE_ALWAYS = 2; 193 | public const uint OPEN_EXISTING = 3; 194 | public const uint OPEN_ALWAYS = 4; 195 | public const uint TRUNCATE_EXISTING = 5; 196 | 197 | public const uint FILE_FLAG_WRITE_THROUGH = 0x80000000; 198 | public const uint FILE_FLAG_OVERLAPPED = 0x40000000; 199 | public const uint FILE_FLAG_NO_BUFFERING = 0x20000000; 200 | public const uint FILE_FLAG_RANDOM_ACCESS = 0x10000000; 201 | public const uint FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000; 202 | public const uint FILE_FLAG_DELETE_ON_CLOSE = 0x04000000; 203 | public const uint FILE_FLAG_BACKUP_SEMANTICS = 0x02000000; 204 | public const uint FILE_FLAG_POSIX_SEMANTICS = 0x01000000; 205 | public const uint FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000; 206 | public const uint FILE_FLAG_OPEN_NO_RECALL = 0x00100000; 207 | public const uint FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000; 208 | 209 | public const int PIPE_ACCESS_INBOUND = 0x00000001; 210 | public const int PIPE_ACCESS_OUTBOUND = 0x00000002; 211 | public const int PIPE_ACCESS_DUPLEX = 0x00000003; 212 | public const int PIPE_CLIENT_END = 0x00000000; 213 | public const int PIPE_SERVER_END = 0x00000001; 214 | public const int PIPE_WAIT = 0x00000000; 215 | public const int PIPE_NOWAIT = 0x00000001; 216 | public const int PIPE_READMODE_BYTE = 0x00000000; 217 | public const int PIPE_READMODE_MESSAGE = 0x00000002; 218 | public const int PIPE_TYPE_BYTE = 0x00000000; 219 | public const int PIPE_TYPE_MESSAGE = 0x00000004; 220 | public const int PIPE_UNLIMITED_INSTANCES = 255; 221 | 222 | public const int ERROR_PIPE_BUSY = 231; 223 | 224 | 225 | [DllImport("kernel32.dll")] 226 | static extern bool ConnectNamedPipe(IntPtr hNamedPipe, 227 | [In] ref System.Threading.NativeOverlapped lpOverlapped); 228 | 229 | [DllImport("kernel32.dll")] 230 | static extern bool FlushFileBuffers(IntPtr hFile); 231 | 232 | [DllImport("kernel32.dll")] 233 | static extern bool DisconnectNamedPipe(IntPtr hNamedPipe); 234 | 235 | [DllImport("advapi32.dll", SetLastError = true)] 236 | static extern bool InitializeSecurityDescriptor(ref SECURITY_DESCRIPTOR sd, uint dwRevision); 237 | const uint SECURITY_DESCRIPTOR_REVISION = 1; 238 | 239 | [DllImport("advapi32.dll", SetLastError = true)] 240 | static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool daclPresent, IntPtr dacl, bool daclDefaulted); 241 | 242 | public static IntPtr _CreateFile( 243 | string lpFileName, 244 | EFileAccess dwDesiredAccess, 245 | EFileShare dwShareMode, 246 | ECreationDisposition dwCreationDisposition, 247 | EFileAttributes dwFlagsAndAttributes, 248 | IntPtr hTemplateFile 249 | ) 250 | { 251 | SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR(); 252 | InitializeSecurityDescriptor(ref sd, SECURITY_DESCRIPTOR_REVISION); 253 | SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false); 254 | GCHandle sdHandle = GCHandle.Alloc(sd, GCHandleType.Pinned); 255 | 256 | SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES(); 257 | sa.nLength = Marshal.SizeOf(sa); 258 | sa.lpSecurityDescriptor = sdHandle.AddrOfPinnedObject(); 259 | sa.bInheritHandle = 0; 260 | GCHandle saHandle = GCHandle.Alloc(sa, GCHandleType.Pinned); 261 | 262 | System.IntPtr hFile = IntPtr.Zero; 263 | hFile = CreateFile( 264 | lpFileName, 265 | dwDesiredAccess, 266 | dwShareMode, 267 | saHandle.AddrOfPinnedObject(), 268 | dwCreationDisposition, 269 | dwFlagsAndAttributes, 270 | hTemplateFile 271 | ); 272 | 273 | saHandle.Free(); 274 | sdHandle.Free(); 275 | if (hFile == (System.IntPtr)(int)-1) 276 | { 277 | return IntPtr.Zero; 278 | } 279 | return hFile; 280 | } 281 | 282 | public static bool _ReadFile(IntPtr hFile, ref byte[] lpBuffer, 283 | uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped) 284 | { 285 | if (hFile == IntPtr.Zero) 286 | { 287 | lpNumberOfBytesRead = 0; 288 | return false; 289 | } 290 | return ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, out lpNumberOfBytesRead, lpOverlapped); 291 | } 292 | 293 | public static bool _ReadFile(IntPtr hFile, IntPtr lpBuffer, 294 | uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead, IntPtr lpOverlapped) 295 | { 296 | if (hFile == IntPtr.Zero) 297 | { 298 | lpNumberOfBytesRead = 0; 299 | return false; 300 | } 301 | return ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, out lpNumberOfBytesRead, lpOverlapped); 302 | } 303 | 304 | public static bool _WriteFile(IntPtr hFile, ref byte[] lpBuffer, 305 | uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped) 306 | { 307 | if (hFile == IntPtr.Zero) 308 | { 309 | lpNumberOfBytesWritten = 0; 310 | return false; 311 | } 312 | return WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, out lpNumberOfBytesWritten, lpOverlapped); 313 | } 314 | 315 | public static bool _WriteFile(IntPtr hFile, IntPtr lpBuffer, 316 | uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped) 317 | { 318 | if (hFile == IntPtr.Zero) 319 | { 320 | lpNumberOfBytesWritten = 0; 321 | return false; 322 | } 323 | return WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, out lpNumberOfBytesWritten, lpOverlapped); 324 | } 325 | 326 | public static bool _CloseHandle(IntPtr hObject) 327 | { 328 | if (hObject == IntPtr.Zero) 329 | { 330 | return false; 331 | } 332 | return CloseHandle(hObject); 333 | } 334 | 335 | public static IntPtr _CreateEvent(bool bManualReset, bool bInitialState, string lpName) 336 | { 337 | SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR(); 338 | InitializeSecurityDescriptor(ref sd, SECURITY_DESCRIPTOR_REVISION); 339 | SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false); 340 | GCHandle sdHandle = GCHandle.Alloc(sd, GCHandleType.Pinned); 341 | 342 | SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES(); 343 | sa.nLength = Marshal.SizeOf(sa); 344 | sa.lpSecurityDescriptor = sdHandle.AddrOfPinnedObject(); 345 | sa.bInheritHandle = 0; 346 | GCHandle saHandle = GCHandle.Alloc(sa, GCHandleType.Pinned); 347 | 348 | System.IntPtr hEvent = IntPtr.Zero; 349 | hEvent = CreateEvent( 350 | saHandle.AddrOfPinnedObject(), 351 | bManualReset, 352 | bInitialState, 353 | lpName 354 | ); 355 | 356 | saHandle.Free(); 357 | sdHandle.Free(); 358 | if (hEvent == (System.IntPtr)(int)-1) 359 | { 360 | return IntPtr.Zero; 361 | } 362 | return hEvent; 363 | } 364 | 365 | public static UInt32 _WaitForSingleObject(IntPtr handle, uint milliseconds) 366 | { 367 | return WaitForSingleObject(handle, milliseconds); 368 | } 369 | 370 | public static uint _WaitForMultipleObjects(uint nCount, IntPtr[] lpHandles, 371 | bool bWaitAll, uint dwMilliseconds) 372 | { 373 | return WaitForMultipleObjects(nCount, lpHandles, bWaitAll, dwMilliseconds); 374 | } 375 | 376 | public static IntPtr _CreateNamedPipe(string lpName, uint dwOpenMode, 377 | uint dwPipeMode, uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize, 378 | uint nDefaultTimeOut) 379 | { 380 | SECURITY_DESCRIPTOR sd = new SECURITY_DESCRIPTOR(); 381 | InitializeSecurityDescriptor(ref sd, SECURITY_DESCRIPTOR_REVISION); 382 | SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false); 383 | GCHandle sdHandle = GCHandle.Alloc(sd, GCHandleType.Pinned); 384 | 385 | SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES(); 386 | sa.nLength = Marshal.SizeOf(sa); 387 | sa.lpSecurityDescriptor = sdHandle.AddrOfPinnedObject(); 388 | sa.bInheritHandle = 0; 389 | GCHandle saHandle = GCHandle.Alloc(sa, GCHandleType.Pinned); 390 | 391 | System.IntPtr hPipe = IntPtr.Zero; 392 | hPipe = CreateNamedPipe( 393 | lpName, 394 | dwOpenMode, 395 | dwPipeMode, 396 | nMaxInstances, 397 | nOutBufferSize, 398 | nInBufferSize, 399 | nDefaultTimeOut, 400 | saHandle.AddrOfPinnedObject() 401 | ); 402 | 403 | saHandle.Free(); 404 | sdHandle.Free(); 405 | if (hPipe == (System.IntPtr)(int)-1) 406 | { 407 | return IntPtr.Zero; 408 | } 409 | return hPipe; 410 | } 411 | 412 | public static bool _ConnectNamedPipe(IntPtr hNamedPipe, 413 | [In] ref System.Threading.NativeOverlapped lpOverlapped) 414 | { 415 | return ConnectNamedPipe(hNamedPipe, ref lpOverlapped); 416 | } 417 | 418 | public static bool _FlushFileBuffers(IntPtr hFile) 419 | { 420 | return FlushFileBuffers(hFile); 421 | } 422 | 423 | public static bool _DisconnectNamedPipe(IntPtr hNamedPipe) 424 | { 425 | return DisconnectNamedPipe(hNamedPipe); 426 | } 427 | 428 | public static bool _SetEvent(IntPtr hEvent) 429 | { 430 | return SetEvent(hEvent); 431 | } 432 | 433 | public static bool _ResetEvent(IntPtr hEvent) 434 | { 435 | return ResetEvent(hEvent); 436 | } 437 | 438 | [DllImport("user32.dll")] 439 | static extern bool GetLastInputInfo(ref LASTINPUTINFO plii); 440 | 441 | // Struct we'll need to pass to the function 442 | internal struct LASTINPUTINFO 443 | { 444 | public uint cbSize; 445 | public uint dwTime; 446 | } 447 | 448 | public static int GetIdleTimeSec() 449 | { 450 | // Get the system uptime 451 | int systemUptime = Environment.TickCount; 452 | // The tick at which the last input was recorded 453 | int LastInputTicks = 0; 454 | // The number of ticks that passed since last input 455 | int IdleTicks = 0; 456 | 457 | // Set the struct 458 | LASTINPUTINFO LastInputInfo = new LASTINPUTINFO(); 459 | LastInputInfo.cbSize = (uint)Marshal.SizeOf(LastInputInfo); 460 | LastInputInfo.dwTime = 0; 461 | 462 | // If we have a value from the function 463 | if (GetLastInputInfo(ref LastInputInfo)) 464 | { 465 | // Get the number of ticks at the point when the last activity was seen 466 | LastInputTicks = (int)LastInputInfo.dwTime; 467 | // Number of idle ticks = system uptime ticks - number of ticks at last input 468 | IdleTicks = systemUptime - LastInputTicks; 469 | } 470 | return IdleTicks / 1000; 471 | } 472 | } 473 | } -------------------------------------------------------------------------------- /ESP/ESP/DoGame.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using CPUZ.Model; 5 | using SharpDX; 6 | using Vector3 = CPUZ.Model.Vector3; 7 | 8 | namespace CPUZ 9 | { 10 | public static class DoGame 11 | { 12 | private static ulong baseAdd; 13 | 14 | private static List playerGName = new List { "PlayerMale", "PlayerFemale" }; 15 | 16 | private static readonly List vehicleGNameVec = 17 | new List { "Uaz", "Buggy", "Dacia", "ABP_Motorbike", "BP_Motorbike", "Boat_PG117" }; 18 | 19 | private static readonly List DropName = 20 | new List { "DroppedItemGroup", "DroppedItemInteractionComponent" }; 21 | 22 | private static readonly List AirdropOrDeathdrop = new List 23 | { 24 | "DeathDropItemPackage", 25 | "Carapackage_RedBox_C", 26 | "CarePackage", 27 | "AircraftCarePackage" 28 | }; 29 | 30 | 31 | //地图需要标记物品列表 32 | private static Dictionary careItemList = new Dictionary 33 | { 34 | {"Item_Head_G_01_Lv3_C", "三级头"}, 35 | {"Item_Head_G_01_Lv3_", "三级头"}, 36 | {"Item_Armor_C_01_Lv3", "Vest3"}, 37 | {"Item_Armor_C_01_Lv3_C", "三级甲"}, 38 | {"Item_Equip_Armor_Lv3", "三级甲"}, 39 | {"Item_Head_F_01_Lv2_C","Helm2" }, 40 | {"Item_Head_F_02_Lv2_C", "Helm2"}, 41 | {"Item_Armor_D_01_Lv2_C", "Vest2"}, 42 | {"Item_Equip_Armor_Lv2_C","Vest2" }, 43 | {"Item_Attach_Weapon_Muzzle_Suppressor_SniperRifle", "Supp(SR)"}, 44 | {"Item_Attach_Weapon_Muzzle_Suppressor_Large", "Supp(AR)"}, 45 | {"Item_Attach_Weapon_Muzzle_Suppressor_Large_C", "Supp(SR)"}, 46 | {"Item_Heal_MedKit", "Meds"}, 47 | {"Item_Heal_FirstAid", "Meds"}, 48 | {"Item_Weapon_Kar98k", "kar98"}, 49 | {"Item_Weapon_Mini14", "mini"}, 50 | {"Item_Weapon_M16A4", "M16"}, 51 | {"Item_Weapon_HK416", "m416"}, 52 | {"Item_Weapon_SCAR-L", "SCAR"}, 53 | {"Item_Weapon_SKS", "sks"}, 54 | {"Item_Attach_Weapon_Upper_ACOG_01", "4x"}, 55 | {"Item_Attach_Weapon_Upper_CQBSS", "8x"}, 56 | {"Item_Attach_Weapon_Upper_CQBSS_C", "8x"}, 57 | {"Item_Boost_PainKiller_C", "YAO"}, 58 | {"Item_Boost_EnergyDrink_C", "YAO"}, 59 | {"Item_Back_C_02_Lv3","三级包" }, 60 | {"Item_Attach_Weapon_Magazine_ExtendedQuickDraw_Large_C","快扩" } 61 | }; 62 | 63 | static DoGame() 64 | { 65 | while (baseAdd == 0) 66 | { 67 | baseAdd = KReader.readPuBase(); 68 | } 69 | } 70 | 71 | static string InCareList(string name) 72 | { 73 | foreach (var g in careItemList) 74 | { 75 | if (name.IndexOf(g.Key, StringComparison.Ordinal) > -1) 76 | { 77 | return g.Value; 78 | } 79 | } 80 | return ""; 81 | } 82 | 83 | public static bool isDropItems(string ActorName) => DropName.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 84 | public static bool isAirdropOrDeathdrop(string ActorName) => AirdropOrDeathdrop.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 85 | public static bool isPlayer(string ActorName) => playerGName.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 86 | public static bool isVehicle(string ActorName) => vehicleGNameVec.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 87 | 88 | public static FTransform GetBoneWithIndex(ulong mesh, Bones bone) 89 | { 90 | var cachedBoneSpaceTransforms = KReader.readUlong(mesh + 0x0790); 91 | return KReader.readFtransform(cachedBoneSpaceTransforms + (ulong)((int)bone * 0x30)); 92 | } 93 | 94 | public static Vector3 GetBoneWithRotation(ulong mesh, Bones bone) 95 | { 96 | var fbone = GetBoneWithIndex(mesh, bone); 97 | var componentToWorld = KReader.readFtransform(mesh + 0x0190); 98 | var matrix = Matrix.Multiply(fbone.ToMatrixWithScale(), componentToWorld.ToMatrixWithScale()); 99 | return new Model.Vector3(matrix.M41, matrix.M42, matrix.M43); 100 | } 101 | 102 | public static JSON_DATA getGameDate() 103 | { 104 | if (baseAdd == 0) 105 | return null; 106 | var json = new JSON_DATA(); 107 | 108 | if (Setting.模式 == 模式.模式一) 109 | { 110 | #region mode1 111 | var pubg = new Pubg(baseAdd + Setting.UWorldOffset); 112 | var uworld = pubg.UWorld; 113 | var gameInstance = uworld.OwningGameInstance; 114 | var localPlayers = gameInstance.LocalPlayers; 115 | var localPlayer = localPlayers[0]; 116 | var viewportClient = localPlayer.ViewportClient; 117 | var pWorld = viewportClient.UWorld; 118 | 119 | for (int i = 0; i < pWorld.PersistentLevel.PlayerCount; i++) 120 | { 121 | var actor = pWorld.PersistentLevel.AActors[i]; 122 | var actorId = actor.ActorID; 123 | var actorGName = Cache.GetGName(actorId);// KReader.getGNameFromId(actorId); 124 | var rootComponent = actor.RootComponent; 125 | var actorLocation = rootComponent.Location; 126 | //玩家 127 | if (actor.isPlayer) 128 | { 129 | var playerState = actor.PlayerState; 130 | var _actorLocation = actorLocation + pWorld.WorldLocation; 131 | 132 | json.players.Add(new Players 133 | { 134 | //AName = actorGName, 135 | AName = playerState.PlayerName, 136 | AID = actorId, 137 | x = _actorLocation.X, 138 | y = _actorLocation.Y, 139 | z = _actorLocation.Z, 140 | health = actor.Health, 141 | id = playerState.PlayerId, 142 | rotator = rootComponent.RelativeRotation.Y, 143 | t = playerState.TeamNumber, 144 | isInactive = playerState.bIsInactive, 145 | rx = rootComponent.RelativeLocation.X, 146 | ry = rootComponent.RelativeLocation.Y, 147 | rz = rootComponent.RelativeLocation.Z, 148 | mesh = actor.Mesh.mesh 149 | }); 150 | } 151 | //车辆 152 | else if (actor.isVehicle) 153 | { 154 | var _actorLocation = actorLocation + pWorld.WorldLocation; 155 | json.vehicles.Add(new Vehicle 156 | { 157 | v = actorGName.Substring(0, 4), 158 | x = _actorLocation.X, 159 | y = _actorLocation.Y, 160 | z = _actorLocation.Z, 161 | rx = rootComponent.RelativeLocation.X, 162 | ry = rootComponent.RelativeLocation.Y, 163 | rz = rootComponent.RelativeLocation.Z, 164 | }); 165 | } 166 | //物品 167 | else if (actor.isDropItems) 168 | { 169 | var droppedItemArray = actor.DropItems; 170 | var droppedItemCount = actor.DropItemsCount; 171 | for (var j = 0; j < droppedItemCount; j++) 172 | { 173 | var aDroppedItem = droppedItemArray[j]; 174 | var UItem = aDroppedItem.UItem; 175 | //var UItemID = UItem.ItemId; 176 | var itemName = UItem.ItemName; 177 | if (string.IsNullOrEmpty(InCareList(itemName))) continue; 178 | var droppedLocation = aDroppedItem.Location; 179 | var relativeLocation = droppedLocation + actorLocation; 180 | droppedLocation += actorLocation + pWorld.WorldLocation; 181 | //a.Add(itemName); 182 | json.items.Add(new Item 183 | { 184 | n = InCareList(itemName), 185 | x = droppedLocation.X, 186 | y = droppedLocation.Y, 187 | z = droppedLocation.Z, 188 | rx = relativeLocation.X, 189 | ry = relativeLocation.Y, 190 | rz = relativeLocation.Z 191 | }); 192 | } 193 | } 194 | else if (actor.isAirdropOrDeathdrop) 195 | { 196 | //var droppedItemArray = actor.AItemPackages; 197 | //var droppedItemCount = actor.AItemPackagesCount; 198 | //for (var j = 0; j < droppedItemCount; j++) 199 | //{ 200 | // var dropItem = droppedItemArray[j]; 201 | var _actorLocation = actorLocation + pWorld.WorldLocation; 202 | 203 | json.vehicles.Add(new Vehicle 204 | { 205 | v = actor.ActorName.Substring(0, 4), 206 | x = _actorLocation.X, 207 | y = _actorLocation.Y, 208 | z = _actorLocation.Z, 209 | rx = rootComponent.RelativeLocation.X, 210 | ry = rootComponent.RelativeLocation.Y, 211 | rz = rootComponent.RelativeLocation.Z 212 | }); 213 | //} 214 | } 215 | } 216 | 217 | var povRotation = localPlayer.PlayerController.PlayerCameraManager.povRotation; 218 | var povLocation = localPlayer.PlayerController.PlayerCameraManager.povLocation; 219 | //get zone info 220 | json.camera.Add(new Camera { n = "Rotation", X = povRotation.X, Y = povRotation.Y, Z = povRotation.Z }); 221 | json.camera.Add(new Camera { n = "Location", X = povLocation.X, Y = povLocation.Y, Z = povLocation.Z }); 222 | json.camera.Add(new Camera { n = "Fov", X = localPlayer.PlayerController.PlayerCameraManager.Fov, Y = 0, Z = 0 }); 223 | json.zone.Add(new Zone { r = pWorld.GameState.blueR, x = pWorld.GameState.blue.X, y = pWorld.GameState.blue.Y }); 224 | json.zone.Add(new Zone { r = pWorld.GameState.whiteR, x = pWorld.GameState.white.X, y = pWorld.GameState.white.Y }); 225 | #endregion 226 | } 227 | else 228 | { 229 | var m_UWorld = KReader.readUlong(KReader.m_PUBase + Setting.UWorldOffset); 230 | var m_gameInstance = KReader.readUlong(m_UWorld + 0x140); 231 | var m_ULocalPlayer = KReader.readUlong(m_gameInstance + 0x38); 232 | var m_localPlayer = KReader.readUlong(m_ULocalPlayer + 0x0); 233 | var m_viewportclient = KReader.readUlong(m_localPlayer + 0x58); 234 | var m_localPawn = KReader.readUlong(m_localPlayer + 0x3A8); 235 | //var m_localPlayerState = KReader.readUlong(m_localPawn + 0x03C0); 236 | var m_PWorld = KReader.readUlong(m_viewportclient + 0x80); 237 | var m_ULevel = KReader.readUlong(m_PWorld + 0x30); 238 | var m_playerCount = KReader.readInt32(m_ULevel + 0xA8); 239 | 240 | var m_localPlayerControl = KReader.readUlong(m_localPlayer + 0x30); 241 | var m_localPlayerCamerManager = KReader.readUlong(m_localPlayerControl + 0x438); 242 | 243 | var ATslGameState = KReader.readUlong(m_PWorld + 0x00F8); 244 | var m_AActorPtr = KReader.readUlong(m_ULevel + 0xA0); 245 | 246 | 247 | var povRotation = KReader.readVec(m_localPlayerCamerManager + 0x42C); 248 | var povLocation = KReader.readVec(m_localPlayerCamerManager + 0x420); 249 | var Fov = KReader.readFloat(m_localPlayerCamerManager + 0x438); 250 | 251 | 252 | //get zone info 253 | Vector3 blue = KReader.readVec(ATslGameState + 0x440); 254 | float blueR = KReader.readFloat(ATslGameState + 0x44C); 255 | 256 | Vector3 white = KReader.readVec(ATslGameState + 0x450); 257 | float whiteR = KReader.readFloat(ATslGameState + 0x45C); 258 | 259 | 260 | json.camera.Add(new Camera { n = "Rotation", X = povRotation.X, Y = povRotation.Y, Z = povRotation.Z }); 261 | json.camera.Add(new Camera { n = "Location", X = povLocation.X, Y = povLocation.Y, Z = povLocation.Z }); 262 | json.camera.Add(new Camera { n = "Fov", X = Fov, Y = 0, Z = 0 }); 263 | json.zone.Add(new Zone { r = blueR, x = blue.X, y = blue.Y }); 264 | json.zone.Add(new Zone { r = whiteR, x = white.X, y = white.Y }); 265 | 266 | var worldLocation = new Vector3 267 | { 268 | X = KReader.readInt32(m_PWorld + 0x918), 269 | Y = KReader.readInt32(m_PWorld + 0x91C), 270 | Z = KReader.readInt32(m_PWorld + 0x920) 271 | }; 272 | //this just for test 273 | //List a = new List(); 274 | 275 | for (int i = 0; i < m_playerCount; i++) 276 | { 277 | var curActor = KReader.readUlong(m_AActorPtr + (ulong)(i * 0x8)); 278 | var curActorID = KReader.readInt32(curActor + 0x0018); 279 | var actorGName = Cache.GetGName(curActorID);// KReader.getGNameFromId(curActorID); 280 | var rootCmpPtr = KReader.readUlong(curActor + 0x0180); 281 | var actorLocation = KReader.readVec(rootCmpPtr + 0x1A0); 282 | var relativeLocation = KReader.readVec(rootCmpPtr + 0x01E0); 283 | //玩家 284 | if (isPlayer(actorGName)) 285 | { 286 | var playerState = KReader.readUlong(curActor + 0x03C0); 287 | var actorTeam = KReader.readInt32(playerState + 0x0444); 288 | var _actorLocation = actorLocation + worldLocation; 289 | var Health = KReader.readFloat(curActor + 0x107C); 290 | ulong mesh = KReader.readUlong(curActor + 0x0400); 291 | var RelativeRotation = KReader.readVec(rootCmpPtr + 0x01EC); 292 | var playerId = KReader.readInt32(playerState + 0x03C8); 293 | var isInactive = KReader.readChar(playerState + 0x03CC); 294 | 295 | json.players.Add(new Players 296 | { 297 | x = _actorLocation.X, 298 | y = _actorLocation.Y, 299 | z = _actorLocation.Z, 300 | health = Health, 301 | id = playerId, 302 | rotator = RelativeRotation.Y, 303 | t = actorTeam, 304 | isInactive = isInactive, 305 | rx = relativeLocation.X, 306 | ry = relativeLocation.Y, 307 | rz = relativeLocation.Z, 308 | mesh = mesh 309 | }); 310 | } 311 | //车辆 312 | else if (isVehicle(actorGName)) 313 | { 314 | var _actorLocation = actorLocation + worldLocation; 315 | 316 | json.vehicles.Add(new Vehicle 317 | { 318 | v = actorGName.Substring(0, 4), 319 | x = _actorLocation.X, 320 | y = _actorLocation.Y, 321 | z = _actorLocation.Z, 322 | rx = relativeLocation.X, 323 | ry = relativeLocation.Y, 324 | rz = relativeLocation.Z, 325 | }); 326 | } 327 | //物品 328 | else if (isDropItems(actorGName)) 329 | { 330 | var DroppedItemArray = KReader.readUlong(curActor + 0x02D8); 331 | var DroppedItemCount = KReader.readInt32(curActor + 0x02E0); 332 | 333 | for (var j = 0; j < DroppedItemCount; j++) 334 | { 335 | var ADroppedItem = KReader.readUlong(DroppedItemArray + (ulong)(j * 0x10)); 336 | var UItem = KReader.readUlong(ADroppedItem + 0x0448); 337 | var UItemID = KReader.readInt32(UItem + 0x18); 338 | var itemName = Cache.GetGName(UItemID);// KReader.getGNameFromId(UItemID); 339 | 340 | if (string.IsNullOrEmpty(InCareList(itemName))) continue; 341 | var droppedLocation = KReader.readVec(ADroppedItem + 0x01E0); 342 | var _relativeLocation = droppedLocation + actorLocation; 343 | droppedLocation = droppedLocation + actorLocation + worldLocation; 344 | 345 | //a.Add(itemName); 346 | json.items.Add(new Item 347 | { 348 | n = InCareList(itemName), 349 | x = droppedLocation.X, 350 | y = droppedLocation.Y, 351 | z = droppedLocation.Z, 352 | rx = _relativeLocation.X, 353 | ry = _relativeLocation.Y, 354 | rz = _relativeLocation.Z 355 | }); 356 | } 357 | } 358 | else if (isAirdropOrDeathdrop(actorGName)) 359 | { 360 | //var droppedItemArray = actor.AItemPackages; 361 | //var droppedItemCount = actor.AItemPackagesCount; 362 | //for (var j = 0; j < droppedItemCount; j++) 363 | //{ 364 | // var dropItem = droppedItemArray[j]; 365 | var _actorLocation = actorLocation+ worldLocation; 366 | json.vehicles.Add(new Vehicle 367 | { 368 | v = actorGName.Substring(0, 3), 369 | x = _actorLocation.X, 370 | y = _actorLocation.Y, 371 | z = _actorLocation.Z, 372 | rx = relativeLocation.X, 373 | ry = relativeLocation.Y, 374 | rz = relativeLocation.Z 375 | }); 376 | //} 377 | } 378 | } 379 | } 380 | return json; 381 | 382 | } 383 | 384 | } 385 | } -------------------------------------------------------------------------------- /ESP/ESP/HotKeyManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Threading; 4 | using System.Windows.Forms; 5 | 6 | namespace CPUZ 7 | { 8 | public static class HotKeyManager 9 | { 10 | public static event EventHandler HotKeyPressed; 11 | 12 | public static int RegisterHotKey(Keys key, KeyModifiers modifiers) 13 | { 14 | _windowReadyEvent.WaitOne(); 15 | int id = System.Threading.Interlocked.Increment(ref _id); 16 | _wnd.Invoke(new RegisterHotKeyDelegate(RegisterHotKeyInternal), _hwnd, id, (uint)modifiers, (uint)key); 17 | return id; 18 | } 19 | 20 | public static void UnregisterHotKey(int id) 21 | { 22 | _wnd.Invoke(new UnRegisterHotKeyDelegate(UnRegisterHotKeyInternal), _hwnd, id); 23 | } 24 | 25 | delegate void RegisterHotKeyDelegate(IntPtr hwnd, int id, uint modifiers, uint key); 26 | delegate void UnRegisterHotKeyDelegate(IntPtr hwnd, int id); 27 | 28 | private static void RegisterHotKeyInternal(IntPtr hwnd, int id, uint modifiers, uint key) 29 | { 30 | RegisterHotKey(hwnd, id, modifiers, key); 31 | } 32 | 33 | private static void UnRegisterHotKeyInternal(IntPtr hwnd, int id) 34 | { 35 | UnregisterHotKey(_hwnd, id); 36 | } 37 | 38 | private static void OnHotKeyPressed(HotKeyEventArgs e) 39 | { 40 | if (HotKeyManager.HotKeyPressed != null) 41 | { 42 | HotKeyManager.HotKeyPressed(null, e); 43 | } 44 | } 45 | 46 | private static volatile MessageWindow _wnd; 47 | private static volatile IntPtr _hwnd; 48 | private static ManualResetEvent _windowReadyEvent = new ManualResetEvent(false); 49 | static HotKeyManager() 50 | { 51 | Thread messageLoop = new Thread(delegate () 52 | { 53 | Application.Run(new MessageWindow()); 54 | }); 55 | messageLoop.Name = "MessageLoopThread"; 56 | messageLoop.IsBackground = true; 57 | messageLoop.Start(); 58 | } 59 | 60 | private class MessageWindow : Form 61 | { 62 | public MessageWindow() 63 | { 64 | _wnd = this; 65 | _hwnd = this.Handle; 66 | _windowReadyEvent.Set(); 67 | } 68 | 69 | protected override void WndProc(ref Message m) 70 | { 71 | if (m.Msg == WM_HOTKEY) 72 | { 73 | HotKeyEventArgs e = new HotKeyEventArgs(m.LParam); 74 | HotKeyManager.OnHotKeyPressed(e); 75 | } 76 | 77 | base.WndProc(ref m); 78 | } 79 | 80 | protected override void SetVisibleCore(bool value) 81 | { 82 | // Ensure the window never becomes visible 83 | base.SetVisibleCore(false); 84 | } 85 | 86 | private const int WM_HOTKEY = 0x312; 87 | } 88 | 89 | [DllImport("user32", SetLastError = true)] 90 | private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); 91 | 92 | [DllImport("user32", SetLastError = true)] 93 | private static extern bool UnregisterHotKey(IntPtr hWnd, int id); 94 | 95 | private static int _id = 0; 96 | } 97 | 98 | 99 | public class HotKeyEventArgs : EventArgs 100 | { 101 | public readonly Keys Key; 102 | public readonly KeyModifiers Modifiers; 103 | 104 | public HotKeyEventArgs(Keys key, KeyModifiers modifiers) 105 | { 106 | this.Key = key; 107 | this.Modifiers = modifiers; 108 | } 109 | 110 | public HotKeyEventArgs(IntPtr hotKeyParam) 111 | { 112 | uint param = (uint)hotKeyParam.ToInt64(); 113 | Key = (Keys)((param & 0xffff0000) >> 16); 114 | Modifiers = (KeyModifiers)(param & 0x0000ffff); 115 | } 116 | } 117 | 118 | [Flags] 119 | public enum KeyModifiers 120 | { 121 | Alt = 1, 122 | Control = 2, 123 | Shift = 4, 124 | Windows = 8, 125 | NoRepeat = 0x4000 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /ESP/ESP/KReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Text.RegularExpressions; 4 | using CPUZ.Model; 5 | using SharpDX; 6 | using Vector3 = CPUZ.Model.Vector3; 7 | 8 | namespace CPUZ 9 | { 10 | 11 | /// 12 | /// 数据包内容的头信息 13 | /// 14 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 15 | 16 | public struct ReadStruct 17 | { 18 | public static readonly int Size = Marshal.SizeOf(typeof(ReadStruct)); 19 | [MarshalAs(UnmanagedType.I8)] 20 | public ulong UserBufferAdress; 21 | [MarshalAs(UnmanagedType.I8)] 22 | public ulong GameAddressOffset; 23 | [MarshalAs(UnmanagedType.I8)] 24 | public ulong ReadSize; 25 | [MarshalAs(UnmanagedType.I4)] 26 | public uint UserPID; 27 | [MarshalAs(UnmanagedType.I4)] 28 | public uint GamePID; 29 | [MarshalAs(UnmanagedType.Bool)] 30 | public bool WriteOrRead; 31 | [MarshalAs(UnmanagedType.I4)] 32 | public uint ProtocolMsg; 33 | [MarshalAs(UnmanagedType.Bool)] 34 | public bool WriteOrRead2; 35 | [MarshalAs(UnmanagedType.I4)] 36 | public uint ProtocolMsg2; 37 | } 38 | 39 | 40 | 41 | public unsafe static class KReader 42 | { 43 | public static ulong m_PUBase = 0; 44 | 45 | //private const string DeviceName = "\\\\.\\putyourdNameHere"; 46 | private const string DeviceName = "\\\\.\\lolClientBase"; 47 | 48 | const uint GENERIC_READ = 0x80000000; 49 | const int GENERIC_WRITE = 0x40000000; 50 | const uint OPEN_EXISTING = 3; 51 | const int FILE_SHARE_READ = 1; 52 | const int FILE_SHARE_WRITE = 2; 53 | static IntPtr handle; 54 | 55 | 56 | 57 | [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = System.Runtime.InteropServices.CharSet.Unicode)] 58 | static extern unsafe System.IntPtr CreateFile 59 | ( 60 | string FileName, // file name 61 | uint DesiredAccess, // access mode 62 | uint ShareMode, // share mode 63 | uint SecurityAttributes, // Security Attributes 64 | uint CreationDisposition, // how to create 65 | uint FlagsAndAttributes, // file attributes 66 | int hTemplateFile // handle to template file 67 | ); 68 | 69 | [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)] 70 | static extern unsafe bool ReadFile 71 | ( 72 | System.IntPtr hFile, // handle to file 73 | void* pBuffer, // data buffer 74 | uint NumberOfBytesToRead, // number of bytes to read 75 | uint* pNumberOfBytesRead, // number of bytes read 76 | uint Overlapped // overlapped buffer 77 | ); 78 | 79 | [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)] 80 | public static extern unsafe bool WriteFile 81 | ( 82 | System.IntPtr hFile, // handle to file 83 | void* pBuffer, // data buffer 84 | int NumberOfBytesToRead, // number of bytes to read 85 | int* pNumberOfBytesRead, // number of bytes read 86 | uint Overlapped // overlapped buffer 87 | ); 88 | 89 | [System.Runtime.InteropServices.DllImport("kernel32", SetLastError = true)] 90 | static extern unsafe bool CloseHandle 91 | ( 92 | System.IntPtr hObject // handle to object 93 | ); 94 | 95 | 96 | public static bool Close() 97 | { 98 | return CloseHandle(handle); 99 | } 100 | 101 | public static ulong readPuBase() 102 | { 103 | ulong baseAdd = 0; 104 | void* read = null; 105 | ReadStruct rStruct = new ReadStruct() 106 | { 107 | UserBufferAdress = (ulong)&baseAdd, 108 | GameAddressOffset = (ulong)read, 109 | ReadSize = (ulong)Marshal.SizeOf(typeof(ulong)), 110 | UserPID = CommonUtil.GetCurrentProcessId(), 111 | GamePID = 0, 112 | WriteOrRead = true, 113 | ProtocolMsg = 1, 114 | WriteOrRead2 = true, 115 | ProtocolMsg2 = 0 116 | }; 117 | 118 | // open the existing file for reading 119 | handle = CreateFile 120 | ( 121 | DeviceName, 122 | GENERIC_READ | GENERIC_WRITE, 123 | FILE_SHARE_READ | FILE_SHARE_WRITE, 124 | 0, 125 | OPEN_EXISTING, 126 | 0, 127 | 0 128 | ); 129 | 130 | if (handle != System.IntPtr.Zero) 131 | { 132 | if (WriteFile(handle, &rStruct, ReadStruct.Size, null, 0)) 133 | { 134 | m_PUBase = baseAdd; 135 | } 136 | } 137 | return baseAdd; 138 | } 139 | 140 | 141 | public static T Reader(ulong w_read) 142 | { 143 | var output = default(T); 144 | var size = Marshal.SizeOf(typeof(T)); 145 | var writeAddr = Marshal.AllocHGlobal(size); 146 | try 147 | { 148 | ReadStruct rStruct = new ReadStruct() 149 | { 150 | UserBufferAdress = (ulong) writeAddr, 151 | GameAddressOffset = (ulong) w_read, 152 | ReadSize = (ulong) size, 153 | UserPID = CommonUtil.GetCurrentProcessId(), 154 | GamePID = 0, 155 | WriteOrRead = true, 156 | ProtocolMsg = 0, 157 | WriteOrRead2 = true, 158 | ProtocolMsg2 = 0 159 | }; 160 | 161 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 162 | output = Marshal.PtrToStructure(writeAddr); 163 | } 164 | catch (Exception e) 165 | { 166 | //todo:loging the excption 167 | } 168 | finally 169 | { 170 | Marshal.FreeHGlobal(writeAddr); 171 | } 172 | return output; 173 | } 174 | 175 | 176 | public static FTransform readFtransform(ulong w_read, int sdf = 0) 177 | { 178 | FTransform writeMe; 179 | ReadStruct rStruct = new ReadStruct() 180 | { 181 | UserBufferAdress = (ulong)&writeMe, 182 | GameAddressOffset = (ulong)w_read, 183 | ReadSize = (ulong)Marshal.SizeOf(typeof(FTransform)), 184 | UserPID = CommonUtil.GetCurrentProcessId(), 185 | GamePID = 0, 186 | WriteOrRead = true, 187 | ProtocolMsg = 0, 188 | WriteOrRead2 = true, 189 | ProtocolMsg2 = 0 190 | }; 191 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 192 | 193 | return writeMe; 194 | } 195 | 196 | public static FTransform readFtransform2(ulong ptr) 197 | { 198 | //i know this is shitty. I still dont care. 199 | float quatX = readFloat(ptr + 0x00); 200 | float quatY = readFloat(ptr + 0x04); 201 | float quatZ = readFloat(ptr + 0x08); 202 | float quatW = readFloat(ptr + 0x0C); 203 | 204 | float transX = readFloat(ptr + 0x0010); 205 | float transY = readFloat(ptr + 0x0014); 206 | float transZ = readFloat(ptr + 0x0018); 207 | 208 | float scaleX = readFloat(ptr + 0x0020); 209 | float scaleY = readFloat(ptr + 0x0024); 210 | float scaleZ = readFloat(ptr + 0x0028); 211 | 212 | Vector4 fQuat = new Vector4(quatW, quatX, quatY, quatZ); 213 | Vector3 trans = new Vector3(transX, transY, transZ); 214 | Vector3 scale = new Vector3(scaleX, scaleY, scaleZ); 215 | FTransform fTransform = new FTransform(fQuat, trans, scale); 216 | return fTransform; 217 | } 218 | 219 | 220 | 221 | 222 | 223 | 224 | public static Vector3 readVec(ulong w_read, int sdf = 0) 225 | { 226 | Vector3 writeMe; 227 | ReadStruct rStruct = new ReadStruct() 228 | { 229 | UserBufferAdress = (ulong)&writeMe, 230 | GameAddressOffset = (ulong)w_read, 231 | ReadSize = (ulong)Marshal.SizeOf(typeof(Vector3)), 232 | UserPID = CommonUtil.GetCurrentProcessId(), 233 | GamePID = 0, 234 | WriteOrRead = true, 235 | ProtocolMsg = 0, 236 | WriteOrRead2 = true, 237 | ProtocolMsg2 = 0 238 | }; 239 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 240 | 241 | return writeMe; 242 | } 243 | 244 | public static ulong readUlong(ulong w_read, int sdf = 0) 245 | { 246 | ulong writeMe; 247 | 248 | ReadStruct rStruct = new ReadStruct() 249 | { 250 | UserBufferAdress = (ulong)&writeMe, 251 | GameAddressOffset = (ulong)w_read, 252 | ReadSize = (ulong)Marshal.SizeOf(typeof(ulong)), 253 | UserPID = CommonUtil.GetCurrentProcessId(), 254 | GamePID = 0, 255 | WriteOrRead = true, 256 | ProtocolMsg = 0, 257 | WriteOrRead2 = true, 258 | ProtocolMsg2 = 0 259 | }; 260 | 261 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 262 | return writeMe; 263 | } 264 | 265 | 266 | public static Pov readPov(ulong w_read) 267 | { 268 | Pov writeMe; 269 | ReadStruct rStruct = new ReadStruct() 270 | { 271 | UserBufferAdress = (ulong)&writeMe, 272 | GameAddressOffset = (ulong)w_read, 273 | ReadSize = (ulong)Marshal.SizeOf(typeof(Int32)), 274 | UserPID = CommonUtil.GetCurrentProcessId(), 275 | GamePID = 0, 276 | WriteOrRead = true, 277 | ProtocolMsg = 0, 278 | WriteOrRead2 = true, 279 | ProtocolMsg2 = 0 280 | }; 281 | 282 | 283 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 284 | return writeMe; 285 | } 286 | 287 | public static Int32 readInt32(ulong w_read, int sdf = 0) 288 | { 289 | Int32 writeMe; 290 | 291 | ReadStruct rStruct = new ReadStruct() 292 | { 293 | UserBufferAdress = (ulong)&writeMe, 294 | GameAddressOffset = (ulong)w_read, 295 | ReadSize = (ulong)Marshal.SizeOf(typeof(Int32)), 296 | UserPID = CommonUtil.GetCurrentProcessId(), 297 | GamePID = 0, 298 | WriteOrRead = true, 299 | ProtocolMsg = 0, 300 | WriteOrRead2 = true, 301 | ProtocolMsg2 = 0 302 | }; 303 | 304 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 305 | return writeMe; 306 | } 307 | public static float readFloat(ulong w_read, int sdf = 0) 308 | { 309 | float writeMe; 310 | 311 | ReadStruct rStruct = new ReadStruct() 312 | { 313 | UserBufferAdress = (ulong)&writeMe, 314 | GameAddressOffset = (ulong)w_read, 315 | ReadSize = (ulong)Marshal.SizeOf(typeof(float)), 316 | UserPID = CommonUtil.GetCurrentProcessId(), 317 | GamePID = 0, 318 | WriteOrRead = true, 319 | ProtocolMsg = 0, 320 | WriteOrRead2 = true, 321 | ProtocolMsg2 = 0 322 | }; 323 | 324 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 325 | return writeMe; 326 | } 327 | 328 | public static char readChar(ulong w_read, int sdf = 0) 329 | { 330 | char writeMe; 331 | 332 | ReadStruct rStruct = new ReadStruct() 333 | { 334 | UserBufferAdress = (ulong)&writeMe, 335 | GameAddressOffset = (ulong)w_read, 336 | ReadSize = (ulong)Marshal.SizeOf(typeof(char)), 337 | UserPID = CommonUtil.GetCurrentProcessId(), 338 | GamePID = 0, 339 | WriteOrRead = true, 340 | ProtocolMsg = 0, 341 | WriteOrRead2 = true, 342 | ProtocolMsg2 = 0 343 | }; 344 | 345 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 346 | return writeMe; 347 | } 348 | 349 | 350 | public static byte[] readSize(ulong w_read, Int32 w_readSize, int asd = 0) 351 | { 352 | var writeMe = new byte[w_readSize]; 353 | fixed (byte* n = writeMe) 354 | { 355 | 356 | var rStruct = new ReadStruct() 357 | { 358 | UserBufferAdress = (ulong)n, 359 | GameAddressOffset = (ulong)w_read, 360 | ReadSize = (ulong)w_readSize - 2, 361 | UserPID = CommonUtil.GetCurrentProcessId(), 362 | GamePID = 0, 363 | WriteOrRead = true, 364 | ProtocolMsg = 0, 365 | WriteOrRead2 = true, 366 | ProtocolMsg2 = 0 367 | }; 368 | WriteFile(handle, &rStruct, ReadStruct.Size, null, 0); 369 | 370 | for (var i = 0; i < w_readSize; i++) 371 | { 372 | if (n[i] != 0) 373 | writeMe[i] = n[i]; 374 | } 375 | return writeMe; 376 | } 377 | } 378 | 379 | public static string getGNameFromId(int w_id) 380 | { 381 | var GNames = readUlong(m_PUBase + Setting.GNameOffset); 382 | var singleNameChunk = readUlong(GNames + (ulong)(w_id / 0x4000) * 8); 383 | var singleNamePtr = readUlong(singleNameChunk + (ulong)(8 * (w_id % 0x4000))); 384 | 385 | var name = System.Text.Encoding.Default.GetString(readSize(singleNamePtr + 16, 64)); 386 | return name; 387 | } 388 | 389 | public static string ReadStringUnicode(ulong address, int lenght) 390 | { 391 | return System.Text.Encoding.Unicode.GetString(readSize(address, lenght * 2)); 392 | } 393 | 394 | } 395 | 396 | } 397 | -------------------------------------------------------------------------------- /ESP/ESP/Model/APlayerCameraManager.cs: -------------------------------------------------------------------------------- 1 | namespace CPUZ.Model 2 | { 3 | public class PlayerCameraManager 4 | { 5 | public FCameraCacheEntry CameraCache { get; set; } 6 | } 7 | 8 | public class FCameraCacheEntry 9 | { 10 | public FMinimalViewInfo POV { get; set; } 11 | } 12 | 13 | public class FMinimalViewInfo 14 | { 15 | public Vector3 Location { get; set; } 16 | public FRotator Rotation { get; set; } 17 | public float Fov { get; set; } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /ESP/ESP/Model/JSON_DATA.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CPUZ.Model 4 | { 5 | public class JSON_DATA 6 | { 7 | public List camera { get; set; } = new List(); 8 | public List items { get; set; } = new List(); 9 | public List players { get; set; } = new List(); 10 | public List vehicles { get; set; } = new List(); 11 | public List zone { get; set; } = new List(); 12 | } 13 | 14 | public class Camera 15 | { 16 | public string n { get; set; } 17 | 18 | public float X { get; set; } 19 | public float Y { get; set; } 20 | public float Z { get; set; } 21 | } 22 | 23 | public class Item 24 | { 25 | public string n { get; set; } 26 | 27 | public float x { get; set; } 28 | public float y { get; set; } 29 | public float z { get; set; } 30 | 31 | public float rx { get; set; } 32 | public float ry { get; set; } 33 | public float rz { get; set; } 34 | 35 | 36 | } 37 | 38 | public class Players 39 | { 40 | public string AName { get; set; } 41 | public int AID { get; set; } 42 | public int id { get; set; } 43 | public float health { get; set; } 44 | 45 | public int isInactive { get; set; } 46 | 47 | public float rotator { get; set; } 48 | 49 | public int t { get; set; } 50 | 51 | public float x { get; set; } 52 | public float y { get; set; } 53 | public float z { get; set; } 54 | public float rx { get; set; } 55 | public float ry { get; set; } 56 | public float rz { get; set; } 57 | 58 | public ulong mesh { get; set; } 59 | } 60 | 61 | public class Vehicle 62 | { 63 | public string v { get; set; } 64 | public float x { get; set; } 65 | public float y { get; set; } 66 | public float z { get; set; } 67 | 68 | public float rx { get; set; } 69 | public float ry { get; set; } 70 | public float rz { get; set; } 71 | } 72 | 73 | public class Zone 74 | { 75 | public float r { get; set; } 76 | public float x { get; set; } 77 | public float y { get; set; } 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /ESP/ESP/Model/UEClass.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using SharpDX; 4 | 5 | namespace CPUZ.Model 6 | { 7 | public struct FTransform 8 | { 9 | public Vector4 Rotation; 10 | public Vector3 Translation; 11 | public char UnknownData00; 12 | public Vector3 Scale3D; 13 | public char UnknownData01; 14 | 15 | public FTransform(Vector4 rot, Vector3 translation, Vector3 scale) 16 | { 17 | Rotation = rot; 18 | UnknownData00 = ' '; 19 | Translation = translation; 20 | Scale3D = scale; 21 | UnknownData01 = ' '; 22 | } 23 | 24 | public Matrix ToMatrixWithScale() 25 | { 26 | var m = new Matrix(); 27 | 28 | m.M41 = Translation.X; 29 | m.M42 = Translation.Y; 30 | m.M43 = Translation.Z; 31 | 32 | var x2 = Rotation.X + Rotation.X; 33 | var y2 = Rotation.Y + Rotation.Y; 34 | var z2 = Rotation.Z + Rotation.Z; 35 | 36 | var xx2 = Rotation.X * x2; 37 | var yy2 = Rotation.Y * y2; 38 | var zz2 = Rotation.Z * z2; 39 | m.M11 = (1.0f - (yy2 + zz2)) * Scale3D.X; 40 | m.M22 = (1.0f - (xx2 + zz2)) * Scale3D.Y; 41 | m.M33 = (1.0f - (xx2 + yy2)) * Scale3D.Z; 42 | 43 | 44 | var yz2 = Rotation.Y * z2; 45 | var wx2 = Rotation.W * x2; 46 | m.M32 = (yz2 - wx2) * Scale3D.Z; 47 | m.M23 = (yz2 + wx2) * Scale3D.Y; 48 | 49 | 50 | var xy2 = Rotation.X * y2; 51 | var wz2 = Rotation.W * z2; 52 | m.M21 = (xy2 - wz2) * Scale3D.Y; 53 | m.M12 = (xy2 + wz2) * Scale3D.X; 54 | 55 | 56 | var xz2 = Rotation.X * z2; 57 | var wy2 = Rotation.W * y2; 58 | m.M31 = (xz2 + wy2) * Scale3D.Z; 59 | m.M13 = (xz2 - wy2) * Scale3D.X; 60 | 61 | m.M14 = 0.0f; 62 | m.M24 = 0.0f; 63 | m.M34 = 0.0f; 64 | m.M44 = 1.0f; 65 | 66 | return m; 67 | } 68 | } 69 | 70 | public enum Bones 71 | { 72 | Root = 0, 73 | pelvis = 1, 74 | spine_01 = 2, 75 | spine_02 = 3, 76 | spine_03 = 4, 77 | neck_01 = 5, 78 | Head = 6, 79 | face_root = 7, 80 | eyebrows_pos_root = 8, 81 | eyebrows_root = 9, 82 | eyebrows_r = 10, 83 | eyebrows_l = 11, 84 | eyebrow_l = 12, 85 | eyebrow_r = 13, 86 | forehead_root = 14, 87 | forehead = 15, 88 | jaw_pos_root = 16, 89 | jaw_root = 17, 90 | jaw = 18, 91 | mouth_down_pos_root = 19, 92 | mouth_down_root = 20, 93 | lip_bm_01 = 21, 94 | lip_bm_02 = 22, 95 | lip_br = 23, 96 | lip_bl = 24, 97 | jaw_01 = 25, 98 | jaw_02 = 26, 99 | cheek_pos_root = 27, 100 | cheek_root = 28, 101 | cheek_r = 29, 102 | cheek_l = 30, 103 | nose_side_root = 31, 104 | nose_side_r_01 = 32, 105 | nose_side_r_02 = 33, 106 | nose_side_l_01 = 34, 107 | nose_side_l_02 = 35, 108 | eye_pos_r_root = 36, 109 | eye_r_root = 37, 110 | eye_rot_r_root = 38, 111 | eye_lid_u_r = 39, 112 | eye_r = 40, 113 | eye_lid_b_r = 41, 114 | eye_pos_l_root = 42, 115 | eye_l_root = 43, 116 | eye_rot_l_root = 44, 117 | eye_lid_u_l = 45, 118 | eye_l = 46, 119 | eye_lid_b_l = 47, 120 | nose_pos_root = 48, 121 | nose = 49, 122 | mouth_up_pos_root = 50, 123 | mouth_up_root = 51, 124 | lip_ul = 52, 125 | lip_um_01 = 53, 126 | lip_um_02 = 54, 127 | lip_ur = 55, 128 | lip_l = 56, 129 | lip_r = 57, 130 | hair_root = 58, 131 | hair_b_01 = 59, 132 | hair_b_02 = 60, 133 | hair_l_01 = 61, 134 | hair_l_02 = 62, 135 | hair_r_01 = 63, 136 | hair_r_02 = 64, 137 | hair_f_02 = 65, 138 | hair_f_01 = 66, 139 | hair_b_pt_01 = 67, 140 | hair_b_pt_02 = 68, 141 | hair_b_pt_03 = 69, 142 | hair_b_pt_04 = 70, 143 | hair_b_pt_05 = 71, 144 | camera_fpp = 72, 145 | GunReferencePoint = 73, 146 | GunRef = 74, 147 | breast_l = 75, 148 | breast_r = 76, 149 | clavicle_l = 77, 150 | upperarm_l = 78, 151 | lowerarm_l = 79, 152 | hand_l = 80, 153 | thumb_01_l = 81, 154 | thumb_02_l = 82, 155 | thumb_03_l = 83, 156 | thumb_04_l_MBONLY = 84, 157 | index_01_l = 85, 158 | index_02_l = 86, 159 | index_03_l = 87, 160 | index_04_l_MBONLY = 88, 161 | middle_01_l = 89, 162 | middle_02_l = 90, 163 | middle_03_l = 91, 164 | middle_04_l_MBONLY = 92, 165 | ring_01_l = 93, 166 | ring_02_l = 94, 167 | ring_03_l = 95, 168 | ring_04_l_MBONLY = 96, 169 | pinky_01_l = 97, 170 | pinky_02_l = 98, 171 | pinky_03_l = 99, 172 | pinky_04_l_MBONLY = 100, 173 | item_l = 101, 174 | lowerarm_twist_01_l = 102, 175 | upperarm_twist_01_l = 103, 176 | clavicle_r = 104, 177 | upperarm_r = 105, 178 | lowerarm_r = 106, 179 | hand_r = 107, 180 | thumb_01_r = 108, 181 | thumb_02_r = 109, 182 | thumb_03_r = 110, 183 | thumb_04_r_MBONLY = 111, 184 | index_01_r = 112, 185 | index_02_r = 113, 186 | index_03_r = 114, 187 | index_04_r_MBONLY = 115, 188 | middle_01_r = 116, 189 | middle_02_r = 117, 190 | middle_03_r = 118, 191 | middle_04_r_MBONLY = 119, 192 | ring_01_r = 120, 193 | ring_02_r = 121, 194 | ring_03_r = 122, 195 | ring_04_r_MBONLY = 123, 196 | pinky_01_r = 124, 197 | pinky_02_r = 125, 198 | pinky_03_r = 126, 199 | pinky_04_r_MBONLY = 127, 200 | item_r = 128, 201 | lowerarm_twist_01_r = 129, 202 | upperarm_twist_01_r = 130, 203 | BackPack = 131, 204 | backpack_01 = 132, 205 | backpack_02 = 133, 206 | Slot_Primary = 134, 207 | Slot_Secondary = 135, 208 | Slot_Melee = 136, 209 | slot_throwable = 137, 210 | coat_l_01 = 138, 211 | coat_l_02 = 139, 212 | coat_l_03 = 140, 213 | coat_l_04 = 141, 214 | coat_fl_01 = 142, 215 | coat_fl_02 = 143, 216 | coat_fl_03 = 144, 217 | coat_fl_04 = 145, 218 | coat_b_01 = 146, 219 | coat_b_02 = 147, 220 | coat_b_03 = 148, 221 | coat_b_04 = 149, 222 | coat_r_01 = 150, 223 | coat_r_02 = 151, 224 | coat_r_03 = 152, 225 | coat_r_04 = 153, 226 | coat_fr_01 = 154, 227 | coat_fr_02 = 155, 228 | coat_fr_03 = 156, 229 | coat_fr_04 = 157, 230 | thigh_l = 158, 231 | calf_l = 159, 232 | foot_l = 160, 233 | ball_l = 161, 234 | calf_twist_01_l = 162, 235 | thigh_twist_01_l = 163, 236 | thigh_r = 164, 237 | calf_r = 165, 238 | foot_r = 166, 239 | ball_r = 167, 240 | calf_twist_01_r = 168, 241 | thigh_twist_01_r = 169, 242 | Slot_SideArm = 170, 243 | skirt_l_01 = 171, 244 | skirt_l_02 = 172, 245 | skirt_l_03 = 173, 246 | skirt_f_01 = 174, 247 | skirt_f_02 = 175, 248 | skirt_f_03 = 176, 249 | skirt_b_01 = 177, 250 | skirt_b_02 = 178, 251 | skirt_b_03 = 179, 252 | skirt_r_01 = 180, 253 | skirt_r_02 = 181, 254 | skirt_r_03 = 182, 255 | ik_hand_root = 183, 256 | ik_hand_gun = 184, 257 | ik_hand_r = 185, 258 | ik_hand_l = 186, 259 | ik_aim_root = 187, 260 | ik_aim_l = 188, 261 | ik_aim_r = 189, 262 | ik_foot_root = 190, 263 | ik_foot_l = 191, 264 | ik_foot_r = 192, 265 | camera_tpp = 193, 266 | ik_target_root = 194, 267 | ik_target_l = 195, 268 | ik_target_r = 196, 269 | VB_spine_03_spine_03 = 197, 270 | VB_upperarm_r_lowerarm_r = 198 271 | } 272 | 273 | [StructLayout(LayoutKind.Sequential)] 274 | public struct FRotator 275 | { 276 | public float Pitch; 277 | public float Yaw; 278 | public float Roll; 279 | 280 | public FRotator(float flPitch, float flYaw, float flRoll) 281 | { 282 | Pitch = flPitch; 283 | Yaw = flYaw; 284 | Roll = flRoll; 285 | } 286 | 287 | public double Length => Math.Sqrt(Pitch * Pitch + Yaw * Yaw + Roll * Roll); 288 | 289 | public FRotator Clamp() 290 | { 291 | var result = this; 292 | 293 | if (result.Pitch > 180) 294 | result.Pitch -= 360; 295 | 296 | else if (result.Pitch < -180) 297 | result.Pitch += 360; 298 | 299 | if (result.Yaw > 180) 300 | result.Yaw -= 360; 301 | 302 | else if (result.Yaw < -180) 303 | result.Yaw += 360; 304 | 305 | if (result.Pitch < -89) 306 | result.Pitch = -89; 307 | 308 | if (result.Pitch > 89) 309 | result.Pitch = 89; 310 | 311 | while (result.Yaw < -180.0f) 312 | result.Yaw += 360.0f; 313 | 314 | while (result.Yaw > 180.0f) 315 | result.Yaw -= 360.0f; 316 | 317 | result.Roll = 0; 318 | 319 | return result; 320 | } 321 | 322 | public void GetAxes(out Vector3 x, out Vector3 y, out Vector3 z) 323 | { 324 | var m = ToMatrix(); 325 | 326 | x = new Vector3(m.M11, m.M12, m.M13); 327 | y = new Vector3(m.M21, m.M22, m.M23); 328 | z = new Vector3(m.M31, m.M32, m.M33); 329 | } 330 | 331 | public Vector3 ToVector() 332 | { 333 | var radPitch = (float) (Pitch * Math.PI / 180f); 334 | var radYaw = (float) (Yaw * Math.PI / 180f); 335 | 336 | var SP = (float) Math.Sin(radPitch); 337 | var CP = (float) Math.Cos(radPitch); 338 | var SY = (float) Math.Sin(radYaw); 339 | var CY = (float) Math.Cos(radYaw); 340 | 341 | return new Vector3(CP * CY, CP * SY, SP); 342 | } 343 | 344 | public Matrix ToMatrix(Vector3 origin = default(Vector3)) 345 | { 346 | var radPitch = (float) (Pitch * Math.PI / 180f); 347 | var radYaw = (float) (Yaw * Math.PI / 180f); 348 | var radRoll = (float) (Roll * Math.PI / 180f); 349 | 350 | var SP = (float) Math.Sin(radPitch); 351 | var CP = (float) Math.Cos(radPitch); 352 | var SY = (float) Math.Sin(radYaw); 353 | var CY = (float) Math.Cos(radYaw); 354 | var SR = (float) Math.Sin(radRoll); 355 | var CR = (float) Math.Cos(radRoll); 356 | 357 | var m = new Matrix(); 358 | m[0, 0] = CP * CY; 359 | m[0, 1] = CP * SY; 360 | m[0, 2] = SP; 361 | m[0, 3] = 0f; 362 | 363 | m[1, 0] = SR * SP * CY - CR * SY; 364 | m[1, 1] = SR * SP * SY + CR * CY; 365 | m[1, 2] = -SR * CP; 366 | m[1, 3] = 0f; 367 | 368 | m[2, 0] = -(CR * SP * CY + SR * SY); 369 | m[2, 1] = CY * SR - CR * SP * SY; 370 | m[2, 2] = CR * CP; 371 | m[2, 3] = 0f; 372 | 373 | m[3, 0] = origin.X; 374 | m[3, 1] = origin.Y; 375 | m[3, 2] = origin.Z; 376 | m[3, 3] = 1f; 377 | return m; 378 | } 379 | 380 | public static FRotator operator +(FRotator angA, FRotator angB) 381 | { 382 | return new FRotator(angA.Pitch + angB.Pitch, angA.Yaw + angB.Yaw, angA.Roll + angB.Roll); 383 | } 384 | 385 | public static FRotator operator -(FRotator angA, FRotator angB) 386 | { 387 | return new FRotator(angA.Pitch - angB.Pitch, angA.Yaw - angB.Yaw, angA.Roll - angB.Roll); 388 | } 389 | 390 | public static FRotator operator /(FRotator angA, float flNum) 391 | { 392 | return new FRotator(angA.Pitch / flNum, angA.Yaw / flNum, angA.Roll / flNum); 393 | } 394 | 395 | public static FRotator operator *(FRotator angA, float flNum) 396 | { 397 | return new FRotator(angA.Pitch * flNum, angA.Yaw * flNum, angA.Roll * flNum); 398 | } 399 | 400 | public static bool operator ==(FRotator angA, FRotator angB) 401 | { 402 | return angA.Pitch == angB.Pitch && angA.Yaw == angB.Yaw && angA.Yaw == angB.Yaw; 403 | } 404 | 405 | public static bool operator !=(FRotator angA, FRotator angB) 406 | { 407 | return angA.Pitch != angB.Pitch || angA.Yaw != angB.Yaw || angA.Yaw != angB.Yaw; 408 | } 409 | } 410 | 411 | [StructLayout(LayoutKind.Sequential)] 412 | public struct Vector3 413 | { 414 | public float X; 415 | public float Y; 416 | public float Z; 417 | 418 | public Vector3(float x, float y, float z) 419 | { 420 | X = x; 421 | Y = y; 422 | Z = z; 423 | } 424 | 425 | public double Length => Math.Sqrt(X * X + Y * Y + Z * Z); 426 | 427 | public Vector2 To2D() 428 | { 429 | return new Vector2(X, Y); 430 | } 431 | 432 | public FRotator ToFRotator() 433 | { 434 | var rot = new FRotator(); 435 | 436 | var RADPI = (float) (180 / Math.PI); 437 | rot.Yaw = (float) Math.Atan2(Y, X) * RADPI; 438 | rot.Pitch = (float) Math.Atan2(Z, Math.Sqrt(X * X + Y * Y)) * RADPI; 439 | rot.Roll = 0; 440 | 441 | return rot; 442 | } 443 | 444 | public static float DotProduct(Vector3 vecA, Vector3 vecB) 445 | { 446 | return vecA.X * vecB.X + vecA.Y * vecB.Y + vecA.Z * vecB.Z; 447 | } 448 | 449 | #region Overrides 450 | 451 | public override string ToString() 452 | { 453 | return $"{X},{Y},{Z}"; 454 | } 455 | 456 | #endregion 457 | 458 | #region Operators 459 | 460 | public static Vector3 operator +(Vector3 vecA, Vector3 vecB) 461 | { 462 | return new Vector3(vecA.X + vecB.X, vecA.Y + vecB.Y, vecA.Z + vecB.Z); 463 | } 464 | 465 | public static Vector3 operator -(Vector3 vecA, Vector3 vecB) 466 | { 467 | return new Vector3(vecA.X - vecB.X, vecA.Y - vecB.Y, vecA.Z - vecB.Z); 468 | } 469 | 470 | public static Vector3 operator *(Vector3 vecA, Vector3 vecB) 471 | { 472 | return new Vector3(vecA.X * vecB.X, vecA.Y * vecB.Y, vecA.Z * vecB.Z); 473 | } 474 | 475 | public static Vector3 operator *(Vector3 vecA, int n) 476 | { 477 | return new Vector3(vecA.X * n, vecA.Y * n, vecA.Z * n); 478 | } 479 | 480 | public static Vector3 operator /(Vector3 vecA, Vector3 vecB) 481 | { 482 | return new Vector3(vecA.X / vecB.X, vecA.Y / vecB.Y, vecA.Z / vecB.Z); 483 | } 484 | 485 | public static bool operator ==(Vector3 vecA, Vector3 vecB) 486 | { 487 | return vecA.X == vecB.X && vecA.Y == vecB.Y && vecA.Y == vecB.Y; 488 | } 489 | 490 | public static bool operator !=(Vector3 vecA, Vector3 vecB) 491 | { 492 | return vecA.X != vecB.X || vecA.Y != vecB.Y || vecA.Y != vecB.Y; 493 | } 494 | 495 | #endregion 496 | } 497 | 498 | [StructLayout(LayoutKind.Sequential)] 499 | public struct Vector2 500 | { 501 | public float X; 502 | public float Y; 503 | 504 | public Vector2(float x, float y) 505 | { 506 | X = x; 507 | Y = y; 508 | } 509 | 510 | public Vector2(double x, double y) 511 | { 512 | X = (float) x; 513 | Y = (float) y; 514 | } 515 | 516 | public double Length => Math.Sqrt(X * X + Y * Y); 517 | 518 | #region Functions 519 | 520 | public Vector2 Rotate(Vector2 centerpoint, double angle, bool bAngleInRadians = false) 521 | { 522 | if (!bAngleInRadians) 523 | angle = Math.PI * angle / 180.0; 524 | 525 | return new Vector2(X * Math.Cos(angle) - Y * Math.Sin(angle), X * Math.Sin(angle) + Y * Math.Cos(angle)); 526 | } 527 | 528 | #endregion 529 | 530 | #region Overrides 531 | 532 | public override string ToString() 533 | { 534 | return $"{X},{Y}"; 535 | } 536 | 537 | #endregion 538 | 539 | #region Operators 540 | 541 | public static Vector2 operator +(Vector2 vecA, Vector2 vecB) 542 | { 543 | return new Vector2(vecA.X + vecB.X, vecA.Y + vecB.Y); 544 | } 545 | 546 | public static Vector2 operator -(Vector2 vecA, Vector2 vecB) 547 | { 548 | return new Vector2(vecA.X - vecB.X, vecA.Y - vecB.Y); 549 | } 550 | 551 | public static Vector2 operator *(Vector2 vecA, int n) 552 | { 553 | return new Vector2(vecA.X * n, vecA.Y * n); 554 | } 555 | 556 | public static Vector2 operator /(Vector2 vecA, Vector2 vecB) 557 | { 558 | return new Vector2(vecA.X / vecB.X, vecA.Y / vecB.Y); 559 | } 560 | 561 | public static Vector2 operator +(Vector2 vecA, float val) 562 | { 563 | return new Vector2(vecA.X + val, vecA.Y + val); 564 | } 565 | 566 | public static Vector2 operator -(Vector2 vecA, float val) 567 | { 568 | return new Vector2(vecA.X - val, vecA.Y - val); 569 | } 570 | 571 | public static Vector2 operator *(Vector2 vecA, float val) 572 | { 573 | return new Vector2(vecA.X * val, vecA.Y * val); 574 | } 575 | 576 | public static Vector2 operator /(Vector2 vecA, float val) 577 | { 578 | return new Vector2(vecA.X / val, vecA.Y / val); 579 | } 580 | 581 | 582 | public static bool operator ==(Vector2 vecA, Vector2 vecB) 583 | { 584 | return vecA.X == vecB.X && vecA.Y == vecB.Y && vecA.Y == vecB.Y; 585 | } 586 | 587 | public static bool operator !=(Vector2 vecA, Vector2 vecB) 588 | { 589 | return vecA.X != vecB.X || vecA.Y != vecB.Y || vecA.Y != vecB.Y; 590 | } 591 | 592 | #endregion 593 | } 594 | } -------------------------------------------------------------------------------- /ESP/ESP/PUBG-SDK.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using CPUZ.Model; 8 | 9 | namespace CPUZ 10 | { 11 | 12 | public class OffsetAttribute : Attribute 13 | { 14 | // The constructor is called when the attribute is set. 15 | public OffsetAttribute(ulong offset) 16 | { 17 | Offset = offset; 18 | } 19 | public ulong Offset; 20 | } 21 | 22 | public class BaseEntry 23 | { 24 | protected BaseEntry(ulong address) 25 | { 26 | BasePoint = address; 27 | DoProperty(); 28 | } 29 | 30 | private void DoProperty() 31 | { 32 | var t = GetType().GetProperties(); 33 | foreach (var propertyInfo in t) 34 | { 35 | var attributes = propertyInfo.GetCustomAttributes(false); 36 | if (attributes.Length == 0) continue; 37 | if (attributes[0].GetType() != typeof(OffsetAttribute)) continue; 38 | var methodInfo = 39 | typeof(KReader) 40 | .GetMethod("Reader") 41 | .MakeGenericMethod( 42 | propertyInfo.PropertyType.BaseType == typeof(BaseEntry) ? typeof(ulong) : propertyInfo.PropertyType); 43 | //执行KReader泛型方法取得值 44 | var value = methodInfo.Invoke(null, new object[] { (BasePoint + ((OffsetAttribute)attributes[0]).Offset)}); 45 | if (propertyInfo.PropertyType.BaseType == typeof(BaseEntry)) 46 | { 47 | var instance = Activator.CreateInstance(propertyInfo.PropertyType, value); 48 | propertyInfo.SetValue(this, Convert.ChangeType(instance, propertyInfo.PropertyType), null); 49 | } 50 | else if(propertyInfo.PropertyType.IsValueType) 51 | { 52 | propertyInfo.SetValue(this, Convert.ChangeType(value, propertyInfo.PropertyType), null); 53 | } 54 | } 55 | } 56 | 57 | protected ulong BasePoint; 58 | } 59 | 60 | public class Pubg : BaseEntry 61 | { 62 | public Pubg(ulong address) : base(address) 63 | { 64 | } 65 | public UWorld UWorld => new UWorld(KReader.readUlong(BasePoint)); 66 | } 67 | 68 | public class UWorld : BaseEntry 69 | { 70 | public UWorld(ulong address) : base(address) 71 | { 72 | } 73 | 74 | [Offset(0x0140)] 75 | public UGameInstance 76 | OwningGameInstance 77 | { get; set; } 78 | } 79 | 80 | //class UGameInstance* OwningGameInstance; // 0x0140(0x0008) 81 | public class UGameInstance : BaseEntry 82 | { 83 | 84 | public UGameInstance(ulong address) : base(address) 85 | { 86 | } 87 | [Offset(0x0038)] 88 | public ULocalPlayers LocalPlayers { get; set; } 89 | } 90 | 91 | //TArray LocalPlayers; // 0x0038(0x0010) 92 | public class ULocalPlayers : BaseEntry 93 | { 94 | private readonly int 占位 = 0x00; 95 | 96 | public ULocalPlayers(ulong address) : base(address) 97 | { 98 | } 99 | 100 | public ULocalPlayer this[int index] => 101 | new ULocalPlayer(KReader.readUlong(BasePoint + (ulong)(index * 占位))); 102 | } 103 | 104 | public class ULocalPlayer : BaseEntry 105 | { 106 | public ULocalPlayer(ulong address) : base(address) 107 | { 108 | 109 | } 110 | [Offset(0x0058)] 111 | public UGameViewportClient ViewportClient { get; protected set; } 112 | [Offset(0x03A8)] 113 | public APawn Pawn { get; set; } 114 | [Offset(0x0030)] 115 | public APlayerController PlayerController { get; set; } 116 | } 117 | 118 | //class UGameViewportClient* ViewportClient; // 0x0058(0x0008) 119 | public class UGameViewportClient : BaseEntry 120 | { 121 | public UGameViewportClient(ulong address) : base(address) 122 | { 123 | } 124 | [Offset(0x0080)] 125 | public PWorld UWorld { get; set; } 126 | } 127 | 128 | //class APawn* Pawn; // 0x03A8(0x0008) 129 | public class APawn : BaseEntry 130 | { 131 | public APawn(ulong address) : base(address) 132 | { 133 | } 134 | [Offset(0x03C0)] 135 | public APlayerState PlayerState { get; set; } 136 | 137 | } 138 | 139 | //class APlayerState* PlayerState; // 0x03C0(0x0008) 140 | public class APlayerState : BaseEntry 141 | { 142 | 143 | public APlayerState(ulong address) : base(address) 144 | { 145 | } 146 | [Offset(0x0080)] 147 | public PWorld World { get; set; } 148 | 149 | //int TeamNumber; // 0x0444(0x0004) 150 | [Offset(0x0444)] 151 | public int TeamNumber { get; set; } 152 | 153 | //int PlayerId; // 0x03C8(0x0004) 154 | [Offset(0x03C8)] 155 | public int PlayerId { get; set; } 156 | 157 | //unsigned char bIsInactive : 1; // 0x03CC(0x0001) 158 | [Offset(0x03CC)] 159 | public char bIsInactive { get; set; } 160 | 161 | //struct FString PlayerName; // 0x03A8(0x0010) 162 | [Offset(0x03A8)] 163 | public ulong PlayerNameAddress { get; set; } 164 | [Offset(0x03A8 + 0x8)] 165 | public int PlayerNameLength { get; set; } 166 | 167 | public string PlayerName 168 | { 169 | get 170 | { 171 | if (PlayerNameLength <= 0) return ""; 172 | var v = KReader.ReadStringUnicode(PlayerNameAddress, PlayerNameLength); 173 | return v.Length > 0 ? v.Substring(0, v.Length - 1) : string.Empty; 174 | } 175 | } 176 | } 177 | 178 | //class UWorld* World; // 0x0080(0x0008) 179 | public class PWorld : BaseEntry 180 | { 181 | public PWorld(ulong address) : base(address) 182 | { 183 | } 184 | 185 | [Offset(0x0030)] 186 | public ULevel PersistentLevel { get; set; } 187 | [Offset(0x00F8)] 188 | public AGameStateBase GameState { get; set; } 189 | 190 | public Vector3 WorldLocation => new Vector3 191 | { 192 | X = KReader.readInt32(BasePoint + 0x918), 193 | Y = KReader.readInt32(BasePoint + 0x91C), 194 | Z = KReader.readInt32(BasePoint + 0x920) 195 | }; 196 | } 197 | 198 | //class ULevel* PersistentLevel; // 0x0030(0x0008) 199 | public class ULevel : BaseEntry 200 | { 201 | public ULevel(ulong address) : base(address) 202 | { 203 | } 204 | 205 | [Offset(0xA8)] 206 | public int PlayerCount{ get; set; } 207 | [Offset(0x00A0)] 208 | public AActors AActors { get; set; } 209 | } 210 | 211 | //TArray AActors; // 0x00A0(0x0010) 212 | public class AActors : BaseEntry 213 | { 214 | private readonly int 位移 = 0x8; 215 | 216 | public AActors(ulong address) : base(address) 217 | { 218 | } 219 | 220 | public AActor this[int index] => new AActor(KReader.readUlong(BasePoint + (ulong)(index * 位移))); 221 | } 222 | 223 | public class AActor : BaseEntry 224 | { 225 | private static List playerGName = new List { "PlayerMale", "PlayerFemale" }; 226 | 227 | private static readonly List vehicleGNameVec = 228 | new List { "Uaz", "Buggy", "Dacia", "ABP_Motorbike", "BP_Motorbike", "Boat_PG117" }; 229 | 230 | private static readonly List DropName = 231 | new List { "DroppedItemGroup", "DroppedItemInteractionComponent" }; 232 | 233 | private static readonly List AirdropOrDeathdrop = new List 234 | { 235 | "DeathDropItemPackage", 236 | "Carapackage_RedBox_C", 237 | "CarePackage", 238 | "AircraftCarePackage" 239 | }; 240 | 241 | 242 | public AActor(ulong address) : base(address) 243 | { 244 | } 245 | [Offset(0x0018)] 246 | public int ActorID { get; set; } 247 | 248 | public string ActorName => Cache.GetGName(ActorID);// KReader.getGNameFromId(ActorID); 249 | 250 | [Offset(0x0180)] 251 | public USceneComponent RootComponent { get; set; } 252 | [Offset(0x03C0)] 253 | public APlayerState PlayerState { get; set; } 254 | [Offset(0x107C)] 255 | public float Health { get; set; } 256 | [Offset(0x0400)] 257 | public Mesh Mesh { get; set; } 258 | 259 | //DropItems 260 | [Offset(0x02D8)] 261 | public DropItems DropItems { get; set; } 262 | [Offset(0x02E0)] 263 | public int DropItemsCount { get; set; } 264 | public bool isDropItems => DropName.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 265 | 266 | //空投和死亡盒子 267 | [Offset(0x04D0)] 268 | public DropItems AItemPackages { get; set; } 269 | [Offset(0x04D4)] 270 | public int AItemPackagesCount { get; set; } 271 | 272 | public bool isAirdropOrDeathdrop => 273 | AirdropOrDeathdrop.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 274 | public bool isPlayer => playerGName.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 275 | public bool isVehicle => vehicleGNameVec.Any(g => ActorName.IndexOf(g, StringComparison.Ordinal) > -1); 276 | } 277 | 278 | public class AItemPackages : BaseEntry 279 | { 280 | private readonly int 位移 = 0x08; 281 | 282 | public AItemPackages(ulong address) : base(address) 283 | { 284 | } 285 | 286 | public AItemPackage this[int index] => 287 | new AItemPackage(KReader.readUlong(BasePoint + (ulong)(index * 位移))); 288 | } 289 | 290 | public class AItemPackage : BaseEntry 291 | { 292 | public AItemPackage(ulong address) : base(address) 293 | { 294 | } 295 | } 296 | 297 | 298 | public class DropItems : BaseEntry 299 | { 300 | private readonly int 位移 = 0x10; 301 | 302 | public DropItems(ulong address) : base(address) 303 | { 304 | } 305 | 306 | public UDropItem this[int index] => 307 | new UDropItem(KReader.readUlong(BasePoint + (ulong)(index * 位移))); 308 | } 309 | 310 | public class UDropItem : BaseEntry 311 | { 312 | public Vector3 RelativeLocation; 313 | 314 | public UDropItem(ulong address) : base(address) 315 | { 316 | } 317 | [Offset(0x0448)] 318 | public UItem UItem { get; set; } 319 | 320 | [Offset(0x01E0)] 321 | public Vector3 Location { get; set; } 322 | } 323 | 324 | // class UItem* Item; // 0x0448(0x0008) 325 | public class UItem : BaseEntry 326 | { 327 | public UItem(ulong address) : base(address) 328 | { 329 | } 330 | 331 | [Offset(0x0018)] 332 | public int ItemId { get; set; } 333 | 334 | public string ItemName => Cache.GetGName(ItemId);// KReader.getGNameFromId(ItemId); 335 | } 336 | 337 | public class Mesh : BaseEntry 338 | { 339 | public Mesh(ulong address) : base(address) 340 | { 341 | } 342 | 343 | public ulong mesh => BasePoint; 344 | } 345 | 346 | //class USceneComponent* RootComponent; // 0x0180(0x0008) 347 | public class USceneComponent : BaseEntry 348 | { 349 | public USceneComponent(ulong address) : base(address) 350 | { 351 | } 352 | 353 | //struct FVector Location; // 0x01A0(0x000C) 354 | [Offset(0x01A0)] 355 | public Vector3 Location { get; set; } 356 | 357 | //struct FVector RelativeLocation; // 0x01E0(0x000C) 358 | [Offset(0x01E0)] 359 | public Vector3 RelativeLocation { get; set; } 360 | 361 | //struct FRotator RelativeRotation; // 0x01EC(0x000C) 362 | [Offset(0x01EC)] 363 | public Vector3 RelativeRotation { get; set; } 364 | } 365 | 366 | //class APlayerController* PlayerController; // 0x0030(0x0008) 367 | public class APlayerController : BaseEntry 368 | { 369 | [Offset(0x0438)] 370 | public APlayerCameraManager PlayerCameraManager { get; set; } 371 | 372 | public APlayerController(ulong address) : base(address) 373 | { 374 | } 375 | } 376 | 377 | //class APlayerCameraManager* PlayerCameraManager; // 0x0438(0x0008) 378 | public class APlayerCameraManager : BaseEntry 379 | { 380 | public APlayerCameraManager(ulong address) : base(address) 381 | { 382 | } 383 | [Offset(0x42C)] 384 | public Vector3 povRotation { get; set; } 385 | [Offset(0x420)] 386 | public Vector3 povLocation { get; set; } 387 | [Offset(0x438)] 388 | public float Fov { get; set; } 389 | } 390 | 391 | //class AGameStateBase* GameState; // 0x00F8(0x0008) 392 | public class AGameStateBase : BaseEntry 393 | { 394 | public AGameStateBase(ulong address) : base(address) 395 | { 396 | } 397 | 398 | [Offset(0x440)] 399 | public Vector3 blue { get; set; } 400 | [Offset(0x44C)] 401 | public float blueR { get; set; } 402 | 403 | [Offset(0x450)] 404 | public Vector3 white { get; set; } 405 | [Offset(0x45C)] 406 | public float whiteR { get; set; } 407 | } 408 | 409 | 410 | [StructLayout(LayoutKind.Sequential)] 411 | public struct Pov 412 | { 413 | public Vector3 Rotation; 414 | } 415 | } -------------------------------------------------------------------------------- /ESP/ESP/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | using System.Device; 8 | using System.Threading; 9 | 10 | namespace CPUZ 11 | { 12 | static class Program 13 | { 14 | /// 15 | /// 应用程序的主入口点。 16 | /// 17 | /// 18 | /// 19 | private static mainFrom _mainForm; 20 | 21 | [DllImport("user32.dll")] 22 | static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo); 23 | [DllImport("user32.dll")] 24 | static extern byte MapVirtualKey(byte wCode, int wMap); 25 | 26 | [STAThread] 27 | static void Main() 28 | { 29 | Application.EnableVisualStyles(); 30 | Application.SetCompatibleTextRenderingDefault(false); 31 | 32 | 33 | 34 | HotKeyManager.RegisterHotKey(Keys.F1, KeyModifiers.Alt); 35 | //开关车辆 36 | HotKeyManager.RegisterHotKey(Keys.NumPad7, KeyModifiers.Alt); 37 | //开关物品 38 | HotKeyManager.RegisterHotKey(Keys.NumPad8, KeyModifiers.Alt); 39 | //开关雷达 40 | HotKeyManager.RegisterHotKey(Keys.NumPad9, KeyModifiers.Alt); 41 | 42 | HotKeyManager.HotKeyPressed += HotKeyManager_HotKeyPressed; 43 | 44 | //HotKeyManager.RegisterHotKey(Keys.Space, 0); 45 | //HotKeyManager.HotKeyPressed += HotKeyManager_HotKeyPressed2; 46 | 47 | 48 | _mainForm = new mainFrom(); 49 | Application.Run(_mainForm); 50 | Application.ThreadExit += (a, b) => 51 | { 52 | KReader.Close(); 53 | }; 54 | } 55 | 56 | 57 | //注册热键 58 | 59 | static void HotKeyManager_HotKeyPressed(object sender, HotKeyEventArgs e) 60 | { 61 | if (e.Key == Keys.F1 && e.Modifiers == KeyModifiers.Alt) 62 | if (_mainForm.Visible) 63 | { 64 | _mainForm.Hide(); 65 | } 66 | else 67 | { 68 | _mainForm.Show(); 69 | 70 | } 71 | if (e.Key == Keys.NumPad7 && e.Modifiers == KeyModifiers.Alt) 72 | { 73 | Setting.车辆显示 = !Setting.车辆显示; 74 | } 75 | if (e.Key == Keys.NumPad8 && e.Modifiers == KeyModifiers.Alt) 76 | { 77 | Setting.物品显示 = !Setting.物品显示; 78 | } 79 | if (e.Key == Keys.NumPad9 && e.Modifiers == KeyModifiers.Alt) 80 | { 81 | Setting.雷达 = !Setting.雷达; 82 | } 83 | } 84 | static void HotKeyManager_HotKeyPressed2(object sender, HotKeyEventArgs e) 85 | { 86 | 87 | if (Setting.一键大跳 && e.Key == Keys.Space) 88 | { 89 | keybd_event(32, MapVirtualKey(32, 0), 0x2, 0);//空格  90 | Thread.Sleep(100); 91 | keybd_event(67, MapVirtualKey(67, 0), 0, 0); //C 92 | keybd_event(32, MapVirtualKey(32, 0), 0x2, 0);//放開 空格 93 | keybd_event(67, MapVirtualKey(67, 0), 0x2, 0);//放開C  94 | } 95 | } 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ESP/ESP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("CPUZ")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CPUZ")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9bc48d38-89a1-47c2-9c68-dc2b9881d033")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ESP/ESP/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CPUZ.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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 | /// 返回此类使用的缓存的 ResourceManager 实例。 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("CPUZ.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 使用此强类型资源类,为所有资源查找 51 | /// 重写当前线程的 CurrentUICulture 属性。 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 | -------------------------------------------------------------------------------- /ESP/ESP/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 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /ESP/ESP/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CPUZ.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")] 16 | public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ESP/ESP/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ESP/ESP/Setting.cs: -------------------------------------------------------------------------------- 1 | namespace CPUZ 2 | { 3 | public static class Setting 4 | { 5 | 6 | 7 | public static bool 车辆显示 { get; set; } = true; 8 | public static bool 物品显示 { get; set; } = false; 9 | public static bool 距离和血量 { get; set; } = true; 10 | public static bool 线条 { get; set; } = true; 11 | public static bool 雷达 { get; set; } = false; 12 | 13 | public static bool 一键大跳 { get; set; } = false; 14 | 15 | public static int JSON_STATE { get; set; } = 0; 16 | 17 | public static bool Web端 { get; set; } = false; 18 | 19 | 20 | public static ulong UWorldOffset { get; } = 0x3A4F1A8; 21 | public static ulong GNameOffset { get; } = 0x3951F90; 22 | 23 | public static ScreenType Screen { get; } = new ScreenType { Width = 2560, Height = 1440 }; 24 | 25 | public static 模式 模式 { get; set; } = 模式.模式二; 26 | } 27 | 28 | public class ScreenType 29 | { 30 | public int Width { get; set; } 31 | public int Height { get; set; } 32 | } 33 | 34 | public enum 模式 35 | { 36 | 模式一 = 1, 37 | 模式二 = 2 38 | } 39 | } -------------------------------------------------------------------------------- /ESP/ESP/main.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CPUZ 2 | { 3 | partial class mainFrom 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(mainFrom)); 33 | this.materialTabControl1 = new MaterialSkin.Controls.MaterialTabControl(); 34 | this.tabPage1 = new System.Windows.Forms.TabPage(); 35 | this.materialLabel2 = new MaterialSkin.Controls.MaterialLabel(); 36 | this.chkWebMap = new MaterialSkin.Controls.MaterialCheckBox(); 37 | this.chkRadar = new MaterialSkin.Controls.MaterialCheckBox(); 38 | this.chkLine = new MaterialSkin.Controls.MaterialCheckBox(); 39 | this.chkHealth = new MaterialSkin.Controls.MaterialCheckBox(); 40 | this.chk2 = new MaterialSkin.Controls.MaterialCheckBox(); 41 | this.chk1 = new MaterialSkin.Controls.MaterialCheckBox(); 42 | this.tabPage2 = new System.Windows.Forms.TabPage(); 43 | this.materialFlatButton1 = new MaterialSkin.Controls.MaterialFlatButton(); 44 | this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); 45 | this.chkJump = new MaterialSkin.Controls.MaterialCheckBox(); 46 | this.materialLabel1 = new MaterialSkin.Controls.MaterialLabel(); 47 | this.timer1 = new System.Windows.Forms.Timer(this.components); 48 | this.materialTabControl1.SuspendLayout(); 49 | this.tabPage1.SuspendLayout(); 50 | this.SuspendLayout(); 51 | // 52 | // materialTabControl1 53 | // 54 | this.materialTabControl1.Controls.Add(this.tabPage1); 55 | this.materialTabControl1.Controls.Add(this.tabPage2); 56 | this.materialTabControl1.Depth = 0; 57 | this.materialTabControl1.Location = new System.Drawing.Point(0, 63); 58 | this.materialTabControl1.MouseState = MaterialSkin.MouseState.HOVER; 59 | this.materialTabControl1.Name = "materialTabControl1"; 60 | this.materialTabControl1.SelectedIndex = 0; 61 | this.materialTabControl1.Size = new System.Drawing.Size(301, 238); 62 | this.materialTabControl1.TabIndex = 1; 63 | // 64 | // tabPage1 65 | // 66 | this.tabPage1.Controls.Add(this.materialLabel2); 67 | this.tabPage1.Controls.Add(this.chkWebMap); 68 | this.tabPage1.Controls.Add(this.chkRadar); 69 | this.tabPage1.Controls.Add(this.chkLine); 70 | this.tabPage1.Controls.Add(this.chkHealth); 71 | this.tabPage1.Controls.Add(this.chk2); 72 | this.tabPage1.Controls.Add(this.chk1); 73 | this.tabPage1.Location = new System.Drawing.Point(4, 22); 74 | this.tabPage1.Name = "tabPage1"; 75 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 76 | this.tabPage1.Size = new System.Drawing.Size(293, 212); 77 | this.tabPage1.TabIndex = 0; 78 | this.tabPage1.Text = "tabPage1"; 79 | this.tabPage1.UseVisualStyleBackColor = true; 80 | // 81 | // materialLabel2 82 | // 83 | this.materialLabel2.AutoSize = true; 84 | this.materialLabel2.Depth = 0; 85 | this.materialLabel2.Font = new System.Drawing.Font("Roboto", 11F); 86 | this.materialLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); 87 | this.materialLabel2.Location = new System.Drawing.Point(149, 198); 88 | this.materialLabel2.MouseState = MaterialSkin.MouseState.HOVER; 89 | this.materialLabel2.Name = "materialLabel2"; 90 | this.materialLabel2.Size = new System.Drawing.Size(64, 18); 91 | this.materialLabel2.TabIndex = 6; 92 | this.materialLabel2.Text = "pubbase"; 93 | // 94 | // chkWebMap 95 | // 96 | this.chkWebMap.AutoSize = true; 97 | this.chkWebMap.Depth = 0; 98 | this.chkWebMap.Font = new System.Drawing.Font("Roboto", 10F); 99 | this.chkWebMap.Location = new System.Drawing.Point(196, 12); 100 | this.chkWebMap.Margin = new System.Windows.Forms.Padding(0); 101 | this.chkWebMap.MouseLocation = new System.Drawing.Point(-1, -1); 102 | this.chkWebMap.MouseState = MaterialSkin.MouseState.HOVER; 103 | this.chkWebMap.Name = "chkWebMap"; 104 | this.chkWebMap.Ripple = true; 105 | this.chkWebMap.Size = new System.Drawing.Size(87, 30); 106 | this.chkWebMap.TabIndex = 5; 107 | this.chkWebMap.Text = "Web地图"; 108 | this.chkWebMap.UseVisualStyleBackColor = true; 109 | this.chkWebMap.CheckedChanged += new System.EventHandler(this.chkWebMap_CheckedChanged); 110 | // 111 | // chkRadar 112 | // 113 | this.chkRadar.AutoSize = true; 114 | this.chkRadar.Depth = 0; 115 | this.chkRadar.Font = new System.Drawing.Font("Roboto", 10F); 116 | this.chkRadar.Location = new System.Drawing.Point(17, 173); 117 | this.chkRadar.Margin = new System.Windows.Forms.Padding(0); 118 | this.chkRadar.MouseLocation = new System.Drawing.Point(-1, -1); 119 | this.chkRadar.MouseState = MaterialSkin.MouseState.HOVER; 120 | this.chkRadar.Name = "chkRadar"; 121 | this.chkRadar.Ripple = true; 122 | this.chkRadar.Size = new System.Drawing.Size(60, 30); 123 | this.chkRadar.TabIndex = 4; 124 | this.chkRadar.Text = "雷达"; 125 | this.chkRadar.UseVisualStyleBackColor = true; 126 | this.chkRadar.CheckedChanged += new System.EventHandler(this.chkRadar_CheckedChanged); 127 | // 128 | // chkLine 129 | // 130 | this.chkLine.AutoSize = true; 131 | this.chkLine.Depth = 0; 132 | this.chkLine.Font = new System.Drawing.Font("Roboto", 10F); 133 | this.chkLine.Location = new System.Drawing.Point(17, 134); 134 | this.chkLine.Margin = new System.Windows.Forms.Padding(0); 135 | this.chkLine.MouseLocation = new System.Drawing.Point(-1, -1); 136 | this.chkLine.MouseState = MaterialSkin.MouseState.HOVER; 137 | this.chkLine.Name = "chkLine"; 138 | this.chkLine.Ripple = true; 139 | this.chkLine.Size = new System.Drawing.Size(60, 30); 140 | this.chkLine.TabIndex = 3; 141 | this.chkLine.Text = "线条"; 142 | this.chkLine.UseVisualStyleBackColor = true; 143 | this.chkLine.CheckedChanged += new System.EventHandler(this.chkLine_CheckedChanged); 144 | // 145 | // chkHealth 146 | // 147 | this.chkHealth.AutoSize = true; 148 | this.chkHealth.Depth = 0; 149 | this.chkHealth.Font = new System.Drawing.Font("Roboto", 10F); 150 | this.chkHealth.Location = new System.Drawing.Point(17, 95); 151 | this.chkHealth.Margin = new System.Windows.Forms.Padding(0); 152 | this.chkHealth.MouseLocation = new System.Drawing.Point(-1, -1); 153 | this.chkHealth.MouseState = MaterialSkin.MouseState.HOVER; 154 | this.chkHealth.Name = "chkHealth"; 155 | this.chkHealth.Ripple = true; 156 | this.chkHealth.Size = new System.Drawing.Size(121, 30); 157 | this.chkHealth.TabIndex = 2; 158 | this.chkHealth.Text = "人物距离血量"; 159 | this.chkHealth.UseVisualStyleBackColor = true; 160 | this.chkHealth.CheckedChanged += new System.EventHandler(this.chkHealth_CheckedChanged); 161 | // 162 | // chk2 163 | // 164 | this.chk2.AutoSize = true; 165 | this.chk2.Depth = 0; 166 | this.chk2.Font = new System.Drawing.Font("Roboto", 10F); 167 | this.chk2.Location = new System.Drawing.Point(17, 54); 168 | this.chk2.Margin = new System.Windows.Forms.Padding(0); 169 | this.chk2.MouseLocation = new System.Drawing.Point(-1, -1); 170 | this.chk2.MouseState = MaterialSkin.MouseState.HOVER; 171 | this.chk2.Name = "chk2"; 172 | this.chk2.Ripple = true; 173 | this.chk2.Size = new System.Drawing.Size(60, 30); 174 | this.chk2.TabIndex = 1; 175 | this.chk2.Text = "物品"; 176 | this.chk2.UseVisualStyleBackColor = true; 177 | this.chk2.CheckedChanged += new System.EventHandler(this.materialCheckBox2_CheckedChanged); 178 | // 179 | // chk1 180 | // 181 | this.chk1.AutoSize = true; 182 | this.chk1.Depth = 0; 183 | this.chk1.Font = new System.Drawing.Font("Roboto", 10F); 184 | this.chk1.Location = new System.Drawing.Point(17, 12); 185 | this.chk1.Margin = new System.Windows.Forms.Padding(0); 186 | this.chk1.MouseLocation = new System.Drawing.Point(-1, -1); 187 | this.chk1.MouseState = MaterialSkin.MouseState.HOVER; 188 | this.chk1.Name = "chk1"; 189 | this.chk1.Ripple = true; 190 | this.chk1.Size = new System.Drawing.Size(60, 30); 191 | this.chk1.TabIndex = 0; 192 | this.chk1.Text = "车辆"; 193 | this.chk1.UseVisualStyleBackColor = true; 194 | this.chk1.CheckedChanged += new System.EventHandler(this.materialCheckBox1_CheckedChanged); 195 | // 196 | // tabPage2 197 | // 198 | this.tabPage2.Location = new System.Drawing.Point(4, 22); 199 | this.tabPage2.Name = "tabPage2"; 200 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 201 | this.tabPage2.Size = new System.Drawing.Size(293, 212); 202 | this.tabPage2.TabIndex = 1; 203 | this.tabPage2.Text = "tabPage2"; 204 | this.tabPage2.UseVisualStyleBackColor = true; 205 | // 206 | // materialFlatButton1 207 | // 208 | this.materialFlatButton1.AutoSize = true; 209 | this.materialFlatButton1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 210 | this.materialFlatButton1.Depth = 0; 211 | this.materialFlatButton1.Location = new System.Drawing.Point(245, 306); 212 | this.materialFlatButton1.Margin = new System.Windows.Forms.Padding(4, 6, 4, 6); 213 | this.materialFlatButton1.MouseState = MaterialSkin.MouseState.HOVER; 214 | this.materialFlatButton1.Name = "materialFlatButton1"; 215 | this.materialFlatButton1.Primary = false; 216 | this.materialFlatButton1.Size = new System.Drawing.Size(42, 36); 217 | this.materialFlatButton1.TabIndex = 5; 218 | this.materialFlatButton1.Text = "隐藏"; 219 | this.materialFlatButton1.UseVisualStyleBackColor = true; 220 | this.materialFlatButton1.Click += new System.EventHandler(this.materialFlatButton1_Click_1); 221 | // 222 | // notifyIcon1 223 | // 224 | this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); 225 | this.notifyIcon1.Text = "CPU-Z"; 226 | this.notifyIcon1.Visible = true; 227 | this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick); 228 | // 229 | // chkJump 230 | // 231 | this.chkJump.AutoSize = true; 232 | this.chkJump.Depth = 0; 233 | this.chkJump.Font = new System.Drawing.Font("Roboto", 10F); 234 | this.chkJump.Location = new System.Drawing.Point(9, 306); 235 | this.chkJump.Margin = new System.Windows.Forms.Padding(0); 236 | this.chkJump.MouseLocation = new System.Drawing.Point(-1, -1); 237 | this.chkJump.MouseState = MaterialSkin.MouseState.HOVER; 238 | this.chkJump.Name = "chkJump"; 239 | this.chkJump.Ripple = true; 240 | this.chkJump.Size = new System.Drawing.Size(90, 30); 241 | this.chkJump.TabIndex = 6; 242 | this.chkJump.Text = "一键大跳"; 243 | this.chkJump.UseVisualStyleBackColor = true; 244 | this.chkJump.CheckedChanged += new System.EventHandler(this.chkJump_CheckedChanged); 245 | // 246 | // materialLabel1 247 | // 248 | this.materialLabel1.AutoSize = true; 249 | this.materialLabel1.BackColor = System.Drawing.Color.Transparent; 250 | this.materialLabel1.Depth = 0; 251 | this.materialLabel1.Font = new System.Drawing.Font("Roboto", 11F); 252 | this.materialLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); 253 | this.materialLabel1.Location = new System.Drawing.Point(233, 36); 254 | this.materialLabel1.MouseState = MaterialSkin.MouseState.HOVER; 255 | this.materialLabel1.Name = "materialLabel1"; 256 | this.materialLabel1.Size = new System.Drawing.Size(56, 18); 257 | this.materialLabel1.TabIndex = 7; 258 | this.materialLabel1.Text = "无数据"; 259 | // 260 | // timer1 261 | // 262 | this.timer1.Enabled = true; 263 | this.timer1.Interval = 500; 264 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 265 | // 266 | // mainFrom 267 | // 268 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 269 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 270 | this.ClientSize = new System.Drawing.Size(300, 380); 271 | this.Controls.Add(this.materialLabel1); 272 | this.Controls.Add(this.chkJump); 273 | this.Controls.Add(this.materialFlatButton1); 274 | this.Controls.Add(this.materialTabControl1); 275 | this.MaximizeBox = false; 276 | this.MinimizeBox = false; 277 | this.Name = "mainFrom"; 278 | this.ShowInTaskbar = false; 279 | this.Sizable = false; 280 | this.Text = "CPU-Z 1.0.0"; 281 | this.TopMost = true; 282 | this.Load += new System.EventHandler(this.main_Load); 283 | this.Leave += new System.EventHandler(this.main_Leave); 284 | this.materialTabControl1.ResumeLayout(false); 285 | this.tabPage1.ResumeLayout(false); 286 | this.tabPage1.PerformLayout(); 287 | this.ResumeLayout(false); 288 | this.PerformLayout(); 289 | 290 | } 291 | 292 | #endregion 293 | private MaterialSkin.Controls.MaterialTabControl materialTabControl1; 294 | private System.Windows.Forms.TabPage tabPage1; 295 | private System.Windows.Forms.TabPage tabPage2; 296 | private MaterialSkin.Controls.MaterialCheckBox chk2; 297 | private MaterialSkin.Controls.MaterialCheckBox chk1; 298 | private MaterialSkin.Controls.MaterialCheckBox chkLine; 299 | private MaterialSkin.Controls.MaterialCheckBox chkHealth; 300 | private MaterialSkin.Controls.MaterialCheckBox chkRadar; 301 | private MaterialSkin.Controls.MaterialFlatButton materialFlatButton1; 302 | private System.Windows.Forms.NotifyIcon notifyIcon1; 303 | private MaterialSkin.Controls.MaterialCheckBox chkJump; 304 | private MaterialSkin.Controls.MaterialLabel materialLabel1; 305 | private System.Windows.Forms.Timer timer1; 306 | private MaterialSkin.Controls.MaterialCheckBox chkWebMap; 307 | private MaterialSkin.Controls.MaterialLabel materialLabel2; 308 | } 309 | } -------------------------------------------------------------------------------- /ESP/ESP/main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using MaterialSkin; 11 | using MaterialSkin.Controls; 12 | 13 | namespace CPUZ 14 | { 15 | public partial class mainFrom : MaterialForm 16 | { 17 | public static bool STATE = false; 18 | public mainFrom() 19 | { 20 | InitializeComponent(); 21 | var materialSkinManager = MaterialSkinManager.Instance; 22 | materialSkinManager.AddFormToManage(this); 23 | materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT; 24 | materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE); 25 | } 26 | 27 | private void main_Load(object sender, EventArgs e) 28 | { 29 | this.timer1.Enabled = true; 30 | this.timer1.Interval = 500; 31 | this.MinimumSize = new Size(100, 100); 32 | 33 | this.chk1.Checked = Setting.车辆显示; 34 | this.chk2.Checked = Setting.物品显示; 35 | this.chkHealth.Checked = Setting.距离和血量; 36 | this.chkLine.Checked = Setting.线条; 37 | 38 | new Cpuz().Show(); 39 | 40 | } 41 | 42 | private void materialCheckBox1_CheckedChanged(object sender, EventArgs e) 43 | { 44 | Setting.车辆显示 = chk1.Checked; 45 | } 46 | 47 | private void materialCheckBox2_CheckedChanged(object sender, EventArgs e) 48 | { 49 | Setting.物品显示 = chk2.Checked; 50 | 51 | } 52 | 53 | private void main_Leave(object sender, EventArgs e) 54 | { 55 | KReader.Close(); 56 | Application.Exit(); 57 | 58 | } 59 | 60 | private void chkHealth_CheckedChanged(object sender, EventArgs e) 61 | { 62 | Setting.距离和血量 = chkHealth.Checked; 63 | } 64 | 65 | private void chkLine_CheckedChanged(object sender, EventArgs e) 66 | { 67 | Setting.线条 = chkLine.Checked; 68 | 69 | } 70 | 71 | private void chkRadar_CheckedChanged(object sender, EventArgs e) 72 | { 73 | Setting.雷达 = chkRadar.Checked; 74 | } 75 | 76 | 77 | private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) 78 | { 79 | if (this.Visible) 80 | this.Hide(); 81 | else 82 | this.Show(); 83 | } 84 | 85 | private void chkJump_CheckedChanged(object sender, EventArgs e) 86 | { 87 | Setting.一键大跳 = chkJump.Checked; 88 | } 89 | 90 | private void materialFlatButton1_Click_1(object sender, EventArgs e) 91 | { 92 | this.Hide(); 93 | 94 | } 95 | 96 | 97 | private void timer1_Tick(object sender, EventArgs e) 98 | { 99 | if(STATE) 100 | { 101 | materialLabel1.Text = "正常"; 102 | } 103 | else 104 | { 105 | materialLabel1.Text = "无数据"; 106 | } 107 | if (KReader.m_PUBase == 0) 108 | { 109 | materialLabel2.Text = "驱动不正常"; 110 | } 111 | else 112 | { 113 | materialLabel2.Text = KReader.m_PUBase.ToString(); 114 | } 115 | chkRadar.Checked = Setting.雷达; 116 | chk1.Checked = Setting.车辆显示; 117 | chk2.Checked = Setting.物品显示; 118 | 119 | } 120 | 121 | private void chkWebMap_CheckedChanged(object sender, EventArgs e) 122 | { 123 | Setting.Web端 = chkWebMap.Checked; 124 | 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /ESP/ESP/main.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 | 17, 17 122 | 123 | 124 | 125 | 126 | AAABAAIAEBAAAAEACABoBQAAJgAAABAQAAABACAAaAQAAI4FAAAoAAAAEAAAACAAAAABAAgAAAAAAAAB 127 | AAAAAAAAAAAAAAABAAAAAQAAAAAAADEeIQAjIiIALSAlACYlLgA0IiQAMyUqACcnNQAoJzUAIy0xAC0q 128 | MgApKTYALiw2ACoqOQAtLDsALSw9ADUqMwA3MDIAOTIzADs4NgAyMDsAMzI+AEMsNQBANzgASDQ6AEE/ 129 | PQBKQD8APTNCADw2QgA9OEEAPz5GADw3SAAiM28AQDpEAEM/SABGP0kALEdNADFUWwAdWncARkFLAE9L 130 | VABUSFcAUkxWAEJTVQBWUFkAW1RaAGJJUQBVdnsAY2BpAGVjagBxZmMAcWxvAHZwcgCDYWYAgndzADVs 131 | gwBcd5IARVa8ACIdyQAtLP8AGGLrABqI2AADi/kAEpv/ACCd/wAcsPkAK6X/ADCp/wA9rv8AQKP5AB7T 132 | /wArzv8AN8//ACfZ/wBny9UAXd3+AHDV4AB91+EAedvlAHfe6QB53ukAfeHsAGLi/wCfn54AppuYALSn 133 | qACS4+kAjufxAIXp9ACJ6vUAkOjxAJLt+QCU8/8Al/T/AJrz/wCd9P8AqufpAKTs9QCl7/kAo/T/AKn0 134 | /wCt9f8AsvX/ALX1/wC69/8A1szJAMT3/ADO+f8A2/r/AOH7/wDk/P8A7f3/APH+/wD3//8A+v//AP// 135 | /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 136 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 137 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 138 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 139 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 140 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 141 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 142 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 143 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 144 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE1PT09MTEpKT00AAAAAAFBiZ2VjW05PSkpPTwAAAFprb3Bu 145 | aGNfWU9KUVhXAABibnJycGpnX19ZUUpcTwAAZ25gcnBrUGVfXEpYUFgAAGdhbG5WPDtYX0o7XEpcAABn 146 | TzlnN0VDP0o+JiA6WAAATzgrPUtSRklHSEElGAAAAAATBwckREJARC8JEBIAAAAAGQ8PVHIsLHJpEA8R 147 | AAAAABoPD3IFMTEBchUPFwAAAAA2HBxVcioqclQCCjIAAAAAACcfKi4WAxANBwoAAAAAAAAAIyM1GAYJ 148 | DxQAAAAAAAAAAAA0IyEdIzMAAAAAAAAAAAAAAAAAAAAAAAAAAADgBwAAwAMAAIABAACAAQAAgAEAAIAB 149 | AACAAQAAgAMAAMADAADAAwAAwAMAAMADAADgBwAA8A8AAPgfAAD//wAAKAAAABAAAAAgAAAAAQAgAAAA 150 | AABABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH3X4f933un/d97p/3fe6f9w1eD/cNXg/2fL 151 | 1f9ny9X/d97p/33X4f8AAAAAAAAAAAAAAAAAAAAAAAAAAHne6f+m7/n/tfb//631//+j9P//ku35/3nb 152 | 5f933un/Z8vV/2fL1f933un/d97p/wAAAAAAAAAAAAAAAJDo8f/O+f//7f3///L+///k/P//uvf//6P0 153 | //+d9P//iur1/3fe6f9ny9X/f+Hs/4Xp9P+O5/H/AAAAAAAAAACl7/n/5vz///v////3////8f///8T3 154 | /P+09v//n/T//5rz//+J6vX/fOLt/2fL1f+U8///d97p/wAAAAAAAAAAtvb//+H7//+q5+n/+f////L/ 155 | ///O+f//et/p/6n0//+b8///l/T//2fL1f+H6fX/d97p/4Xp9P8AAAAAAAAAALT1//+k7PX/2/r//+T8 156 | //+S4+n/GGLr/y0s//+F6fT/nPT//2fL1f8tLP//lPP//2fL1f+U8///AAAAAAAAAACy9f//eN7p/0VW 157 | vP+29v//NWyD/0Cj+f8wqf//Epv//2fL1f8Di/n/HVp3/yIzb/8iHcn/hen0/wAAAAAAAAAAd97p/1x3 158 | kv9CU1X/GojY/13d/v9i4v//HtP//yfZ//8rzv//N8///xyw+f8xVFv/SDU5/wAAAAAAAAAAAAAAAAAA 159 | AAA7ODb/Jyc1/ycnNf8sR03/P6///yul//8gnf//PK7//1V2e/8jLTH/NSoz/zkyM/8AAAAAAAAAAAAA 160 | AAAAAAAAQT89/y0tP/8sLD3/ppuY//////9WUFn/W1Ra///////WzMn/Lyoy/y8tPP83MDL/AAAAAAAA 161 | AAAAAAAAAAAAAEpAP/8tLDv/LS0///////80IiT/ZWNq/2Ngaf8xHiH//////zMyPv8tLD3/QDc4/wAA 162 | AAAAAAAAAAAAAAAAAACCd3P/PDZC/z0zQv+0p6j//////1JMVv9PS1T//////5+fnv8jIiL/LCoy/3Fm 163 | Y/8AAAAAAAAAAAAAAAAAAAAAuba3eEZBS/88N0j/VEhX/2JJUf9DLDX/LSAl/y8tNv8pKTb/JiUu/y0s 164 | Nv+5trd4AAAAAAAAAAAAAAAAAAAAAAAAAAC5trd4Qz9I/0c/Sv+DYWb/STQ7/zMlKv8oJzX/Kio5/zIw 165 | O/+5trd4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2cHL/Rj9I/0A6RP89OEH/Pz5G/3Fs 166 | b/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 167 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgBwAAwAMAAIABAACAAQAAgAEAAIABAACAAQAAgAMAAMAD 168 | AADAAwAAwAMAAMADAADAAwAA4AcAAPgfAAD//wAA 169 | 170 | 171 | 172 | 135, 17 173 | 174 | -------------------------------------------------------------------------------- /ESP/ESP/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 腾讯代理吃鸡,此项目停更只用于学习交流 2 | 3 | 4 | 5 | # node server 6 | 运行npm install安装环境 7 | 8 | 运行node server.js 9 | 10 | PUT地址 http://127.0.0.1:3000/api/6 11 | 12 | GET地址 http://127.0.0.1:3000/api/6 13 | -------------------------------------------------------------------------------- /node_server/Server.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var bodyParser = require('body-parser').json({limit: '50mb'}); 3 | var cache = require('memory-cache'); 4 | var app = express(); 5 | app.put('/api/:id', bodyParser, function (req, res) { 6 | cache.put("data", req.body); 7 | res.status(200).send("ok"); 8 | }); 9 | 10 | app.get('/api/:id', function (req, res) { 11 | var data = cache.get("data"); 12 | res.setHeader('Access-Control-Allow-Origin', '*'); 13 | res.setHeader('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS'); 14 | res.setHeader('Access-Control-Allow-Headers', 'Accept, Content-Type, Origin'); 15 | res.setHeader('Access-Control-Allow-Credentials', true); 16 | res.send(data); 17 | }); 18 | app.listen(3000, function () { 19 | console.log('Example app listening on port 3000!') 20 | }); -------------------------------------------------------------------------------- /node_server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 | 24 | 25 | 26 | 27 | 28 | 746 | 747 | -------------------------------------------------------------------------------- /node_server/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jerrytang67/helloworld/a24a59c1bb66be00349a83323bed3ef7652741ef/node_server/map.jpg -------------------------------------------------------------------------------- /node_server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello-world", 3 | "description": "hello world test app", 4 | "version": "0.0.1", 5 | "private": true, 6 | "dependencies": { 7 | "body-parser": "^1.18.2", 8 | "connect": "^3.6.5", 9 | "express": "^4.16.2", 10 | "memory-cache": "^0.2.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /node_server/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------