From e92a9357b71a9ea246511b224434368295982dde Mon Sep 17 00:00:00 2001 From: sagirilover Date: Wed, 29 Jul 2020 19:07:16 +0300 Subject: [PATCH] autoupdate + refactoring --- .gitignore | 361 +++++++++++++ AnimeSoftware/AnimeForm.cs | 45 +- AnimeSoftware/AnimeSoftware.csproj | 27 +- AnimeSoftware/Hacks/Aimbot.cs | 14 +- AnimeSoftware/Hacks/BHop.cs | 6 +- AnimeSoftware/Hacks/BlockBot.cs | 10 +- AnimeSoftware/Hacks/ClanTag.cs | 2 +- AnimeSoftware/Hacks/NameStealer.cs | 2 +- AnimeSoftware/Hacks/PerfectNade.cs | 2 +- AnimeSoftware/Hacks/RunboostBot.cs | 4 +- AnimeSoftware/Hacks/Visuals.cs | 2 +- AnimeSoftware/Hacks/WeaponSpammer.cs | 2 +- AnimeSoftware/Hotkey.cs | 17 - AnimeSoftware/Injections/ConVar.cs | 2 +- AnimeSoftware/Math.cs | 17 - AnimeSoftware/Objects/ClientCMD.cs | 2 +- AnimeSoftware/Objects/Entity.cs | 28 +- AnimeSoftware/Objects/LocalPlayer.cs | 48 +- AnimeSoftware/{ => Objects}/Structs.cs | 238 +++++++-- .../{ScannedOffsets.cs => CalcedOffsets.cs} | 10 +- AnimeSoftware/Offsets/NetVarManager.cs | 103 ++++ AnimeSoftware/Offsets/Offsets.cs | 473 ++++++++++++------ AnimeSoftware/Overlay.Designer.cs | 72 --- AnimeSoftware/Overlay.cs | 98 ---- AnimeSoftware/Overlay.resx | 123 ----- AnimeSoftware/Overlay/Overlay.Designer.cs | 56 --- AnimeSoftware/Overlay/Overlay.cs | 20 - AnimeSoftware/Overlay/Overlay.resx | 120 ----- .../Overlay/OverlaySettings.Designer.cs | 39 -- AnimeSoftware/Overlay/OverlaySettings.cs | 20 - AnimeSoftware/{ => Utils}/Checks.cs | 6 +- AnimeSoftware/Utils/Log.cs | 29 ++ AnimeSoftware/{ => Utils}/Memory.cs | 106 +--- README.md | 4 +- version | 5 +- 35 files changed, 1146 insertions(+), 967 deletions(-) delete mode 100644 AnimeSoftware/Hotkey.cs delete mode 100644 AnimeSoftware/Math.cs rename AnimeSoftware/{ => Objects}/Structs.cs (61%) rename AnimeSoftware/Offsets/{ScannedOffsets.cs => CalcedOffsets.cs} (93%) create mode 100644 AnimeSoftware/Offsets/NetVarManager.cs delete mode 100644 AnimeSoftware/Overlay.Designer.cs delete mode 100644 AnimeSoftware/Overlay.cs delete mode 100644 AnimeSoftware/Overlay.resx delete mode 100644 AnimeSoftware/Overlay/Overlay.Designer.cs delete mode 100644 AnimeSoftware/Overlay/Overlay.cs delete mode 100644 AnimeSoftware/Overlay/Overlay.resx delete mode 100644 AnimeSoftware/Overlay/OverlaySettings.Designer.cs delete mode 100644 AnimeSoftware/Overlay/OverlaySettings.cs rename AnimeSoftware/{ => Utils}/Checks.cs (86%) create mode 100644 AnimeSoftware/Utils/Log.cs rename AnimeSoftware/{ => Utils}/Memory.cs (68%) diff --git a/.gitignore b/.gitignore index e64b4bd..99d8700 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,364 @@ AnimeSoftware/bin/Release/ AnimeSoftware/obj/Debug/ AnimeSoftware/obj/Release/ + + +# Created by https://www.toptal.com/developers/gitignore/api/csharp +# Edit at https://www.toptal.com/developers/gitignore?templates=csharp + +### Csharp ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# End of https://www.toptal.com/developers/gitignore/api/csharp \ No newline at end of file diff --git a/AnimeSoftware/AnimeForm.cs b/AnimeSoftware/AnimeForm.cs index b51baff..f1deb1b 100644 --- a/AnimeSoftware/AnimeForm.cs +++ b/AnimeSoftware/AnimeForm.cs @@ -1,7 +1,9 @@ using AnimeSoftware.Hacks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; +using AnimeSoftware.Utils; +using AnimeSoftware.Offsets; using Opulos.Core.UI; using System; using System.Collections.Generic; @@ -25,10 +27,8 @@ namespace AnimeSoftware InitializeComponent(); } - private void Form1_Load(object sender, EventArgs e) + private unsafe void Form1_Load(object sender, EventArgs e) { - - while (!Init()) { DialogResult result = MessageBox.Show("The game is not open.\nAlso make sure that you open the application as administrator.", "Can't attach to process", MessageBoxButtons.RetryCancel, MessageBoxIcon.Information); @@ -45,7 +45,11 @@ namespace AnimeSoftware } Thread.Sleep(100); } - ScannedOffsets.Init(); + + CalcedOffsets.Init(); + Offsets.signatures.Init(); + Offsets.netvars.Init(); + Properties.Settings.Default.namestealer = false; Properties.Settings.Default.Save(); Start(); @@ -106,8 +110,6 @@ namespace AnimeSoftware visualsThread.Start(); } - - public void UpdateNickBox() { nickBox.Rows.Clear(); @@ -141,25 +143,26 @@ namespace AnimeSoftware nickBox.Rows[ind].Cells["aliveColumn"].Style.ForeColor = statusColor; } } + public static bool Init() { Checks.CheckVersion(); - if (Properties.Settings.Default.debug) - Console.WriteLine("Update checked..."); + Log.Debug("Update checked..."); + if (!Memory.OpenProcess("csgo")) return false; - if (Properties.Settings.Default.debug) - Console.WriteLine("Process opened..."); + Log.Debug("Process opened..."); + Thread.Sleep(100); if (!Memory.ProcessHandle()) return false; - if (Properties.Settings.Default.debug) - Console.WriteLine("Process handled..."); + Log.Debug("Process handled..."); + Thread.Sleep(100); if (!Memory.GetModules()) return false; - if (Properties.Settings.Default.debug) - Console.WriteLine("Module get succses..."); + Log.Debug("Module get succses..."); + return true; } @@ -206,11 +209,6 @@ namespace AnimeSoftware UpdateNickBox(); } - private void kickButton_Click(object sender, EventArgs e) - { - // idk how get UserID lol - } - private void AnimeForm_Shown(object sender, EventArgs e) { UpdateNickBox(); @@ -244,11 +242,6 @@ namespace AnimeSoftware hitboxComboBox.Items.Add(x); if (Properties.Settings.Default.boneid != 0) hitboxComboBox.SelectedItem = Structs.Hitbox[Properties.Settings.Default.boneid]; - if (this.Text.ToLower().Contains("philiphook")) - { - Process.GetProcessesByName("csgo")[0].Kill(); - Application.Exit(); - } trackBar1.Value = (int)(BlockBot.trajFactor * 100); label8.Text = BlockBot.trajFactor.ToString(); trackBar2.Value = (int)(BlockBot.distanceFactor * 10); @@ -544,7 +537,7 @@ namespace AnimeSoftware Properties.Settings.Default.chatcleaner = chatcleanerCheckBox.Checked; Properties.Settings.Default.Save(); - Thread chatcleanerThread = new Thread(new ThreadStart(ChatSpammer.RceMem)) + Thread chatcleanerThread = new Thread(new ThreadStart(ChatSpammer.ChatCleaner)) { Priority = ThreadPriority.Highest, IsBackground = true, diff --git a/AnimeSoftware/AnimeSoftware.csproj b/AnimeSoftware/AnimeSoftware.csproj index 451805c..4c07045 100644 --- a/AnimeSoftware/AnimeSoftware.csproj +++ b/AnimeSoftware/AnimeSoftware.csproj @@ -12,6 +12,8 @@ 512 true true + + AnyCPU @@ -32,6 +34,7 @@ TRACE prompt 4 + true @@ -42,6 +45,7 @@ + @@ -59,7 +63,8 @@ Component - + + @@ -68,7 +73,6 @@ - @@ -85,15 +89,8 @@ AnimeForm.cs - - - - - Form - - - Overlay.cs - + + @@ -101,14 +98,12 @@ True Hotkey.settings - - + + + AnimeForm.cs - - Overlay.cs - ResXFileCodeGenerator Resources.Designer.cs diff --git a/AnimeSoftware/Hacks/Aimbot.cs b/AnimeSoftware/Hacks/Aimbot.cs index 1f99943..cda2957 100644 --- a/AnimeSoftware/Hacks/Aimbot.cs +++ b/AnimeSoftware/Hacks/Aimbot.cs @@ -12,7 +12,7 @@ namespace AnimeSoftware.Hacks { class Aimbot { - public static Vector3 oldPunchAngle = new Vector3(); + public static Vector oldPunchAngle = new Vector(); public static void Start() { while (Properties.Settings.Default.aimbot) @@ -38,9 +38,9 @@ namespace AnimeSoftware.Hacks } } - public static Vector3 CalcAngle(Vector3 src, Vector3 dst) + public static Vector CalcAngle(Vector src, Vector dst) { - Vector3 angles = new Vector3 { x = 0, y = 0, z = 0 }; + Vector angles = new Vector { x = 0, y = 0, z = 0 }; double[] delta = { (src.x - dst.x), (src.y - dst.y), (src.z - dst.z) }; float hyp = (float)Math.Sqrt(delta[0] * delta[0] + delta[1] * delta[1]); angles.x = (float)(Math.Atan(delta[2] / hyp) * 180.0f / Math.PI); @@ -51,15 +51,15 @@ namespace AnimeSoftware.Hacks } return angles; } - public static Vector3 Smooth(Vector3 src, Vector3 dst) + public static Vector Smooth(Vector src, Vector dst) { - Vector3 smoothed = dst - src; + Vector smoothed = dst - src; smoothed = src + smoothed/100*Properties.Settings.Default.smooth; return smoothed; } - public static Vector3 RSC(Vector3 src) + public static Vector RSC(Vector src) { src -= LocalPlayer.PunchAngle * 2.0f; oldPunchAngle = LocalPlayer.PunchAngle * 2.0f; @@ -108,7 +108,7 @@ namespace AnimeSoftware.Hacks return new Entity(Index); } - public static Vector3 NormalizedAngle(Vector3 src) + public static Vector NormalizedAngle(Vector src) { while (src.x > 89.0f) src.x -= 180.0f; diff --git a/AnimeSoftware/Hacks/BHop.cs b/AnimeSoftware/Hacks/BHop.cs index d0c1a9e..f216b85 100644 --- a/AnimeSoftware/Hacks/BHop.cs +++ b/AnimeSoftware/Hacks/BHop.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { @@ -29,7 +29,7 @@ namespace AnimeSoftware.Hacks if (LocalPlayer.Speed <= 0) continue; - Vector3 oldAngle = LocalPlayer.ViewAngle; + Vector oldAngle = LocalPlayer.ViewAngle; while ((DllImport.GetAsyncKeyState(0x20) & 0x8000) != 0) { @@ -38,7 +38,7 @@ namespace AnimeSoftware.Hacks if (Properties.Settings.Default.autostrafe) { strafe = true; - Vector3 cuurentAngle = LocalPlayer.ViewAngle; + Vector cuurentAngle = LocalPlayer.ViewAngle; if (cuurentAngle.y > oldAngle.y) { LocalPlayer.MoveLeft(); diff --git a/AnimeSoftware/Hacks/BlockBot.cs b/AnimeSoftware/Hacks/BlockBot.cs index 7615749..1315657 100644 --- a/AnimeSoftware/Hacks/BlockBot.cs +++ b/AnimeSoftware/Hacks/BlockBot.cs @@ -1,5 +1,5 @@ using System; -using hazedumper; +using AnimeSoftware.Offsets; using System.Collections.Generic; using System.Linq; using System.Text; @@ -50,10 +50,10 @@ namespace AnimeSoftware.Hacks if ((LocalPlayer.Position - target.BonePosition(8)).Length < 43) { - Vector3 targetOrigin = target.Position + target.Velocity * trajFactor; + Vector targetOrigin = target.Position + target.Velocity * trajFactor; targetOrigin.z = 0; - Vector3 localOrigin = LocalPlayer.Position; + Vector localOrigin = LocalPlayer.Position; localOrigin.z = 0; float distance = (targetOrigin - localOrigin).Length; @@ -74,7 +74,7 @@ namespace AnimeSoftware.Hacks LocalPlayer.ForwardSpeed = 450; else LocalPlayer.ForwardSpeed = 0; - Vector3 angle = Aimbot.CalcAngle(LocalPlayer.ViewPosition, target.Position); + Vector angle = Aimbot.CalcAngle(LocalPlayer.ViewPosition, target.Position); angle.y -= LocalPlayer.ViewAngle.y; angle = Aimbot.NormalizedAngle(angle); @@ -150,7 +150,7 @@ namespace AnimeSoftware.Hacks else { bb = true; - Vector3 angle = Aimbot.CalcAngle(LocalPlayer.ViewPosition, target.Position); + Vector angle = Aimbot.CalcAngle(LocalPlayer.ViewPosition, target.Position); angle.y -= LocalPlayer.ViewAngle.y; angle = Aimbot.NormalizedAngle(angle); diff --git a/AnimeSoftware/Hacks/ClanTag.cs b/AnimeSoftware/Hacks/ClanTag.cs index 2f8b6bb..eeeef15 100644 --- a/AnimeSoftware/Hacks/ClanTag.cs +++ b/AnimeSoftware/Hacks/ClanTag.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { diff --git a/AnimeSoftware/Hacks/NameStealer.cs b/AnimeSoftware/Hacks/NameStealer.cs index 7f71b55..846b9f8 100644 --- a/AnimeSoftware/Hacks/NameStealer.cs +++ b/AnimeSoftware/Hacks/NameStealer.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { diff --git a/AnimeSoftware/Hacks/PerfectNade.cs b/AnimeSoftware/Hacks/PerfectNade.cs index e4d1949..2739936 100644 --- a/AnimeSoftware/Hacks/PerfectNade.cs +++ b/AnimeSoftware/Hacks/PerfectNade.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { diff --git a/AnimeSoftware/Hacks/RunboostBot.cs b/AnimeSoftware/Hacks/RunboostBot.cs index 80d6ab0..45fc9e4 100644 --- a/AnimeSoftware/Hacks/RunboostBot.cs +++ b/AnimeSoftware/Hacks/RunboostBot.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { @@ -44,7 +44,7 @@ namespace AnimeSoftware.Hacks boosting = true; - Vector3 position = target.Position; + Vector position = target.Position; if (target.Speed <= 0) { diff --git a/AnimeSoftware/Hacks/Visuals.cs b/AnimeSoftware/Hacks/Visuals.cs index 6230346..2e8df52 100644 --- a/AnimeSoftware/Hacks/Visuals.cs +++ b/AnimeSoftware/Hacks/Visuals.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using hazedumper; +using AnimeSoftware.Offsets; using System.Drawing; using AnimeSoftware.Objects; using System.Threading; diff --git a/AnimeSoftware/Hacks/WeaponSpammer.cs b/AnimeSoftware/Hacks/WeaponSpammer.cs index 17438cf..707a7fc 100644 --- a/AnimeSoftware/Hacks/WeaponSpammer.cs +++ b/AnimeSoftware/Hacks/WeaponSpammer.cs @@ -6,7 +6,7 @@ using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; using AnimeSoftware.Objects; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Hacks { diff --git a/AnimeSoftware/Hotkey.cs b/AnimeSoftware/Hotkey.cs deleted file mode 100644 index a368e06..0000000 --- a/AnimeSoftware/Hotkey.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace AnimeSoftware -{ - class Hotkey - { - public static void Start() - { - - } - } -} diff --git a/AnimeSoftware/Injections/ConVar.cs b/AnimeSoftware/Injections/ConVar.cs index d0d96d6..3619f1e 100644 --- a/AnimeSoftware/Injections/ConVar.cs +++ b/AnimeSoftware/Injections/ConVar.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Injections { diff --git a/AnimeSoftware/Math.cs b/AnimeSoftware/Math.cs deleted file mode 100644 index 3f112fa..0000000 --- a/AnimeSoftware/Math.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AnimeSoftware -{ - class VectorMath - { - public static float Distance(Vector3 src, Vector3 dst) - { - float result = (float)Math.Sqrt((dst.x-src.x) * (dst.x-src.x) + (dst.y-src.y) * (dst.y-src.y) + (dst.z-src.z) * (dst.z-src.z)); - return result; - } - } -} diff --git a/AnimeSoftware/Objects/ClientCMD.cs b/AnimeSoftware/Objects/ClientCMD.cs index 6032245..9b4a384 100644 --- a/AnimeSoftware/Objects/ClientCMD.cs +++ b/AnimeSoftware/Objects/ClientCMD.cs @@ -28,7 +28,7 @@ namespace AnimeSoftware.Objects var szCmd_bytes = Encoding.UTF8.GetBytes(szCmd + "\0"); Memory.WriteProcessMemory(Memory.pHandle, Address, szCmd_bytes, szCmd_bytes.Length, 0); - IntPtr Thread = DllImport.CreateRemoteThread(Memory.pHandle, (IntPtr)null, IntPtr.Zero, new IntPtr(Memory.Engine + ScannedOffsets.ClientCMD), Address, 0, (IntPtr)null); + IntPtr Thread = DllImport.CreateRemoteThread(Memory.pHandle, (IntPtr)null, IntPtr.Zero, new IntPtr(Memory.Engine + CalcedOffsets.ClientCMD), Address, 0, (IntPtr)null); DllImport.CloseHandle(Thread); DllImport.WaitForSingleObject(Thread, 0xFFFFFFFF); } diff --git a/AnimeSoftware/Objects/Entity.cs b/AnimeSoftware/Objects/Entity.cs index 1c07d19..ad2313b 100644 --- a/AnimeSoftware/Objects/Entity.cs +++ b/AnimeSoftware/Objects/Entity.cs @@ -4,16 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Objects { - class Entity : IDisposable + class Entity { - public void Dispose() - { - - } public int Index; public int Ptr { @@ -66,15 +62,15 @@ namespace AnimeSoftware.Objects { get { - return VectorMath.Distance(Position, LocalPlayer.Position); + return Position.DistanceTo(LocalPlayer.Position); } } - public Vector3 Velocity + public Vector Velocity { get { - Vector3 velocity = Memory.Read(Ptr + netvars.m_vecVelocity); + Vector velocity = Memory.Read(Ptr + netvars.m_vecVelocity); return velocity; } } @@ -106,25 +102,25 @@ namespace AnimeSoftware.Objects { get { - Vector3 velocity = Velocity; + Vector velocity = Velocity; float result = (float)Math.Sqrt(velocity.x * velocity.x + velocity.y * velocity.y + velocity.z * velocity.z); return result; } } - public Vector3 Position + public Vector Position { get { - Vector3 position = Memory.Read(Ptr + netvars.m_vecOrigin); + Vector position = Memory.Read(Ptr + netvars.m_vecOrigin); return position; } } - public Vector3 ViewPosition + public Vector ViewPosition { get { - Vector3 position = Position; + Vector position = Position; position.z += Memory.Read(Ptr + netvars.m_vecViewOffset + 0x8); return position; } @@ -175,10 +171,10 @@ namespace AnimeSoftware.Objects return entityList.ToArray(); } - public Vector3 BonePosition(int BoneID) + public Vector BonePosition(int BoneID) { int BoneMatrix = Memory.Read(Ptr + netvars.m_dwBoneMatrix); - Vector3 position = new Vector3 + Vector position = new Vector { x = Memory.Read(BoneMatrix + 0x30 * BoneID + 0x0C), y = Memory.Read(BoneMatrix + 0x30 * BoneID + 0x1C), diff --git a/AnimeSoftware/Objects/LocalPlayer.cs b/AnimeSoftware/Objects/LocalPlayer.cs index ec45762..730327b 100644 --- a/AnimeSoftware/Objects/LocalPlayer.cs +++ b/AnimeSoftware/Objects/LocalPlayer.cs @@ -5,16 +5,12 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using AnimeSoftware.Injections; -using hazedumper; +using AnimeSoftware.Offsets; namespace AnimeSoftware.Objects { - class LocalPlayer : IDisposable + class LocalPlayer { - public void Dispose() - { - - } public static int Ptr { get @@ -75,19 +71,19 @@ namespace AnimeSoftware.Objects return Memory.Read(Ptr + netvars.m_iShotsFired); } } - public static Vector3 Position + public static Vector Position { get { - Vector3 position = Memory.Read(Ptr + netvars.m_vecOrigin); + Vector position = Memory.Read(Ptr + netvars.m_vecOrigin); return position; } } - public static Vector3 Velocity + public static Vector Velocity { get { - Vector3 velocity = Memory.Read(Ptr + netvars.m_vecVelocity); + Vector velocity = Memory.Read(Ptr + netvars.m_vecVelocity); return velocity; } } @@ -142,7 +138,7 @@ namespace AnimeSoftware.Objects { get { - Vector3 velocity = Velocity; + Vector velocity = Velocity; float result = (float)Math.Sqrt(velocity.x * velocity.x + velocity.y * velocity.y); return result; } @@ -164,7 +160,7 @@ namespace AnimeSoftware.Objects { set { - Memory.Write(Memory.Read(Memory.Client + ScannedOffsets.dwUse), value); + Memory.Write(Memory.Read(Memory.Client + CalcedOffsets.dwUse), value); } } public static bool InGame @@ -180,7 +176,7 @@ namespace AnimeSoftware.Objects { set { - Memory.WriteBytes(Memory.Read(Memory.Client + ScannedOffsets.cl_sidespeed), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ ScannedOffsets.xor_cl_sidespeed)); + Memory.WriteBytes(Memory.Read(Memory.Client + CalcedOffsets.cl_sidespeed), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ CalcedOffsets.xor_cl_sidespeed)); } } @@ -188,7 +184,7 @@ namespace AnimeSoftware.Objects { set { - Memory.WriteBytes(Memory.Read(Memory.Client + ScannedOffsets.cl_forwardspeed), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ ScannedOffsets.xor_cl_forwardspeed)); + Memory.WriteBytes(Memory.Read(Memory.Client + CalcedOffsets.cl_forwardspeed), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ CalcedOffsets.xor_cl_forwardspeed)); } } @@ -196,7 +192,7 @@ namespace AnimeSoftware.Objects { set { - Memory.WriteBytes(Memory.Read(Memory.Client + ScannedOffsets.viewmodel_x), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ ScannedOffsets.xor_viewmodel_x)); + Memory.WriteBytes(Memory.Read(Memory.Client + CalcedOffsets.viewmodel_x), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ CalcedOffsets.xor_viewmodel_x)); } } @@ -204,7 +200,7 @@ namespace AnimeSoftware.Objects { set { - Memory.WriteBytes(Memory.Read(Memory.Client + ScannedOffsets.viewmodel_y), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ ScannedOffsets.xor_viewmodel_y)); + Memory.WriteBytes(Memory.Read(Memory.Client + CalcedOffsets.viewmodel_y), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ CalcedOffsets.xor_viewmodel_y)); } } @@ -212,7 +208,7 @@ namespace AnimeSoftware.Objects { set { - Memory.WriteBytes(Memory.Read(Memory.Client + ScannedOffsets.viewmodel_z), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ ScannedOffsets.xor_viewmodel_z)); + Memory.WriteBytes(Memory.Read(Memory.Client + CalcedOffsets.viewmodel_z), BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0) ^ CalcedOffsets.xor_viewmodel_z)); } } public static int CrossHair @@ -244,44 +240,44 @@ namespace AnimeSoftware.Objects return Memory.Read(Memory.Read(Memory.Client + signatures.dwEntityList + (weaponHandle - 1) * 0x10) + netvars.m_iItemDefinitionIndex); } } - public static Vector3 ViewPosition + public static Vector ViewPosition { get { - Vector3 position = Position; + Vector position = Position; position.z += Memory.Read(Ptr + netvars.m_vecViewOffset + 0x8); return position; } } - public static Vector3 ViewAngle + public static Vector ViewAngle { get { int ClientState = Memory.Read(Memory.Engine + signatures.dwClientState); - Vector3 viewAngles = Memory.Read(ClientState + signatures.dwClientState_ViewAngles); + Vector viewAngles = Memory.Read(ClientState + signatures.dwClientState_ViewAngles); return viewAngles; } set { int ClientState = Memory.Read(Memory.Engine + signatures.dwClientState); - Memory.Write(ClientState + signatures.dwClientState_ViewAngles, value); + Memory.Write(ClientState + signatures.dwClientState_ViewAngles, value); } } - public static Vector3 PunchAngle + public static Vector PunchAngle { get { - return Memory.Read(Ptr + netvars.m_aimPunchAngle); + return Memory.Read(Ptr + netvars.m_aimPunchAngle); } } - public static Vector3 LocalViewAngle + public static Vector LocalViewAngle { set { - Memory.Write(Ptr + netvars.m_viewPunchAngle, value); + Memory.Write(Ptr + netvars.m_viewPunchAngle, value); } } public static float ViewAngleY diff --git a/AnimeSoftware/Structs.cs b/AnimeSoftware/Objects/Structs.cs similarity index 61% rename from AnimeSoftware/Structs.cs rename to AnimeSoftware/Objects/Structs.cs index 11b5076..3cea98c 100644 --- a/AnimeSoftware/Structs.cs +++ b/AnimeSoftware/Objects/Structs.cs @@ -20,6 +20,116 @@ namespace AnimeSoftware }; } + public unsafe struct ClientClass + { + IntPtr m_pCreateFn; + IntPtr m_pCreateEventFn; + ConstChar* m_pNetworkName; + RecvTable* m_pRecvTable; + ClientClass* m_pNext; + int m_ClassID; + + public string GetName() + { + fixed (ClientClass* ptr = &this) + return ((ConstChar*)Memory.Read((int)ptr + 0x8))->ToString(); + } + + public RecvTable* GetRecvTable() + { + fixed (ClientClass* ptr = &this) + return ((RecvTable*)Memory.Read((int)ptr + 0xC)); + } + + public ClientClass* Next() + { + fixed (ClientClass* ptr = &this) + return ((ClientClass*)Memory.Read((int)ptr + 0x10)); + } + } + public unsafe struct RecvTable + { + RecvProp* m_pProps; + int m_nProps; + IntPtr m_pDecoder; + ConstChar* m_pNetTableName; + byte m_bInitialized; + byte m_bInMainList; + + public string GetName() + { + fixed (RecvTable* ptr = &this) + return ((ConstChar*)Memory.Read((int)ptr + 0xC))->ToString(); + } + + public RecvProp* GetRecvProps() + { + fixed (RecvTable* ptr = &this) + return ((RecvProp*)Memory.Read((int)ptr)); + } + + public int GetPropsCount() + { + fixed (RecvTable* ptr = &this) + return Memory.Read((int)ptr + 0x4); + } + } + public unsafe struct RecvProp + { + ConstChar* m_pVarName; + int m_RecvType; + int m_Flags; + int m_StringBufferSize; + int m_bInsideArray; + IntPtr m_pExtraData; + RecvProp* m_pArrayProp; + IntPtr m_ArrayLengthProxy; + IntPtr m_ProxyFn; + IntPtr m_DataTableProxyFn; + RecvTable* m_pDataTable; + int m_Offset; + int m_ElementStride; + int m_nElements; + ConstChar* m_pParentArrayPropName; + + public RecvTable* GetDataTable() + { + fixed (RecvProp* ptr = &this) + return ((RecvTable*)Memory.Read((int)ptr + 0x28)); + } + + public string GetName() + { + fixed (RecvProp* ptr = &this) + return ((ConstChar*)Memory.Read((int)ptr))->ToString(); + } + + public int GetOffset() + { + fixed (RecvProp* ptr = &this) + return (int)Memory.Read((int)ptr + 0x2C); + } + } + public unsafe struct ConstChar + { + public override string ToString() + { + int len = 0; + fixed (ConstChar* ptr = &this) + { + while (Memory.ReadByte((int)ptr + len) != 0) + len++; + + return Encoding.UTF8.GetString(Memory.ReadBytes((int)ptr, len)); + } + } + + public bool Contains(string target) + { + return this.ToString().Contains(target); + } + } + public struct Rect { public int left; @@ -92,7 +202,7 @@ namespace AnimeSoftware [MarshalAs(UnmanagedType.U1, SizeConst = 1)] public bool m_bCameraMovingWithMouse; // 0x9E [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public Vector3 m_vecCameraOffset; // 0xA0 + public Vector m_vecCameraOffset; // 0xA0 [MarshalAs(UnmanagedType.U1, SizeConst = 1)] public bool m_bCameraDistanceMove; // 0xAC [MarshalAs(UnmanagedType.U1, SizeConst = 4)] @@ -106,9 +216,9 @@ namespace AnimeSoftware [MarshalAs(UnmanagedType.U1, SizeConst = 4)] public bool m_bCameraIsOrthographic; // 0xC0 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public Vector3 m_vecPreviousViewAngles; // 0xC4 + public Vector m_vecPreviousViewAngles; // 0xC4 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public Vector3 m_vecPreviousViewAnglesTilt; // 0xD0 + public Vector m_vecPreviousViewAnglesTilt; // 0xD0 [MarshalAs(UnmanagedType.U1, SizeConst = 4)] public float m_flLastForwardMove; // 0xDC [MarshalAs(UnmanagedType.U1, SizeConst = 4)] @@ -131,9 +241,9 @@ namespace AnimeSoftware [MarshalAs(UnmanagedType.U1, SizeConst = 4)] public int m_iTickCount; // 0x08 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public Vector3 m_vecViewAngles; // 0x0C + public Vector m_vecViewAngles; // 0x0C [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public Vector3 m_vecAimDirection; // 0x18 + public Vector m_vecAimDirection; // 0x18 [MarshalAs(UnmanagedType.U1, SizeConst = 4)] public float m_flForwardmove; // 0x24 [MarshalAs(UnmanagedType.U1, SizeConst = 4)] @@ -269,56 +379,122 @@ namespace AnimeSoftware } } } - public struct Vector3 + public struct Vector { + public float x; public float y; public float z; - public Vector3(float _x, float _y, float _z) + public Vector(float x = 0, float y = 0, float z = 0) { - x = _x; - y = _y; - z = _z; + this.x = x; + this.y = y; + this.z = z; } - public float Length + + public static bool operator ==(Vector a, Vector b) { - get - { - return (float)Math.Sqrt((x * x) + (y * y) + (z * z)); - } + return (a.x == b.x && a.y == b.y && a.z == b.z); + } + + public static bool operator !=(Vector a, Vector b) + { + return (a.x != b.x || a.y != b.y || a.z != b.z); + } + public static Vector operator -(Vector a, Vector b) + { + return new Vector(a.x - b.x, a.y - b.y, a.z - b.z); + } + public static Vector operator +(Vector a, Vector b) + { + return new Vector(a.x + b.x, a.y + b.y, a.z + b.z); + } + public static Vector operator /(Vector a, Vector b) + { + return new Vector(a.x / b.x, a.y / b.y, a.z / b.z); } - public static Vector3 operator -(Vector3 a, Vector3 b) + public static Vector operator *(Vector a, Vector b) { - return new Vector3(a.x - b.x, a.y - b.y, a.z - b.z); + return new Vector(a.x * b.x, a.y * b.y, a.z * b.z); } - public static Vector3 operator +(Vector3 a, Vector3 b) + public static Vector operator /(Vector a, int b) { - return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z); + return new Vector(a.x / b, a.y / b, a.z / b); } - public static Vector3 operator /(Vector3 a, Vector3 b) + public static Vector operator *(Vector a, int b) { - return new Vector3(a.x / b.x, a.y / b.y, a.z / b.z); + return new Vector(a.x * b, a.y * b, a.z * b); } - public static Vector3 operator *(Vector3 a, Vector3 b) + public static Vector operator /(Vector a, float b) { - return new Vector3(a.x * b.x, a.y * b.y, a.z * b.z); + return new Vector(a.x / b, a.y / b, a.z / b); } - public static Vector3 operator /(Vector3 a, int b) + public static Vector operator *(Vector a, float b) { - return new Vector3(a.x / b, a.y / b, a.z / b); + return new Vector(a.x * b, a.y * b, a.z * b); } - public static Vector3 operator *(Vector3 a, int b) + + public float DotProduct(float x, float y, float z) + { + return this.x * x + this.y * y + this.z * z; + } + + public float DistanceTo(Vector dst) { - return new Vector3(a.x * b, a.y * b, a.z * b); + return (float)Math.Sqrt((dst.x - x) * (dst.x - x) + (dst.y - y) * (dst.y - y) + (dst.z - z) * (dst.z - z)); } - public static Vector3 operator /(Vector3 a, float b) + + public float Length { - return new Vector3(a.x / b, a.y / b, a.z / b); + get + { + return (float)Math.Sqrt((x * x) + (y * y) + (z * z)); + } } - public static Vector3 operator *(Vector3 a, float b) + public float Length2D + { + get + { + return (float)Math.Sqrt((x * x) + (y * y)); + } + } + + public void Normalize() + { + while (y > 180) + { + y -= 360; + } + while (y < -180) + { + y += 360; + } + + while (x > 89) + { + x -= 180; + } + + while (x < -89) + { + x += 180; + } + } + + public override string ToString() + { + return $"X: {x}, Y: {y}, Z: {z}"; + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + + public override int GetHashCode() { - return new Vector3(a.x * b, a.y * b, a.z * b); + return base.GetHashCode(); } } } diff --git a/AnimeSoftware/Offsets/ScannedOffsets.cs b/AnimeSoftware/Offsets/CalcedOffsets.cs similarity index 93% rename from AnimeSoftware/Offsets/ScannedOffsets.cs rename to AnimeSoftware/Offsets/CalcedOffsets.cs index 160c1f4..46236e1 100644 --- a/AnimeSoftware/Offsets/ScannedOffsets.cs +++ b/AnimeSoftware/Offsets/CalcedOffsets.cs @@ -4,18 +4,16 @@ using System.Linq; using System.Reflection.Emit; using System.Text; using System.Threading.Tasks; - -using hazedumper; +using AnimeSoftware.Offsets; +using AnimeSoftware.Utils; +using AnimeSoftware.Offsets; namespace AnimeSoftware { - class ScannedOffsets + unsafe class CalcedOffsets { public static int ClientCMD; - public static int UserInfoTable; - public static int SetConVar; public static int dwUse; - public static int Console; public static int cl_sidespeed; public static int cl_forwardspeed; diff --git a/AnimeSoftware/Offsets/NetVarManager.cs b/AnimeSoftware/Offsets/NetVarManager.cs new file mode 100644 index 0000000..fb333a0 --- /dev/null +++ b/AnimeSoftware/Offsets/NetVarManager.cs @@ -0,0 +1,103 @@ +using AnimeSoftware.Utils; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Security.Policy; +using System.Text; +using System.Threading.Tasks; + +namespace AnimeSoftware.Offsets +{ + + class NetVarManager + { + public static Hashtable NetVars; + public static void Init() + { + NetVars = FullDump(); + } + + public unsafe static Hashtable FullDump() + { + Hashtable hashtable = new Hashtable(); + for (ClientClass* i = (ClientClass*)(Memory.Client + signatures.dwGetAllClasses); i != null; i = i->Next()) + { + Log.Debug("Dumping:", i->GetRecvTable()->GetName()); + if (!hashtable.ContainsKey(i->GetRecvTable()->GetName())) + hashtable.Add(i->GetRecvTable()->GetName(), DumpTable(i->GetRecvTable())); + } + return hashtable; + } + public unsafe static Hashtable DumpTable(RecvTable* table) + { + Hashtable hashtable = new Hashtable(); + for (int i = 0; i < table->GetPropsCount(); i++) + { + RecvProp* prop = (RecvProp*)((IntPtr)table->GetRecvProps() + i * sizeof(RecvProp)); + + if (prop == null) + continue; + if (prop->GetName().Contains("baseclass") || prop->GetName().StartsWith("0") || prop->GetName().StartsWith("1") || prop->GetName().StartsWith("2")) + continue; + + if (!hashtable.ContainsKey( prop->GetName())) + hashtable.Add(prop->GetName(), prop->GetOffset()); + + if (prop->GetDataTable() != null) + { + foreach (DictionaryEntry entry in DumpTable(prop->GetDataTable())) + { + if (!hashtable.ContainsKey(entry.Key)) + hashtable.Add(entry.Key, entry.Value); + } + } + } + return hashtable; + } + + #region Debug + + public unsafe static void DumpTable(RecvTable* table, int depth) + { + for (int i = 0; i < table->GetPropsCount(); i++) + { + RecvProp* prop = (RecvProp*)((IntPtr)table->GetRecvProps() + i * sizeof(RecvProp)); + + try + { + if (prop == null) + continue; + if (prop->GetName().Contains("baseclass") || prop->GetName().StartsWith("0") || prop->GetName().StartsWith("1") || prop->GetName().StartsWith("2")) + continue; + + Console.WriteLine(new string(' ', depth * 2) + prop->GetName() + " 0x" + prop->GetOffset().ToString("X")); + + if (prop->GetDataTable() != null) + { + DumpTable(prop->GetDataTable(), depth + 1); + } + } + catch (Exception ex) + { + + Console.WriteLine(((IntPtr)prop).ToString("X")); + Console.WriteLine(ex.ToString()); + } + + } + } + public unsafe static void DebugFullDump() + { + for (ClientClass* i = (ClientClass*)(Memory.Client + signatures.dwGetAllClasses); i != null; i = i->Next()) + { + Console.WriteLine(i->GetName()); + Console.WriteLine("__" + i->GetRecvTable()->GetName()); + DumpTable(i->GetRecvTable(), 2); + + } + } + + #endregion + } +} diff --git a/AnimeSoftware/Offsets/Offsets.cs b/AnimeSoftware/Offsets/Offsets.cs index 9137dfd..b4d7bd8 100644 --- a/AnimeSoftware/Offsets/Offsets.cs +++ b/AnimeSoftware/Offsets/Offsets.cs @@ -1,155 +1,318 @@ -using System; - -// 2020-05-29 19:02:31.995972100 UTC - -namespace hazedumper -{ - public static class netvars - { - public const Int32 cs_gamerules_data = 0x0; - public const Int32 m_ArmorValue = 0xB368; - public const Int32 m_Collision = 0x320; - public const Int32 m_CollisionGroup = 0x474; - public const Int32 m_Local = 0x2FBC; - public const Int32 m_MoveType = 0x25C; - public const Int32 m_OriginalOwnerXuidHigh = 0x31C4; - public const Int32 m_OriginalOwnerXuidLow = 0x31C0; - public const Int32 m_SurvivalGameRuleDecisionTypes = 0x1320; - public const Int32 m_SurvivalRules = 0xCF8; - public const Int32 m_aimPunchAngle = 0x302C; - public const Int32 m_aimPunchAngleVel = 0x3038; - public const Int32 m_angEyeAnglesX = 0xB36C; - public const Int32 m_angEyeAnglesY = 0xB370; - public const Int32 m_bBombPlanted = 0x99D; - public const Int32 m_bFreezePeriod = 0x20; - public const Int32 m_bGunGameImmunity = 0x3930; - public const Int32 m_bHasDefuser = 0xB378; - public const Int32 m_bHasHelmet = 0xB35C; - public const Int32 m_bInReload = 0x32A5; - public const Int32 m_bIsDefusing = 0x391C; - public const Int32 m_bIsQueuedMatchmaking = 0x74; - public const Int32 m_bIsScoped = 0x3914; - public const Int32 m_bIsValveDS = 0x75; - public const Int32 m_bSpotted = 0x93D; - public const Int32 m_bSpottedByMask = 0x980; - public const Int32 m_bStartedArming = 0x33F0; - public const Int32 m_bUseCustomAutoExposureMax = 0x9D9; - public const Int32 m_bUseCustomAutoExposureMin = 0x9D8; - public const Int32 m_bUseCustomBloomScale = 0x9DA; - public const Int32 m_clrRender = 0x70; - public const Int32 m_dwBoneMatrix = 0x26A8; - public const Int32 m_fAccuracyPenalty = 0x3330; - public const Int32 m_fFlags = 0x104; - public const Int32 m_flC4Blow = 0x2990; - public const Int32 m_flCustomAutoExposureMax = 0x9E0; - public const Int32 m_flCustomAutoExposureMin = 0x9DC; - public const Int32 m_flCustomBloomScale = 0x9E4; - public const Int32 m_flDefuseCountDown = 0x29AC; - public const Int32 m_flDefuseLength = 0x29A8; - public const Int32 m_flFallbackWear = 0x31D0; - public const Int32 m_flFlashDuration = 0xA410; - public const Int32 m_flFlashMaxAlpha = 0xA40C; - public const Int32 m_flLastBoneSetupTime = 0x2924; - public const Int32 m_flLowerBodyYawTarget = 0x3A7C; - public const Int32 m_flNextAttack = 0x2D70; - public const Int32 m_flNextPrimaryAttack = 0x3238; - public const Int32 m_flSimulationTime = 0x268; - public const Int32 m_flTimerLength = 0x2994; - public const Int32 m_hActiveWeapon = 0x2EF8; - public const Int32 m_hMyWeapons = 0x2DF8; - public const Int32 m_hObserverTarget = 0x338C; - public const Int32 m_hOwner = 0x29CC; - public const Int32 m_hOwnerEntity = 0x14C; - public const Int32 m_iAccountID = 0x2FC8; - public const Int32 m_iClip1 = 0x3264; - public const Int32 m_iCompetitiveRanking = 0x1A84; - public const Int32 m_iCompetitiveWins = 0x1B88; - public const Int32 m_iCrosshairId = 0xB3D4; - public const Int32 m_iEntityQuality = 0x2FAC; - public const Int32 m_iFOV = 0x31E4; - public const Int32 m_iFOVStart = 0x31E8; - public const Int32 m_iGlowIndex = 0xA428; - public const Int32 m_iHealth = 0x100; - public const Int32 m_iItemDefinitionIndex = 0x2FAA; - public const Int32 m_iItemIDHigh = 0x2FC0; - public const Int32 m_iMostRecentModelBoneCounter = 0x2690; - public const Int32 m_iObserverMode = 0x3378; - public const Int32 m_iShotsFired = 0xA380; - public const Int32 m_iState = 0x3258; - public const Int32 m_iTeamNum = 0xF4; - public const Int32 m_lifeState = 0x25F; - public const Int32 m_nFallbackPaintKit = 0x31C8; - public const Int32 m_nFallbackSeed = 0x31CC; - public const Int32 m_nFallbackStatTrak = 0x31D4; - public const Int32 m_nForceBone = 0x268C; - public const Int32 m_nTickBase = 0x3430; - public const Int32 m_rgflCoordinateFrame = 0x444; - public const Int32 m_szCustomName = 0x303C; - public const Int32 m_szLastPlaceName = 0x35B4; - public const Int32 m_thirdPersonViewAngles = 0x31D8; - public const Int32 m_vecOrigin = 0x138; - public const Int32 m_vecVelocity = 0x114; - public const Int32 m_vecViewOffset = 0x108; - public const Int32 m_viewPunchAngle = 0x3020; - } - public static class signatures - { - public const Int32 anim_overlays = 0x2980; - public const Int32 clientstate_choked_commands = 0x4D28; - public const Int32 clientstate_delta_ticks = 0x174; - public const Int32 clientstate_last_outgoing_command = 0x4D24; - public const Int32 clientstate_net_channel = 0x9C; - public const Int32 convar_name_hash_table = 0x2F0F8; - public const Int32 dwClientState = 0x589DD4; - public const Int32 dwClientState_GetLocalPlayer = 0x180; - public const Int32 dwClientState_IsHLTV = 0x4D40; - public const Int32 dwClientState_Map = 0x28C; - public const Int32 dwClientState_MapDirectory = 0x188; - public const Int32 dwClientState_MaxPlayer = 0x388; - public const Int32 dwClientState_PlayerInfo = 0x52B8; - public const Int32 dwClientState_State = 0x108; - public const Int32 dwClientState_ViewAngles = 0x4D88; - public const Int32 dwEntityList = 0x4D4B134; - public const Int32 dwForceAttack = 0x317C71C; - public const Int32 dwForceAttack2 = 0x317C728; - public const Int32 dwForceBackward = 0x317C6D4; - public const Int32 dwForceForward = 0x317C740; - public const Int32 dwForceJump = 0x51F4DB0; - public const Int32 dwForceLeft = 0x317C6C8; - public const Int32 dwForceRight = 0x317C6EC; - public const Int32 dwGameDir = 0x6286F8; - public const Int32 dwGameRulesProxy = 0x526809C; - public const Int32 dwGetAllClasses = 0xD5CF8C; - public const Int32 dwGlobalVars = 0x589AD8; - public const Int32 dwGlowObjectManager = 0x5292F18; - public const Int32 dwInput = 0x519C6C8; - public const Int32 dwInterfaceLinkList = 0x8FFB74; - public const Int32 dwLocalPlayer = 0xD36B94; - public const Int32 dwMouseEnable = 0xD3C738; - public const Int32 dwMouseEnablePtr = 0xD3C708; - public const Int32 dwPlayerResource = 0x317AA6C; - public const Int32 dwRadarBase = 0x517FE8C; - public const Int32 dwSensitivity = 0xD3C5D4; - public const Int32 dwSensitivityPtr = 0xD3C5A8; - public const Int32 dwSetClanTag = 0x89F00; - public const Int32 dwViewMatrix = 0x4D3CA64; - public const Int32 dwWeaponTable = 0x519D18C; - public const Int32 dwWeaponTableIndex = 0x325C; - public const Int32 dwYawPtr = 0xD3C398; - public const Int32 dwZoomSensitivityRatioPtr = 0xD415E0; - public const Int32 dwbSendPackets = 0xD3EFA; - public const Int32 dwppDirect3DDevice9 = 0xA7030; - public const Int32 find_hud_element = 0x29CCFD40; - public const Int32 force_update_spectator_glow = 0x39CB92; - public const Int32 interface_engine_cvar = 0x3E9EC; - public const Int32 is_c4_owner = 0x3A93A0; - public const Int32 m_bDormant = 0xED; - public const Int32 m_flSpawnTime = 0xA360; - public const Int32 m_pStudioHdr = 0x294C; - public const Int32 m_pitchClassPtr = 0x5180130; - public const Int32 m_yawClassPtr = 0xD3C398; - public const Int32 model_ambient_min = 0x58CE4C; - public const Int32 set_abs_angles = 0x1D2B60; - public const Int32 set_abs_origin = 0x1D29A0; - } -} // namespace hazedumper \ No newline at end of file +using AnimeSoftware.Utils; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using static AnimeSoftware.Offsets.NetVarManager; + +namespace AnimeSoftware.Offsets +{ + class signatures + { + public static Int32 dwClientState; + public static Int32 dwClientState_GetLocalPlayer; + public static Int32 dwClientState_IsHLTV; + public static Int32 dwClientState_Map; + public static Int32 dwClientState_MapDirectory; + public static Int32 dwClientState_MaxPlayer; + public static Int32 dwClientState_PlayerInfo; + public static Int32 dwClientState_State; + public static Int32 dwClientState_ViewAngles; + public static Int32 clientstate_delta_ticks; + public static Int32 clientstate_last_outgoing_command; + public static Int32 clientstate_choked_commands; + public static Int32 clientstate_net_channel; + public static Int32 dwEntityList; + public static Int32 dwForceAttack; + public static Int32 dwForceAttack2; + public static Int32 dwForceBackward; + public static Int32 dwForceForward; + public static Int32 dwForceJump; + public static Int32 dwForceLeft; + public static Int32 dwForceRight; + public static Int32 dwGameDir; + public static Int32 dwGameRulesProxy; + public static Int32 dwGetAllClasses; + public static Int32 dwGlobalVars; + public static Int32 dwGlowObjectManager; + public static Int32 dwInput; + public static Int32 dwInterfaceLinkList; + public static Int32 dwLocalPlayer; + public static Int32 dwMouseEnable; + public static Int32 dwMouseEnablePtr; + public static Int32 dwPlayerResource; + public static Int32 dwRadarBase; + public static Int32 dwSensitivity; + public static Int32 dwSensitivityPtr; + public static Int32 dwSetClanTag; + public static Int32 dwViewMatrix; + public static Int32 dwWeaponTable; + public static Int32 dwWeaponTableIndex; + public static Int32 dwYawPtr; + public static Int32 dwZoomSensitivityRatioPtr; + public static Int32 dwbSendPackets; + public static Int32 dwppDirect3DDevice9; + public static Int32 m_pStudioHdr; + public static Int32 m_yawClassPtr; + public static Int32 m_pitchClassPtr; + public static Int32 interface_engine_cvar; + public static Int32 convar_name_hash_table; + public static Int32 m_bDormant; + public static Int32 model_ambient_min; + public static Int32 set_abs_angles; + public static Int32 set_abs_origin; + public static Int32 is_c4_owner; + public static Int32 force_update_spectator_glow; + public static Int32 anim_overlays; + public static Int32 m_flSpawnTime; + public static Int32 find_hud_element; + + public static void Init() + { + Log.Debug("Offset scan has started."); + dwClientState = Memory.Read(Memory.Engine + Memory.FindPattern("A1 ? ? ? ? 33 D2 6A 00 6A 00 33 C9 89 B0", Memory.Engine, Memory.EngineSize) + 1) + 0 - Memory.Engine; + dwClientState_GetLocalPlayer = Memory.Read(Memory.Engine + Memory.FindPattern("8B 80 ? ? ? ? 40 C3", Memory.Engine, Memory.EngineSize) + 2) + 0; + dwClientState_IsHLTV = Memory.Read(Memory.Engine + Memory.FindPattern("80 BF ? ? ? ? ? 0F 84 ? ? ? ? 32 DB", Memory.Engine, Memory.EngineSize) + 2) + 0; + dwClientState_Map = Memory.Read(Memory.Engine + Memory.FindPattern("05 ? ? ? ? C3 CC CC CC CC CC CC CC A1", Memory.Engine, Memory.EngineSize) + 1) + 0; + dwClientState_MapDirectory = Memory.Read(Memory.Engine + Memory.FindPattern("B8 ? ? ? ? C3 05 ? ? ? ? C3", Memory.Engine, Memory.EngineSize) + 7) + 0; + dwClientState_MaxPlayer = Memory.Read(Memory.Engine + Memory.FindPattern("A1 ? ? ? ? 8B 80 ? ? ? ? C3 CC CC CC CC 55 8B EC 8A 45 08", Memory.Engine, Memory.EngineSize) + 7) + 0; + dwClientState_PlayerInfo = Memory.Read(Memory.Engine + Memory.FindPattern("8B 89 ? ? ? ? 85 C9 0F 84 ? ? ? ? 8B 01", Memory.Engine, Memory.EngineSize) + 2) + 0; + dwClientState_State = Memory.Read(Memory.Engine + Memory.FindPattern("83 B8 ? ? ? ? ? 0F 94 C0 C3", Memory.Engine, Memory.EngineSize) + 2) + 0; + dwClientState_ViewAngles = Memory.Read(Memory.Engine + Memory.FindPattern("F3 0F 11 80 ? ? ? ? D9 46 04 D9 05", Memory.Engine, Memory.EngineSize) + 4) + 0; + clientstate_delta_ticks = Memory.Read(Memory.Engine + Memory.FindPattern("C7 87 ? ? ? ? ? ? ? ? FF 15 ? ? ? ? 83 C4 08", Memory.Engine, Memory.EngineSize) + 2) + 0; + clientstate_last_outgoing_command = Memory.Read(Memory.Engine + Memory.FindPattern("8B 8F ? ? ? ? 8B 87 ? ? ? ? 41", Memory.Engine, Memory.EngineSize) + 2) + 0; + clientstate_choked_commands = Memory.Read(Memory.Engine + Memory.FindPattern("8B 87 ? ? ? ? 41", Memory.Engine, Memory.EngineSize) + 2) + 0; + clientstate_net_channel = Memory.Read(Memory.Engine + Memory.FindPattern("8B 8F ? ? ? ? 8B 01 8B 40 18", Memory.Engine, Memory.EngineSize) + 2) + 0; + dwEntityList = Memory.Read(Memory.Client + Memory.FindPattern("BB ? ? ? ? 83 FF 01 0F 8C ? ? ? ? 3B F8", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwForceAttack = Memory.Read(Memory.Client + Memory.FindPattern("89 0D ? ? ? ? 8B 0D ? ? ? ? 8B F2 8B C1 83 CE 04", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwForceAttack2 = Memory.Read(Memory.Client + Memory.FindPattern("89 0D ? ? ? ? 8B 0D ? ? ? ? 8B F2 8B C1 83 CE 04", Memory.Client, Memory.ClientSize) + 2) + 12 - Memory.Client; + dwForceBackward = Memory.Read(Memory.Client + Memory.FindPattern("55 8B EC 51 53 8A 5D 08", Memory.Client, Memory.ClientSize) + 287) + 0 - Memory.Client; + dwForceForward = Memory.Read(Memory.Client + Memory.FindPattern("55 8B EC 51 53 8A 5D 08", Memory.Client, Memory.ClientSize) + 245) + 0 - Memory.Client; + dwForceJump = Memory.Read(Memory.Client + Memory.FindPattern("8B 0D ? ? ? ? 8B D6 8B C1 83 CA 02", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwForceLeft = Memory.Read(Memory.Client + Memory.FindPattern("55 8B EC 51 53 8A 5D 08", Memory.Client, Memory.ClientSize) + 465) + 0 - Memory.Client; + dwForceRight = Memory.Read(Memory.Client + Memory.FindPattern("55 8B EC 51 53 8A 5D 08", Memory.Client, Memory.ClientSize) + 512) + 0 - Memory.Client; + dwGameDir = Memory.Read(Memory.Engine + Memory.FindPattern("68 ? ? ? ? 8D 85 ? ? ? ? 50 68 ? ? ? ? 68", Memory.Engine, Memory.EngineSize) + 1) + 0 - Memory.Engine; + dwGameRulesProxy = Memory.Read(Memory.Client + Memory.FindPattern("A1 ? ? ? ? 85 C0 0F 84 ? ? ? ? 80 B8 ? ? ? ? ? 74 7A", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwGetAllClasses = Memory.Read(Memory.Read(Memory.Client + Memory.FindPattern("A1 ? ? ? ? C3 CC CC CC CC CC CC CC CC CC CC A1 ? ? ? ? B9", Memory.Client, Memory.ClientSize) + 1) + 0) + 0 - Memory.Client; + dwGlobalVars = Memory.Read(Memory.Engine + Memory.FindPattern("68 ? ? ? ? 68 ? ? ? ? FF 50 08 85 C0", Memory.Engine, Memory.EngineSize) + 1) + 0 - Memory.Engine; + dwGlowObjectManager = Memory.Read(Memory.Client + Memory.FindPattern("A1 ? ? ? ? A8 01 75 4B", Memory.Client, Memory.ClientSize) + 1) + 4 - Memory.Client; + dwInput = Memory.Read(Memory.Client + Memory.FindPattern("B9 ? ? ? ? F3 0F 11 04 24 FF 50 10", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwInterfaceLinkList = Memory.Client + Memory.FindPattern("8B 35 ? ? ? ? 57 85 F6 74 ? 8B 7D 08 8B 4E 04 8B C7 8A 11 3A 10", Memory.Client, Memory.ClientSize) + 0 - Memory.Client; + dwLocalPlayer = Memory.Read(Memory.Client + Memory.FindPattern("8D 34 85 ? ? ? ? 89 15 ? ? ? ? 8B 41 08 8B 48 04 83 F9 FF", Memory.Client, Memory.ClientSize) + 3) + 4 - Memory.Client; + dwMouseEnable = Memory.Read(Memory.Client + Memory.FindPattern("B9 ? ? ? ? FF 50 34 85 C0 75 10", Memory.Client, Memory.ClientSize) + 1) + 48 - Memory.Client; + dwMouseEnablePtr = Memory.Read(Memory.Client + Memory.FindPattern("B9 ? ? ? ? FF 50 34 85 C0 75 10", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwPlayerResource = Memory.Read(Memory.Client + Memory.FindPattern("8B 3D ? ? ? ? 85 FF 0F 84 ? ? ? ? 81 C7", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwRadarBase = Memory.Read(Memory.Client + Memory.FindPattern("A1 ? ? ? ? 8B 0C B0 8B 01 FF 50 ? 46 3B 35 ? ? ? ? 7C EA 8B 0D", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwSensitivity = Memory.Read(Memory.Client + Memory.FindPattern("81 F9 ? ? ? ? 75 1D F3 0F 10 05 ? ? ? ? F3 0F 11 44 24 ? 8B 44 24 0C 35 ? ? ? ? 89 44 24 0C", Memory.Client, Memory.ClientSize) + 2) + 44 - Memory.Client; + dwSensitivityPtr = Memory.Read(Memory.Client + Memory.FindPattern("81 F9 ? ? ? ? 75 1D F3 0F 10 05 ? ? ? ? F3 0F 11 44 24 ? 8B 44 24 0C 35 ? ? ? ? 89 44 24 0C", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwSetClanTag = Memory.Engine + Memory.FindPattern("53 56 57 8B DA 8B F9 FF 15", Memory.Engine, Memory.EngineSize) + 0 - Memory.Engine; + dwViewMatrix = Memory.Read(Memory.Client + Memory.FindPattern("0F 10 05 ? ? ? ? 8D 85 ? ? ? ? B9", Memory.Client, Memory.ClientSize) + 3) + 176 - Memory.Client; + dwWeaponTable = Memory.Read(Memory.Client + Memory.FindPattern("B9 ? ? ? ? 6A 00 FF 50 08 C3", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + dwWeaponTableIndex = Memory.Read(Memory.Client + Memory.FindPattern("39 86 ? ? ? ? 74 06 89 86 ? ? ? ? 8B 86", Memory.Client, Memory.ClientSize) + 2) + 0; + dwYawPtr = Memory.Read(Memory.Client + Memory.FindPattern("81 F9 ? ? ? ? 75 16 F3 0F 10 05 ? ? ? ? F3 0F 11 45 ? 81 75 ? ? ? ? ? EB 0A 8B 01 8B 40 30 FF D0 D9 5D 0C 8B 55 08", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwZoomSensitivityRatioPtr = Memory.Read(Memory.Client + Memory.FindPattern("81 F9 ? ? ? ? 75 1A F3 0F 10 05 ? ? ? ? F3 0F 11 45 ? 8B 45 F4 35 ? ? ? ? 89 45 FC EB 0A 8B 01 8B 40 30 FF D0 D9 5D FC A1", Memory.Client, Memory.ClientSize) + 2) + 0 - Memory.Client; + dwbSendPackets = Memory.Engine + Memory.FindPattern("B3 01 8B 01 8B 40 10 FF D0 84 C0 74 0F 80 BF ? ? ? ? ? 0F 84", Memory.Engine, Memory.EngineSize) + 1 - Memory.Engine; + dwppDirect3DDevice9 = Memory.Read(Memory.vstdlib + Memory.FindPattern("A1 ? ? ? ? 50 8B 08 FF 51 0C", Memory.vstdlib, Memory.vstdlibSize) + 1) + 0 - Memory.vstdlib; + m_pStudioHdr = Memory.Read(Memory.Client + Memory.FindPattern("8B B6 ? ? ? ? 85 F6 74 05 83 3E 00 75 02 33 F6 F3 0F 10 44 24", Memory.Client, Memory.ClientSize) + 2) + 0; + m_yawClassPtr = Memory.Read(Memory.Client + Memory.FindPattern("81 F9 ? ? ? ? 75 16 F3 0F 10 05 ? ? ? ? F3 0F 11 45 ? 81 75 ? ? ? ? ? EB 0A 8B 01 8B 40 30 FF D0 D9 5D 0C 8B 55 08", Memory.Client, Memory.ClientSize) + 2) + + 0 - Memory.Client; + m_pitchClassPtr = Memory.Read(Memory.Client + Memory.FindPattern("A1 ? ? ? ? 89 74 24 28", Memory.Client, Memory.ClientSize) + 1) + 0 - Memory.Client; + interface_engine_cvar = Memory.Read(Memory.vstdlib + Memory.FindPattern("8B 0D ? ? ? ? C7 05", Memory.vstdlib, Memory.vstdlibSize) + 2) + 0 - Memory.vstdlib; + convar_name_hash_table = Memory.Read(Memory.vstdlib + Memory.FindPattern("8B 3C 85", Memory.vstdlib, Memory.vstdlibSize) + 3) + 0 - Memory.vstdlib; + m_bDormant = Memory.Read(Memory.Client + Memory.FindPattern("8A 81 ? ? ? ? C3 32 C0", Memory.Client, Memory.ClientSize) + 2) + 8; + model_ambient_min = Memory.Read(Memory.Engine + Memory.FindPattern("F3 0F 10 0D ? ? ? ? F3 0F 11 4C 24 ? 8B 44 24 20 35 ? ? ? ? 89 44 24 0C", Memory.Engine, Memory.EngineSize) + 4) + 0 - Memory.Engine; + set_abs_angles = Memory.Client + Memory.FindPattern("55 8B EC 83 E4 F8 83 EC 64 53 56 57 8B F1 E8", Memory.Client, Memory.ClientSize) + 0 - Memory.Client; + set_abs_origin = Memory.Client + Memory.FindPattern("55 8B EC 83 E4 F8 51 53 56 57 8B F1 E8", Memory.Client, Memory.ClientSize) + 0 - Memory.Client; + is_c4_owner = Memory.Client + Memory.FindPattern("56 8B F1 85 F6 74 31", Memory.Client, Memory.ClientSize) + 0 - Memory.Client; + force_update_spectator_glow = Memory.Client + Memory.FindPattern("74 07 8B CB E8 ? ? ? ? 83 C7 10", Memory.Client, Memory.ClientSize) + 0 - Memory.Client; + anim_overlays = Memory.Read(Memory.Client + Memory.FindPattern("8B 89 ? ? ? ? 8D 0C D1", Memory.Client, Memory.ClientSize) + 2) + 0; + m_flSpawnTime = Memory.Read(Memory.Client + Memory.FindPattern("89 86 ? ? ? ? E8 ? ? ? ? 80 BE ? ? ? ? ?", Memory.Client, Memory.ClientSize) + 2) + 0; + find_hud_element = Memory.Client + Memory.FindPattern("55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28", Memory.Client, Memory.ClientSize) + 0; + Log.Debug("Offsets scanned."); + } + } + class netvars + { + + public static Int32 m_ArmorValue; + public static Int32 m_Collision; + public static Int32 m_CollisionGroup; + public static Int32 m_Local; + public static Int32 m_MoveType; + public static Int32 m_OriginalOwnerXuidHigh; + public static Int32 m_OriginalOwnerXuidLow; + public static Int32 m_aimPunchAngle; + public static Int32 m_aimPunchAngleVel; + public static Int32 m_bGunGameImmunity; + public static Int32 m_bHasDefuser; + public static Int32 m_bHasHelmet; + public static Int32 m_bInReload; + public static Int32 m_bIsDefusing; + public static Int32 m_bIsScoped; + public static Int32 m_bSpotted; + public static Int32 m_bSpottedByMask; + public static Int32 m_dwBoneMatrix; + public static Int32 m_fAccuracyPenalty; + public static Int32 m_fFlags; + public static Int32 m_flFallbackWear; + public static Int32 m_flFlashDuration; + public static Int32 m_flFlashMaxAlpha; + public static Int32 m_flNextPrimaryAttack; + public static Int32 m_hActiveWeapon; + public static Int32 m_hMyWeapons; + public static Int32 m_hObserverTarget; + public static Int32 m_hOwner; + public static Int32 m_hOwnerEntity; + public static Int32 m_iAccountID; + public static Int32 m_iClip1; + public static Int32 m_iCompetitiveRanking; + public static Int32 m_iCompetitiveWins; + public static Int32 m_iCrosshairId; + public static Int32 m_iEntityQuality; + public static Int32 m_iFOVStart; + public static Int32 m_iFOV; + public static Int32 m_iGlowIndex; + public static Int32 m_iHealth; + public static Int32 m_iItemDefinitionIndex; + public static Int32 m_iItemIDHigh; + public static Int32 m_iObserverMode; + public static Int32 m_iShotsFired; + public static Int32 m_iState; + public static Int32 m_iTeamNum; + public static Int32 m_lifeState; + public static Int32 m_nFallbackPaintKit; + public static Int32 m_nFallbackSeed; + public static Int32 m_nFallbackStatTrak; + public static Int32 m_nForceBone; + public static Int32 m_nTickBase; + public static Int32 m_rgflCoordinateFrame; + public static Int32 m_szCustomName; + public static Int32 m_szLastPlaceName; + public static Int32 m_vecOrigin; + public static Int32 m_vecVelocity; + public static Int32 m_vecViewOffset; + public static Int32 m_viewPunchAngle; + public static Int32 m_thirdPersonViewAngles; + public static Int32 m_clrRender; + public static Int32 m_flC4Blow; + public static Int32 m_flTimerLength; + public static Int32 m_flDefuseLength; + public static Int32 m_flDefuseCountDown; + public static Int32 cs_gamerules_data; + public static Int32 m_SurvivalRules; + public static Int32 m_SurvivalGameRuleDecisionTypes; + public static Int32 m_bIsValveDS; + public static Int32 m_bFreezePeriod; + public static Int32 m_bBombPlanted; + public static Int32 m_bIsQueuedMatchmaking; + public static Int32 m_flSimulationTime; + public static Int32 m_flLowerBodyYawTarget; + public static Int32 m_angEyeAnglesX; + public static Int32 m_angEyeAnglesY; + public static Int32 m_flNextAttack; + public static Int32 m_iMostRecentModelBoneCounter; + public static Int32 m_flLastBoneSetupTime; + public static Int32 m_bStartedArming; + public static Int32 m_bUseCustomBloomScale; + public static Int32 m_bUseCustomAutoExposureMin; + public static Int32 m_bUseCustomAutoExposureMax; + public static Int32 m_flCustomBloomScale; + public static Int32 m_flCustomAutoExposureMin; + public static Int32 m_flCustomAutoExposureMax; + + + public static void Init() + { + NetVarManager.Init(); + + m_ArmorValue = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_ArmorValue"]; + m_Collision = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_Collision"]; + m_CollisionGroup = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_CollisionGroup"]; + m_Local = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_Local"]; + m_MoveType = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_nRenderMode"] + 1; + m_OriginalOwnerXuidHigh = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_OriginalOwnerXuidHigh"]; + m_OriginalOwnerXuidLow = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_OriginalOwnerXuidLow"]; + m_aimPunchAngle = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_aimPunchAngle"]; + m_aimPunchAngleVel = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_aimPunchAngleVel"]; + m_bGunGameImmunity = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bGunGameImmunity"]; + m_bHasDefuser = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bHasDefuser"]; + m_bHasHelmet = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bHasHelmet"]; + m_bInReload = (int)((Hashtable)NetVars["DT_BaseCombatWeapon"])["m_flNextPrimaryAttack"] + 109; + m_bIsDefusing = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bIsDefusing"]; + m_bIsScoped = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bIsScoped"]; + m_bSpotted = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_bSpotted"]; + m_bSpottedByMask = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_bSpottedByMask"]; + m_dwBoneMatrix = (int)((Hashtable)NetVars["DT_BaseAnimating"])["m_nForceBone"] + 28; + m_fAccuracyPenalty = (int)((Hashtable)NetVars["DT_WeaponCSBase"])["m_fAccuracyPenalty"]; + m_fFlags = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_fFlags"]; + m_flFallbackWear = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_flFallbackWear"]; + m_flFlashDuration = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_flFlashDuration"]; + m_flFlashMaxAlpha = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_flFlashMaxAlpha"]; + m_flNextPrimaryAttack = (int)((Hashtable)NetVars["DT_BaseCombatWeapon"])["m_flNextPrimaryAttack"]; + m_hActiveWeapon = (int)((Hashtable)NetVars["DT_BaseCombatCharacter"])["m_hActiveWeapon"]; + m_hMyWeapons = (int)((Hashtable)NetVars["DT_BaseCombatCharacter"])["m_hActiveWeapon"] + -256; + m_hObserverTarget = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_hObserverTarget"]; + m_hOwner = (int)((Hashtable)NetVars["DT_BaseViewModel"])["m_hOwner"]; + m_hOwnerEntity = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_hOwnerEntity"]; + m_iAccountID = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_iAccountID"]; + m_iClip1 = (int)((Hashtable)NetVars["DT_BaseCombatWeapon"])["m_iClip1"]; + m_iCompetitiveRanking = (int)((Hashtable)NetVars["DT_CSPlayerResource"])["m_iCompetitiveRanking"]; + m_iCompetitiveWins = (int)((Hashtable)NetVars["DT_CSPlayerResource"])["m_iCompetitiveWins"]; + m_iCrosshairId = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_bHasDefuser"] + 92; + m_iEntityQuality = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_iEntityQuality"]; + m_iFOVStart = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_iFOVStart"]; + m_iFOV = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_iFOV"]; + m_iGlowIndex = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_flFlashDuration"] + 24; + m_iHealth = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_iHealth"]; + m_iItemDefinitionIndex = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_iItemDefinitionIndex"]; + m_iItemIDHigh = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_iItemIDHigh"]; + m_iObserverMode = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_iObserverMode"]; + m_iShotsFired = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_iShotsFired"]; + m_iState = (int)((Hashtable)NetVars["DT_BaseCombatWeapon"])["m_iState"]; + m_iTeamNum = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_iTeamNum"]; + m_lifeState = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_lifeState"]; + m_nFallbackPaintKit = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_nFallbackPaintKit"]; + m_nFallbackSeed = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_nFallbackSeed"]; + m_nFallbackStatTrak = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_nFallbackStatTrak"]; + m_nForceBone = (int)((Hashtable)NetVars["DT_BaseAnimating"])["m_nForceBone"]; + m_nTickBase = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_nTickBase"]; + m_rgflCoordinateFrame = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_CollisionGroup"] + -48; + m_szCustomName = (int)((Hashtable)NetVars["DT_BaseAttributableItem"])["m_szCustomName"]; + m_szLastPlaceName = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_szLastPlaceName"]; + m_vecOrigin = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_vecOrigin"]; + m_vecVelocity = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_vecVelocity[0]"]; + m_vecViewOffset = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_vecViewOffset[0]"]; + m_viewPunchAngle = (int)((Hashtable)NetVars["DT_BasePlayer"])["m_viewPunchAngle"]; + m_thirdPersonViewAngles = (int)((Hashtable)NetVars["DT_BasePlayer"])["deadflag"] + 4; + m_clrRender = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_clrRender"]; + m_flC4Blow = (int)((Hashtable)NetVars["DT_PlantedC4"])["m_flC4Blow"]; + m_flTimerLength = (int)((Hashtable)NetVars["DT_PlantedC4"])["m_flTimerLength"]; + m_flDefuseLength = (int)((Hashtable)NetVars["DT_PlantedC4"])["m_flDefuseLength"]; + m_flDefuseCountDown = (int)((Hashtable)NetVars["DT_PlantedC4"])["m_flDefuseCountDown"]; + cs_gamerules_data = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["cs_gamerules_data"]; + m_SurvivalRules = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_SurvivalRules"]; + m_SurvivalGameRuleDecisionTypes = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_SurvivalGameRuleDecisionTypes"]; + m_bIsValveDS = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_bIsValveDS"]; + m_bFreezePeriod = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_bFreezePeriod"]; + m_bBombPlanted = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_bBombPlanted"]; + m_bIsQueuedMatchmaking = (int)((Hashtable)NetVars["DT_CSGameRulesProxy"])["m_bIsQueuedMatchmaking"]; + m_flSimulationTime = (int)((Hashtable)NetVars["DT_BaseEntity"])["m_flSimulationTime"]; + m_flLowerBodyYawTarget = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_flLowerBodyYawTarget"]; + m_angEyeAnglesX = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_angEyeAngles[0]"]; + m_angEyeAnglesY = (int)((Hashtable)NetVars["DT_CSPlayer"])["m_angEyeAngles[1]"]; + m_flNextAttack = (int)((Hashtable)NetVars["DT_BaseCombatCharacter"])["m_flNextAttack"]; + m_iMostRecentModelBoneCounter = (int)((Hashtable)NetVars["DT_CSRagdoll"])["m_nForceBone"] + 4; + m_flLastBoneSetupTime = (int)((Hashtable)NetVars["DT_BaseAnimating"])["m_nSequence"] + 104; + m_bStartedArming = (int)((Hashtable)NetVars["DT_WeaponC4"])["m_bStartedArming"]; + m_bUseCustomBloomScale = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_bUseCustomBloomScale"]; + m_bUseCustomAutoExposureMin = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_bUseCustomAutoExposureMin"]; + m_bUseCustomAutoExposureMax = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_bUseCustomAutoExposureMax"]; + m_flCustomBloomScale = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_flCustomBloomScale"]; + m_flCustomAutoExposureMin = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_flCustomAutoExposureMin"]; + m_flCustomAutoExposureMax = (int)((Hashtable)NetVars["DT_EnvTonemapController"])["m_flCustomAutoExposureMax"]; + } + } +} diff --git a/AnimeSoftware/Overlay.Designer.cs b/AnimeSoftware/Overlay.Designer.cs deleted file mode 100644 index 22e00cf..0000000 --- a/AnimeSoftware/Overlay.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace AnimeSoftware -{ - partial class Overlay - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.paintBox = new System.Windows.Forms.PictureBox(); - ((System.ComponentModel.ISupportInitialize)(this.paintBox)).BeginInit(); - this.SuspendLayout(); - // - // paintBox - // - this.paintBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.paintBox.Location = new System.Drawing.Point(0, 0); - this.paintBox.Name = "paintBox"; - this.paintBox.Size = new System.Drawing.Size(800, 450); - this.paintBox.TabIndex = 0; - this.paintBox.TabStop = false; - this.paintBox.Paint += new System.Windows.Forms.PaintEventHandler(this.paintBox_Paint_1); - // - // Overlay - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Controls.Add(this.paintBox); - this.DoubleBuffered = true; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Overlay"; - this.Text = "Overlay"; - this.TopMost = true; - this.TransparencyKey = System.Drawing.Color.Black; - this.Load += new System.EventHandler(this.Overlay_Load); - this.Shown += new System.EventHandler(this.Overlay_Shown); - ((System.ComponentModel.ISupportInitialize)(this.paintBox)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.PictureBox paintBox; - } -} \ No newline at end of file diff --git a/AnimeSoftware/Overlay.cs b/AnimeSoftware/Overlay.cs deleted file mode 100644 index 3c780a8..0000000 --- a/AnimeSoftware/Overlay.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Forms; -using AnimeSoftware.Injections; -using AnimeSoftware.Objects; - -namespace AnimeSoftware -{ - public partial class Overlay : Form - { - public Overlay() - { - InitializeComponent(); - } - - public static Graphics g = null; - public static List pointsLine = new List(); - public const int maxDisplayVel = 500; - public static int lineWidth = 0; - public static int maxHeight = 0; - public static float pointsPerVelocity = 0; - private void Overlay_Load(object sender, EventArgs e) - { - int initialStyle = DllImport.GetWindowLong(this.Handle, -20); - DllImport.SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20); - - IntPtr hWnd = Process.GetProcessesByName("csgo")[0].MainWindowHandle; - Rect rect = new Rect(); - DllImport.GetWindowRect(hWnd, ref rect); - - this.Width = 1000; - this.Height = 500; - this.Left = ((rect.right - rect.left) - this.Width) / 2; - this.Top = ((rect.bottom - rect.top) - this.Height) / 2; - - lineWidth = (int)((0.9 * this.Width) - (0.1 * this.Width)); - maxHeight = (int)((0.9 * this.Height) - (0.1 * this.Height)); - pointsPerVelocity = maxHeight / (float)maxDisplayVel; - - g = paintBox.CreateGraphics(); - pointsLine = new float[lineWidth].ToList(); - - - - } - - private void paintBox_Paint(object sender, PaintEventArgs e) - { - - } - - public static void UpdateLine(float velocity) - { - Console.WriteLine(); - pointsLine.RemoveAt(0); - pointsLine.Add(GetSchedulePoint(velocity)); - } - - public static float GetSchedulePoint(float velocity) - { - - if (velocity >= maxDisplayVel) - return maxHeight; - - return pointsPerVelocity * velocity; - } - - private void Overlay_Shown(object sender, EventArgs e) - { - while (true) - { - UpdateLine(LocalPlayer.Speed); - - Invalidate(); - } - } - - private void paintBox_Paint_1(object sender, PaintEventArgs e) - { - Pen myPen = new Pen(Color.Red); - myPen.Width = 2; - float offset = (float)0.1 * this.Width; - - for (int i = 0; i < lineWidth - 1; i++) - { - g.DrawLine(myPen, new PointF(offset + i, pointsLine[i]), new PointF(offset + i + 1, pointsLine[i + 1])); - } - } - } -} diff --git a/AnimeSoftware/Overlay.resx b/AnimeSoftware/Overlay.resx deleted file mode 100644 index 3bf930b..0000000 --- a/AnimeSoftware/Overlay.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - \ No newline at end of file diff --git a/AnimeSoftware/Overlay/Overlay.Designer.cs b/AnimeSoftware/Overlay/Overlay.Designer.cs deleted file mode 100644 index d3819ae..0000000 --- a/AnimeSoftware/Overlay/Overlay.Designer.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace AnimeSoftware -{ - partial class Overlay - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // Overlay - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.ClientSize = new System.Drawing.Size(800, 450); - this.ControlBox = false; - this.Enabled = false; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Overlay"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.Text = "Overlay"; - this.TopMost = true; - this.TransparencyKey = System.Drawing.Color.Black; - this.ResumeLayout(false); - - } - - #endregion - } -} \ No newline at end of file diff --git a/AnimeSoftware/Overlay/Overlay.cs b/AnimeSoftware/Overlay/Overlay.cs deleted file mode 100644 index 68b1dc6..0000000 --- a/AnimeSoftware/Overlay/Overlay.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace AnimeSoftware -{ - public partial class Overlay : Form - { - public Overlay() - { - InitializeComponent(); - } - } -} diff --git a/AnimeSoftware/Overlay/Overlay.resx b/AnimeSoftware/Overlay/Overlay.resx deleted file mode 100644 index 29dcb1b..0000000 --- a/AnimeSoftware/Overlay/Overlay.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/AnimeSoftware/Overlay/OverlaySettings.Designer.cs b/AnimeSoftware/Overlay/OverlaySettings.Designer.cs deleted file mode 100644 index 4542a17..0000000 --- a/AnimeSoftware/Overlay/OverlaySettings.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace AnimeSoftware -{ - partial class OverlaySettings - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "OverlaySettings"; - } - - #endregion - } -} \ No newline at end of file diff --git a/AnimeSoftware/Overlay/OverlaySettings.cs b/AnimeSoftware/Overlay/OverlaySettings.cs deleted file mode 100644 index 3236286..0000000 --- a/AnimeSoftware/Overlay/OverlaySettings.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace AnimeSoftware -{ - public partial class OverlaySettings : Form - { - public OverlaySettings() - { - InitializeComponent(); - } - } -} diff --git a/AnimeSoftware/Checks.cs b/AnimeSoftware/Utils/Checks.cs similarity index 86% rename from AnimeSoftware/Checks.cs rename to AnimeSoftware/Utils/Checks.cs index 30e47e1..de734c2 100644 --- a/AnimeSoftware/Checks.cs +++ b/AnimeSoftware/Utils/Checks.cs @@ -1,6 +1,7 @@ using AnimeSoftware.Objects; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Net; using System.Text; @@ -17,6 +18,9 @@ namespace AnimeSoftware { while (true) { + if (Process.GetProcessesByName("csgo").Length == 0) + Application.Exit(); + if (!LocalPlayer.InGame) Update = false; @@ -54,7 +58,7 @@ namespace AnimeSoftware } } - public static string version = "v3.10"; + public static string version = "v4.00"; } } diff --git a/AnimeSoftware/Utils/Log.cs b/AnimeSoftware/Utils/Log.cs new file mode 100644 index 0000000..1fd307c --- /dev/null +++ b/AnimeSoftware/Utils/Log.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AnimeSoftware.Utils +{ + class Log + { + public static void Error(params object[] args) + { + Console.WriteLine($"[{DateTime.Now.ToString()}] [Error] {string.Join(" ", args.Select(x => x.ToString()))}"); + } + + public static void Info(params object[] args) + { + + Console.WriteLine($"[{DateTime.Now.ToString()}] [Info] {string.Join(" ", args.Select(x => x.ToString()))}"); + } + + public static void Debug(params object[] args) + { + //if (!Properties.Settings.Default.debug) + // return; + Console.WriteLine($"[{DateTime.Now.ToString()}] [Debug] {string.Join(" ", args.Select(x => x.GetType().Equals(typeof(IntPtr)) ? ((IntPtr)x).ToString("X") : x.ToString()))}"); + } + } +} diff --git a/AnimeSoftware/Memory.cs b/AnimeSoftware/Utils/Memory.cs similarity index 68% rename from AnimeSoftware/Memory.cs rename to AnimeSoftware/Utils/Memory.cs index 26bcfac..c135a93 100644 --- a/AnimeSoftware/Memory.cs +++ b/AnimeSoftware/Utils/Memory.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.IO; +using AnimeSoftware.Utils; namespace AnimeSoftware { @@ -53,8 +54,7 @@ namespace AnimeSoftware } catch { - if (Properties.Settings.Default.debug) - Console.WriteLine("Can't open process."); + Log.Error("Can't open process."); return false; } } @@ -67,8 +67,8 @@ namespace AnimeSoftware } catch { - if (Properties.Settings.Default.debug) - Console.WriteLine("Can't get handle."); + + Log.Error("Can't get handle."); return false; } } @@ -97,11 +97,7 @@ namespace AnimeSoftware } if ((IntPtr)Client == IntPtr.Zero || (IntPtr)Engine == IntPtr.Zero || (IntPtr)vstdlib == IntPtr.Zero) { - if (Properties.Settings.Default.debug) - { - Console.WriteLine(String.Format("Client: {0}\nEngine: {1}\nvstdlib: {2}\n", Client, Engine, vstdlib)); - Console.WriteLine("Module error"); - } + Log.Error("Module error"); return false; } @@ -109,8 +105,7 @@ namespace AnimeSoftware } catch { - if (Properties.Settings.Default.debug) - Console.WriteLine("Module get error"); + Log.Error("Module get error"); return false; } @@ -124,6 +119,13 @@ namespace AnimeSoftware return buffer; } + public static byte[] ReadBytes(IntPtr address, int length) => ReadBytes((int)address, length); + + public static byte ReadByte(Int32 address) + { + return ReadBytes(address, 1)[0]; + } + public static T Read(Int32 address) { int length = Marshal.SizeOf(typeof(T)); @@ -137,12 +139,16 @@ namespace AnimeSoftware return GetStructure(buffer); } + public static T Read(IntPtr address) => Read((int)address); + public static void WriteBytes(Int32 address, byte[] value) { UInt32 nBytesRead = UInt32.MinValue; WriteProcessMemory(pHandle, (IntPtr)address, value, (IntPtr)value.Length, ref nBytesRead); } + public static void WriteBytes(IntPtr address, byte[] value) => WriteBytes((int)address, value); + public static void Write(Int32 address, T value) { int length = Marshal.SizeOf(typeof(T)); @@ -157,6 +163,8 @@ namespace AnimeSoftware WriteProcessMemory(pHandle, (IntPtr)address, buffer, (IntPtr)length, ref nBytesRead); } + public static void Write(IntPtr address, T value) => Write((int)address, value); + public static T GetStructure(byte[] bytes) { var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); @@ -230,82 +238,22 @@ namespace AnimeSoftware return 0; } - internal static class Sig + public static int FindPattern(string signature, int moduleBase, int moduleSize) { - private static byte[] _dump; - - private static void Dump(IntPtr module, Int32 moduleSize) - { - _dump = Memory.ReadBytes((Int32)module, moduleSize); - } - - private static bool CheckSig(int index, Signature signature) - { - for (int i = 0; i < signature.ByteArray.Length; i++) - { - if (signature.Mask[i] == '?') - continue; - - if (signature.ByteArray[i] != _dump[index + i]) - return false; - } - return true; - } - - public static Int32 COffset(string sig, int offset = 0, int extra = 0) - { - return GetOffset(sig, offset, extra, (IntPtr)Memory.Client, Memory.ClientSize); - } - - public static Int32 EOffset(string sig, int offset = 0, int extra = 0) - { - return GetOffset(sig, offset, extra, (IntPtr)Memory.Engine, Memory.EngineSize); - } - - public static Int32 GetOffset(string sig, int offset, int extra, IntPtr module, Int32 moduleSize) + List temp = new List(); + foreach(var h in signature.Split(' ')) { - Dump(module, moduleSize); - - - Signature signature = new Signature(sig, offset); - - for (int i = 0; i < moduleSize; i++) + if(h == "?") { - if (signature.Address == IntPtr.Zero && CheckSig(i, signature)) - { - var _offset = signature.Offset; - signature = new Signature(module + i + _offset); - - if (signature.Address != IntPtr.Zero) - return BitConverter.ToInt32(Memory.ReadBytes((Int32)signature.Address, 4), 0) + extra - module.ToInt32(); - - } + temp.Add(0); } - Console.WriteLine(String.Format("The Signature {0}\nCouldn't Be Found.", sig)); - return Int32.MinValue; - } - - public static Signature GetSignature(Signature sig, IntPtr module, Int32 moduleSize) - { - byte[] dumped = Memory.ReadBytes((Int32)module, moduleSize); - - for (int i = 0; i < moduleSize; i++) + else { - if (sig.Address == IntPtr.Zero && CheckSig(i, sig)) - { - var offset = sig.Offset; - sig = new Signature(module + i + offset); - - if (sig.Address != IntPtr.Zero) - { - return sig; - } - } + temp.Add((byte)Convert.ToInt32(h, 16)); } - return sig; } - + return FindPattern(temp.ToArray(), string.Join("", temp.Select(x => x == 0 ? "?" : "x")), moduleBase, moduleSize); } } } diff --git a/README.md b/README.md index 83335fe..955c42c 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,7 @@ CSGO External hack written in C# for griefing. ### Information This is not a hack in the typical sense. It is not intended to dominate opponents, but to grief teammates. -A few pastes was taken from [Darc Euphoria from DarcPhansea](https://github.com/DarcPhansea/Darc-Euphoria) and [ExternalCSGO from B3akers](https://github.com/B3akers/ExternalCSGO). - -You can always update offsets through hazedumper. +A few pastes was taken from [Darc Euphoria from DarcPhansea](https://github.com/DarcPhansea/Darc-Euphoria) and [ExternalCSGO from B3akers](https://github.com/B3akers/ExternalCSGO). I recommend using this hack in conjunction with some kind of internal hack that can change names (via namestealer or fakevote), because they remove the cooldown and the message about the nickname change. Don't use FakeFF without namechanger exploit. diff --git a/version b/version index 60ec23c..4a76a5d 100644 --- a/version +++ b/version @@ -1,3 +1,4 @@ -v3.10 +v4.00 -crush fix +offset autoupdate +small code refactoring