├── .github
├── .gitignore
├── Auth
├── AuthDiagram.xml
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
└── workflows
│ └── build.yml
├── .gitignore
├── Dexterion.aps
├── Dexterion.filters
├── Dexterion.rc
├── Dexterion.sln
├── Dexterion.vcxproj
├── Dexterion.vcxproj.user
├── LICENSE
├── README.md
├── assets
├── dexterion.ico
├── dexterion.png
├── dexterion_banner.jpg
├── dexterion_banner2.jpg
├── dexterion_logo.png
├── dexterion_logov1.png
└── screenshots
│ ├── desktop.ini
│ ├── preview1.png
│ ├── preview2.png
│ ├── preview3.png
│ ├── preview4.png
│ └── preview5.png
├── dev-folder
├── config.json
├── cs2-dumper.exe
└── dexterion_icons.zip
├── dexterion.cpp
├── features
├── aim.cpp
├── aim.hpp
├── bomb.cpp
├── bomb.hpp
├── entry.cpp
├── entry.hpp
├── esp.cpp
├── esp.hpp
├── include.hpp
├── misc.cpp
└── misc.hpp
├── fonts
└── weaponIcons.ttf
├── gui
├── menu.cpp
├── menu.hpp
├── overlay.cpp
└── overlay.hpp
├── imgui
├── imconfig.h
├── imgui.cpp
├── imgui.h
├── imgui_demo.cpp
├── imgui_draw.cpp
├── imgui_impl_dx11.cpp
├── imgui_impl_dx11.h
├── imgui_impl_win32.cpp
├── imgui_impl_win32.h
├── imgui_internal.h
├── imgui_tables.cpp
├── imgui_widgets.cpp
├── imstb_rectpack.h
├── imstb_textedit.h
├── imstb_truetype.h
└── render.h
├── json
├── json.hpp
├── jsonOps.cpp
└── jsonOps.hpp
├── resource.h
├── updateoffsets.cmd
└── util
├── DiscordVerify.hpp
├── HTTPRequest.hpp
├── MemMan.hpp
├── Vectors.h
├── attributes.cpp
├── attributes.hpp
├── config.cpp
├── config.hpp
├── utilFunctions.hpp
└── weaponInfo.hpp
/.github/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/.github/.gitignore
--------------------------------------------------------------------------------
/.github/Auth:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/AuthDiagram.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug report
2 | description: Report errors or unexpected behavior
3 | title: "[Issue/Bug]"
4 | labels: [bug]
5 | body:
6 | - type: checkboxes
7 | attributes:
8 | label: 🔍 Is there already an issue for your problem?
9 | description: Please make sure you are not creating an already submitted Issue. Also check closed issue.
10 | options:
11 | - label: I have checked older issues, open and closed
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: ℹ Environment / Computer Info
16 | description: |
17 | Please provide the details of version installed.
18 | How did you installed offsets.
19 | value: |
20 | - Dexterion version: (You can find this in about tab)
21 | - Describe install method of offsets: (e.g., Direct Download from a2x repo's, Self Dump)
22 | placeholder: |
23 | - Dexterion version: Realese 26
24 | - Describe install method of offsets: Self Dump
25 | render: Markdown
26 | validations:
27 | required: true
28 | - type: textarea
29 | attributes:
30 | label: 📝 Description
31 | description: |
32 | List steps to reproduce the error and details on what happens and what you expected to happen.
33 | placeholder: |
34 | 1. Please number your steps like so.\n
35 | 2. This helps readability of your instructions.
36 |
37 | Feel free to write down additional notes you may want us to know.
38 | validations:
39 | required: true
40 | - type: textarea
41 | attributes:
42 | label: ⚙️ Configuration Files
43 | description: Drop here your config file.
44 | validations:
45 | required: false
46 | - type: textarea
47 | attributes:
48 | label: 📸 Screenshots
49 | description: Place any screenshots of the issue here if needed
50 | validations:
51 | required: false
52 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yml:
--------------------------------------------------------------------------------
1 | name: Feature Request
2 | description: Request a new feature or enhancement
3 | labels: [enhancement]
4 | title: "[Enhancement]"
5 | body:
6 | - type: textarea
7 | id: description
8 | attributes:
9 | label: 📝 Provide a description of the new feature
10 | description: What is the expected behavior of the proposed feature? What is the scenario this would be used?
11 | validations:
12 | required: true
13 |
14 | - type: textarea
15 | id: additional-information
16 | attributes:
17 | label: ➕ Additional Information
18 | description: Give us some additional information on the feature request like proposed solutions, links, screenshots, etc.
19 |
20 | - type: markdown
21 | attributes:
22 | value: If you'd like to see this feature implemented, add a 👍 reaction to this post.
23 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build Cheat
2 |
3 | on:
4 | workflow_dispatch:
5 | # push:
6 | # branches: [ "master" ]
7 |
8 | permissions: write-all
9 |
10 | jobs:
11 | build:
12 | name: Build project
13 | runs-on: windows-latest
14 | outputs:
15 | DEXTERION_VERSION: ${{ steps.DEXTERION_VERSION.outputs.DEXTERION_VERSION }}
16 | steps:
17 | - uses: actions/checkout@v4
18 |
19 | - name: Add MSBuild to PATH
20 | uses: microsoft/setup-msbuild@v2
21 |
22 | - name: Restore NuGet packages
23 | run: nuget restore .
24 |
25 | - name: Build
26 | run: msbuild -p:Configuration="Release" -p:Platform="x64"
27 | - name: Get Version
28 | id: DEXTERION_VERSION
29 | shell: pwsh
30 | run: |
31 | Set-ExecutionPolicy Bypass -Force
32 | $RawText = Get-Content ./util/utilFunctions.hpp -Raw
33 | $Records = $RawText -split '(?=inline std::string version = )'
34 | $Records = $Records[1] -split '= "'
35 | $Records = $Records[1] -split '";'
36 | $Records = $Records[0]
37 | Set-Variable DEXTERION_VERSION $Records
38 | #DEXTERION_VERSION=$(grep -Po 'version\s*=\s*"\K[^"]*' ./util/utilFunctions.hpp)
39 | echo "DEXTERION_VERSION=$DEXTERION_VERSION" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
40 | - name: Zip Dexterion
41 | shell: cmd
42 | run: |
43 | cd "x64\Release"
44 | rename Dexterion.exe "Dexterion-${{ env.DEXTERION_VERSION }}.exe"
45 | - name: Create Release
46 | id: create_release
47 | uses: softprops/action-gh-release@v2
48 | env:
49 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 | with:
51 | name: Dexterion ${{ env.DEXTERION_VERSION }}
52 | tag_name: ${{ env.DEXTERION_VERSION }}
53 | body: |
54 | Installation:
55 | There are 2 files attached here:
56 | One is Dexterion-${{ env.DEXTERION_VERSION }}.exe which contains the cheat.
57 |
58 | Second one is updateoffests.cmd which updates the offsets when executing.
59 | draft: false
60 | prerelease: false
61 | files: |
62 | ./x64/Release/Dexterion-${{ env.DEXTERION_VERSION }}.exe
63 | ./updateoffsets.cmd
64 | #- name: Upload PE
65 | # uses: actions/upload-release-asset@v1
66 | # env:
67 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 | # with:
69 | # upload_url: ${{ steps.release.outputs.upload_url }}
70 | # asset_path: ./x64/Release/Dexterion.exe
71 | # asset_name: Dexterion {{ env.DEXTERION_VERSION }}.exe
72 | # asset_content_type: application/exe
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | External*Dependecies\
2 | Dexterion/
3 | Debug/
4 | x64/
5 | .vs/
6 | .git/
7 |
8 | imgui.ini
--------------------------------------------------------------------------------
/Dexterion.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/Dexterion.aps
--------------------------------------------------------------------------------
/Dexterion.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Dexterion.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/Dexterion.rc
--------------------------------------------------------------------------------
/Dexterion.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.6.33712.159
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dexterion", "Dexterion.vcxproj", "{E6CBDC8B-C819-4A41-85B1-27203F206E29}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Debug|x64.ActiveCfg = Debug|x64
17 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Debug|x64.Build.0 = Debug|x64
18 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Debug|x86.ActiveCfg = Debug|Win32
19 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Debug|x86.Build.0 = Debug|Win32
20 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Release|x64.ActiveCfg = Release|x64
21 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Release|x64.Build.0 = Release|x64
22 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Release|x86.ActiveCfg = Release|Win32
23 | {E6CBDC8B-C819-4A41-85B1-27203F206E29}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BA245855-1478-4589-815A-D7EB18E8634B}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Dexterion.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2024, Skwrr
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice, this
9 | list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright notice,
12 | this list of conditions and the following disclaimer in the documentation
13 | and/or other materials provided with the distribution.
14 |
15 | 3. Neither the name of the copyright holder nor the names of its
16 | contributors may be used to endorse or promote products derived from
17 | this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 |

6 |

7 |

8 |

9 |
10 |

11 |

12 |

13 |
14 |
15 | Welcome to **Dexterion**!\
16 | This is a free, open-source tool created solely for educational purposes and testing [VAC (Valve Anti-Cheat)](https://help.steampowered.com/faqs/view/571A-97DA-70E9-FF74).
17 |
18 |
19 |
20 | ## Table of contents
21 | - [How To Use](#Howtouse)
22 | - [Contributing](#Contributing)
23 | - [Usage](#Usage)
24 | - [Anti-Cheat](#Anti-Cheat)
25 | - [Features](#Features)
26 | - [Malware?](#IsThisVirus)
27 | - [Credits](#Credits)
28 | - [LICENSE](#License)
29 | - [Disclaimer](#Disclaimer)
30 | - [Previews](#Previews)
31 |
32 | ## HowtoUse
33 | - You can see [Contributing](#Contributing) if you don't know how to compile you can directly download github automated build app in realese.
34 |
35 | ## Contributing
36 | Download the code from the green button that says `Code`.
37 | Extract the RAR file into any folder.
38 | Open `Dexterion.sln` in Visual Studio, set build configuration to **Release | x64**.
39 | Press Build solution and you should receive **Dexterion.exe** file in the path `Dexterion/x64/Release/`
40 |
41 | Little story about compiling the source:
42 | Recently, some portuguese and russian kids asked if this was a virus. They ended up blocking me and I'll tell you how. They made me run the cheat, so I did and they still didn't believe it wasn't malware. They tried compiling the cheat and told me to help them. I was really trying to but they were retarded or something because the wasn't listening to me and didn't know how to extract the src. They blocked me after that failed attempt of extract the file. Don't be like those guys, please.
43 |
44 | ## Usage
45 | ### Update Offsets ( Choose 1 or 2 )
46 | 1. Update Offsets. (Run `updateoffsets.cmd` in the same folder as `Dexterion.exe`)
47 | 2. Manualy update from [a2x repo's](https://github.com/a2x/cs2-dumper/blob/main/output) the following files: `buttons.json`, `offsets.json`, `client_dll.json`.
48 |
49 | > [!IMPORTANT]
50 | > Close Visual Studio to stop the released version that is ran automaticaly when you build.\
51 | > Then go to the `/x64/Release/` path and open dexterion.\
52 | > **If you use the version that was ran when you built the application this will be bugged.**
53 | ### Run
54 | 4. Run `Dexterion.exe` From release path
55 | 5. Follow Terminal instructions.
56 | 6. Wait For Load.
57 |
58 | ### Toggle/Kill UI
59 | - Toggle UI: `Inset` key.
60 | - Terminate UI: `End` key.
61 |
62 | ### Using Icon Fonts
63 | Move fonts folder to the same folder as `Dexterion.exe` is.
64 |
65 | ### Config
66 | All config files are located on `X:\Dexterion`
67 | `X` will be the letter of the disk you're running dexterion on
68 | #### Example:
69 | - If you run `Dexterion.exe` in a pendrive which letter is `F:`, Dexterion config files will be in `F:\Dexterion`
70 |
71 | ## Anti-Cheat
72 | > [!CAUTION]
73 | > **This software constitutes a cheat and is in *violation of the Terms of Service (ToS)* of any game in which it is used. We disclaim all liability for any *account bans* or *penalties incurred* as a result of its use. By using this software, you acknowledge that you are solely responsible for any consequences. USE AT YOUR OWN RISK**
74 |
75 | ## Features
76 | - ESP
77 | - Health bar (+ HP counter)
78 | - Player name
79 | - Weapon icons / names
80 | - Skeleton
81 | - Joints
82 | - Head
83 | - Snap lines
84 | - Distance
85 | - Aim
86 | - Aimbot (+ Player lock)
87 | - Recoil control system
88 | - Trigger bot
89 | - Misc
90 | - Deathmatch Mode
91 | - Dropped item ESP
92 | - Bomb Timer
93 | - Spectator List
94 | - Probably more things I forgot to add.
95 |
96 | ## IsThisVirus
97 | - Short answer, no.
98 | - But, if you are too lazy to view the source code, just don't use this.
99 |
100 | ## Credits
101 | - [kristofhracza/tim_apple](https://github.com/kristofhracza/tim_apple) (Forked from this. Inspiration)
102 | - [Patitotective/ImThemes](https://github.com/Patitotective/ImThemes)
103 | - [a2x/cs2-dumper](https://github.com/a2x/cs2-dumper)
104 | - [nlohmann/json](https://github.com/nlohmann/json)
105 | - [ocornut/imgui](https://github.com/ocornut/imgui)
106 |
107 | ## Disclaimer
108 | > [!IMPORTANT]
109 | > We are not responsible for any **banned accounts** and the **bad use** of this application.\
110 | > This application was made for educational propurse to test the [VAC ( Valve Anti-Cheat )](https://help.steampowered.com/faqs/view/571A-97DA-70E9-FF74).\
111 | > **USE AT YOUR OWN RISK**.
112 |
113 | > [!NOTE]
114 | > **This cheat is only tested on [VAC (Valve Anti-Cheat)](https://help.steampowered.com/faqs/view/571A-97DA-70E9-FF74) and `0` bans has been issued.**
115 |
116 | ## License
117 | > [!NOTE]
118 | > This repository is licensed under the [BSD-3](https://github.com/Nocture-Insight/Dexterion/blob/master/LICENSE) Clause License.
119 | > Any modified version of this source code is strictly prohibited from being sold under any circumstances. Modified versions must remain for private, personal use only, or be released as open-source software under the same [BSD-3](https://github.com/Nocture-Insight/Dexterion/blob/master/LICENSE) Clause License. Any redistribution must include proper attribution and a hyperlink to the [original GitHub repository](https://github.com/Nocture-Insight/Dexterion).
120 |
121 |
122 |
123 | Previews
124 |
125 |
126 |
127 | 
128 | 
129 | 
130 | 
131 | 
132 |
133 |
134 |
--------------------------------------------------------------------------------
/assets/dexterion.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion.ico
--------------------------------------------------------------------------------
/assets/dexterion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion.png
--------------------------------------------------------------------------------
/assets/dexterion_banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion_banner.jpg
--------------------------------------------------------------------------------
/assets/dexterion_banner2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion_banner2.jpg
--------------------------------------------------------------------------------
/assets/dexterion_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion_logo.png
--------------------------------------------------------------------------------
/assets/dexterion_logov1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/dexterion_logov1.png
--------------------------------------------------------------------------------
/assets/screenshots/desktop.ini:
--------------------------------------------------------------------------------
1 | [LocalizedFileNames]
2 | Screenshot 2024-07-17 100004.png=@Screenshot 2024-07-17 100004.png,0
3 | Screenshot 2024-07-17 100021.png=@Screenshot 2024-07-17 100021.png,0
4 | Screenshot 2024-07-17 095946.png=@Screenshot 2024-07-17 095946.png,0
5 | Screenshot 2024-07-17 095955.png=@Screenshot 2024-07-17 095955.png,0
6 | Screenshot 2024-07-17 095958.png=@Screenshot 2024-07-17 095958.png,0
7 |
--------------------------------------------------------------------------------
/assets/screenshots/preview1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/screenshots/preview1.png
--------------------------------------------------------------------------------
/assets/screenshots/preview2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/screenshots/preview2.png
--------------------------------------------------------------------------------
/assets/screenshots/preview3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/screenshots/preview3.png
--------------------------------------------------------------------------------
/assets/screenshots/preview4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/screenshots/preview4.png
--------------------------------------------------------------------------------
/assets/screenshots/preview5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/assets/screenshots/preview5.png
--------------------------------------------------------------------------------
/dev-folder/config.json:
--------------------------------------------------------------------------------
1 | {"aimConf":{"aimMode":0,"aimModeMap":{"Closest to Crosshair":1,"Closest to Player":0,"Furthest from crosshair":2,"No preference":3},"aimModes":["Closest to Player","Closest to Crosshair","Furthest from crosshair","No preference"],"bone":0,"boneMap":{"Chest":4,"Crotch":0,"Head":6,"Neck":5},"boneSelect":0,"bones":["Head","Neck","Chest","Crotch"],"checkSpotter":true,"fov":2.25600004196167,"fovCircle":false,"hotAim":0,"hotKey":["SHIFT","ALT","CTRL","Left mouse","Right mouse"],"hotKeyMap":{"ALT":18,"CTRL":17,"Left mouse":1,"Right mouse":2,"SHIFT":16},"hotSelectAim":0,"hotSelectTrigger":1,"hotTrigger":0,"isHotAim":false,"isHotTrigger":true,"playerLock":true,"rcs":false,"sens":1.25,"smoothing":5.0,"state":true,"trigger":true},"espConf":{"attributeColours":[0.3921568691730499,0.11764705926179886,0.8980392217636108],"boundBox":true,"boundBoxThickness":1.5,"c4Carrier":true,"c4Colors":[0.3921568691730499,0.0,1.0],"c4ColorsGradient":[1.0,0.0,0.3921568691730499],"c4Gradient":true,"c4State":true,"c4Thickness":1.0,"checkSpotted":false,"cornerColours":[0.3921568691730499,0.0,1.0],"cornerGradient":[1.0,0.0,0.3921568691730499],"distance":true,"filledBox":true,"filledBoxAlpha":0.0560000017285347,"gradient":true,"head":true,"headColours":[1.0,0.0,0.3921568691730499],"health":[0.0,0.0,0.0],"hpCounter":true,"isHealthBar":true,"isPawnGun":true,"isPawnName":true,"joint":true,"jointColours":[1.0,0.0,0.3921568691730499],"notSpottedColours":[0.658682644367218,0.658682644367218,0.658682644367218],"pawnGun":"","pawnName":"","skeleton":true,"skeletonColours":[0.3921568691730499,0.0,1.0],"snapLines":true,"spottedColours":[0.6077843904495239,1.0,0.6618020534515381],"state":true,"width":2.5},"miscConf":{"bombTimer":true,"bombTimerColours":[0.0,1.0,0.5],"bunnyHop":false,"deathmatchMode":false,"flash":false,"fov":90,"fovCheck":false,"itemESP":false,"spectator":true,"spectatorColours":[1.0,0.0,0.0]}}
--------------------------------------------------------------------------------
/dev-folder/cs2-dumper.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/dev-folder/cs2-dumper.exe
--------------------------------------------------------------------------------
/dev-folder/dexterion_icons.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/dev-folder/dexterion_icons.zip
--------------------------------------------------------------------------------
/dexterion.cpp:
--------------------------------------------------------------------------------
1 | #define WIN32_LEAN_AND_MEAN
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include "util/config.hpp"
9 | #include "gui/overlay.hpp"
10 | #include "util/MemMan.hpp"
11 | #include "util/attributes.hpp"
12 |
13 | LRESULT Wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
14 | if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam)) {
15 | return 0;
16 | }
17 | switch (msg) {
18 | case WM_SYSCOMMAND: {
19 | if ((wParam & 0xfff0) == SC_KEYMENU)
20 | return 0;
21 | break;
22 | }
23 |
24 | case WM_DESTROY: {
25 | PostQuitMessage(0);
26 | return 0;
27 | }
28 | }
29 | return DefWindowProc(hWnd, msg, wParam, lParam);
30 | }
31 |
32 |
33 | int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
34 | AllocConsole();
35 | freopen("CONOUT$", "w", stdout);
36 | HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
37 |
38 | Logger::hConsole = hConsole;
39 |
40 | // Memory and game related vars (used in entry and passed through overlay)
41 | int procId = MemMan.getPid(L"cs2.exe");
42 | // Weird method until I find a proper fix, im tired rn
43 | if (procId == 0) {
44 | Logger::info("[MemMan] Waiting For Counter Strike 2");
45 | while ((procId = MemMan.getPid(L"cs2.exe")) == 0)
46 | std::this_thread::sleep_for(std::chrono::milliseconds(1500));
47 | }
48 | Logger::success(std::format("[MemMan] Counter Strike 2 Found (%d)!", procId));
49 | Logger::info("[Config.hpp] Checking for config file...");
50 | config::refresh();
51 | if (config::exists(0)) { // passing 0 cause setup
52 | Logger::success("[Config.hpp] Config File Found! Loading config...");
53 | config::load(0);
54 | }
55 | else {
56 | Logger::error("[Config.hpp] Config File Not Found! Loading Defaults...");
57 | config::create(L"config.json");
58 | config::save(0);
59 | }
60 |
61 | Logger::info("[dexterion.cpp] Getting addresses...");
62 | MemoryManagement::moduleData client;
63 | client.module = MemMan.getModule(procId, L"client.dll");
64 | client.base = MemMan.getModuleBase(procId, "client.dll");
65 | while (client.base == 0 || client.module == 0) {
66 | client.module = MemMan.getModule(procId, L"client.dll");
67 | client.base = MemMan.getModuleBase(procId, "client.dll");
68 | std::this_thread::sleep_for(std::chrono::milliseconds(1500));
69 | }
70 | if (!loadJson()) {
71 | Logger::error("[attributes.cpp] Cannot load JSON files (did you run updateoffsets.cmd?)");
72 | system("pause");
73 | return 0;
74 | }
75 | Logger::success("[dexterion.cpp] Addresses found succesfully!");
76 |
77 | Logger::info("[dexterion.cpp] Creating overlay...");
78 | // Overlay
79 | overlayESP overlayClass;
80 | WNDCLASSEXW windowClass = overlayClass.createWindowClass(hInstance, Wndproc, L"Dexterion");
81 | HWND window = overlayClass.createWindow(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
82 |
83 | Logger::info("[dexterion.cpp] Drawing overlay...");
84 | overlayClass.makeFrameIntoClientArea();
85 | overlayClass.makeDeviceAndSwapChain();
86 | overlayClass.initWindow(nShowCmd);
87 |
88 | Logger::info("[overlay.cpp] Starting main loop...");
89 | overlayClass.renderLoop(client);
90 |
91 | return 0;
92 | }
93 |
--------------------------------------------------------------------------------
/features/aim.cpp:
--------------------------------------------------------------------------------
1 | #include "aim.hpp"
2 |
3 | #include "random"
4 | #include "windows.h"
5 | #include
6 |
7 | #include "../util/config.hpp"
8 |
9 | #include
10 |
11 | using namespace std;
12 |
13 | void aim::aimBot(LocalPlayer localPlayer, Vector3 baseViewAngles, uintptr_t enemyPlayer, uintptr_t boneArray, MemoryManagement::moduleData client) {
14 | Vector3 aimPos;
15 | Vector3 newAngle;
16 | Vector3 angle;
17 |
18 | if (aimConf.playerLock)
19 | if (lockedPlayer != 0 && lockedPlayer != enemyPlayer) return;
20 | if (enemyPlayer == localPlayer.getPlayerPawn()) {
21 | lockedPlayer = 0;
22 | return;
23 | }
24 |
25 | aimPos = MemMan.ReadMem(boneArray + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
26 | angle = CalculateAngle(localPlayer.eyepos, aimPos, localPlayer.viewAngles);
27 | newAngle = calculateBestAngle(angle, { 0, 0, aimConf.fov });
28 |
29 | if (aimConf.rcs) {
30 | static Vector3 oldAngles = { 0, 0, 0 };
31 | Vector3 rcs = { 0, 0, 0 };
32 |
33 | if (localPlayer.getShotsFired() > 1 && localPlayer.shotsFired < 9999 /* Spectator check */) {
34 | Vector3 aimPunch = MemMan.ReadMem(localPlayer.getPlayerPawn() + clientDLL::C_CSPlayerPawn_["m_aimPunchAngle"]);
35 | rcs.x = (aimPunch.x - oldAngles.x) * 2.f / (0.022f * aimConf.sens);
36 | rcs.y = (aimPunch.y - oldAngles.y) * 2.f / (0.022f * aimConf.sens);
37 |
38 | oldAngles.x = aimPunch.y;
39 | oldAngles.y = aimPunch.x;
40 | }
41 | newAngle = calculateBestAngle(angle, { rcs.x, rcs.y, aimConf.fov });
42 | };
43 |
44 | newAngle.x = (newAngle.x / (0.022f * aimConf.sens)) / aimConf.smoothing;
45 | newAngle.y = (newAngle.y / (0.022f * aimConf.sens)) / aimConf.smoothing;
46 |
47 | if (newAngle.IsZero()) {
48 | lockedPlayer = 0;
49 | return;
50 | }
51 |
52 | if (aimConf.isHotAim) {
53 | if (GetAsyncKeyState(aimConf.hotKeyMap[aimConf.hotKey[aimConf.hotSelectAim]])) {
54 | aim::moveMouseToLocation(newAngle);
55 | }
56 | }
57 | else {
58 | aim::moveMouseToLocation(newAngle);
59 | }
60 |
61 | lockedPlayer = enemyPlayer;
62 | }
63 |
64 | void aim::moveMouseToLocation(Vector3 pos) {
65 | if (pos.x == 0.f && pos.y == 0.f && pos.z == 0.f) return;
66 |
67 | auto new_x = -pos.y;
68 | auto new_y = pos.x;
69 |
70 | mouse_event(MOUSEEVENTF_MOVE, new_x, new_y, 0, 0);
71 | }
72 |
73 | Vector3 aim::recoilControl(LocalPlayer localPlayer, bool move) {
74 | localPlayer.getAimPunchCache();
75 | localPlayer.getViewAngles();
76 |
77 | static Vector3 oldAngles = { 0, 0, 0 };
78 | Vector3 newAngles = { 0, 0, 0 };
79 |
80 | if (localPlayer.getShotsFired() == 54587654) return newAngles; // Spectator check
81 |
82 | if (localPlayer.getShotsFired() > 1) {
83 | Vector3 aimPunch = MemMan.ReadMem(localPlayer.getPlayerPawn() + clientDLL::C_CSPlayerPawn_["m_aimPunchAngle"]);
84 | newAngles.x = (aimPunch.x - oldAngles.x) * 2.f / (0.022f * aimConf.sens);
85 | newAngles.y = (aimPunch.y - oldAngles.y) * 2.f / (0.022f * aimConf.sens);
86 |
87 | if (move) aim::moveMouseToLocation(newAngles * -1);
88 |
89 | oldAngles = aimPunch;
90 | return newAngles;
91 | }
92 | else {
93 | oldAngles = { 0, 0, 0 };
94 | return newAngles;
95 | }
96 | }
97 |
98 | bool clicked = false;
99 |
100 | const int trigger_cooldown()
101 | {
102 | // Generate a random float between 0.0 and 0.5, add 0.15F to it, then cast to int milliseconds
103 | return static_cast((static_cast(rand() % 50) / 100.0F + 0.15F) * 1000);
104 | }
105 |
106 | void aim::triggerBot(LocalPlayer localPlayer, DWORD_PTR base) {
107 | int crossHairEntity = MemMan.ReadMem(localPlayer.getPlayerPawn() + clientDLL::C_CSPlayerPawnBase_["m_iIDEntIndex"]);
108 | int localPlayerHealth = MemMan.ReadMem(localPlayer.getPlayerPawn() + clientDLL::C_BaseEntity_["m_iHealth"]);
109 | if (!crossHairEntity) return;
110 |
111 | C_CSPlayerPawn crossHairPawn(base);
112 | CCSPlayerController crossHairEntityController(base);
113 |
114 | crossHairPawn.getPlayerPawnByCrossHairID(crossHairEntity);
115 | crossHairEntityController.value = crossHairPawn.playerPawn;
116 |
117 | bool isValidEntity = (crossHairEntity != -1 && crossHairPawn.getPawnHealth() > 0 && crossHairPawn.getPawnHealth() <= 100 && crossHairEntityController.getPawnTeam() != localPlayer.getTeam());
118 | bool isDeathMatchEntity = (crossHairEntity != -1 && crossHairPawn.getPawnHealth() > 0 && crossHairPawn.getPawnHealth() <= 100 && miscConf.deathmatchMode);
119 |
120 | if (localPlayerHealth > 100 || localPlayerHealth <= 0) return;
121 |
122 | if (aimConf.isHotTrigger) {
123 | if (GetAsyncKeyState(aimConf.hotKeyMap[aimConf.hotKey[aimConf.hotSelectTrigger]])) {
124 | if (isValidEntity || isDeathMatchEntity) {
125 | if (!clicked)
126 | {
127 | clicked = true;
128 | const int t = trigger_cooldown();
129 | //printf("Cooldown: %d ms\n", t); // Correct printf syntax for int
130 | mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
131 | Sleep(t/2);
132 | mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
133 | Sleep(t/2);
134 | clicked = false;
135 | }
136 | };
137 | }
138 | }
139 | else {
140 | if (isValidEntity || isDeathMatchEntity)
141 | {
142 | if (!clicked)
143 | {
144 | clicked = true;
145 | const int t = trigger_cooldown();
146 | //printf("Cooldown: %d ms\n", t); // Correct printf syntax for int
147 | mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
148 | Sleep(t / 2);
149 | mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
150 | Sleep(t / 2);
151 | clicked = false;
152 | }
153 | };
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/features/aim.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "include.hpp"
4 |
5 | #include "../util/config.hpp"
6 | #include "../gui/overlay.hpp"
7 |
8 |
9 | namespace aim {
10 | Vector3 recoilControl(LocalPlayer localPlayer, bool move);
11 | void aimBot(LocalPlayer localPlayer, Vector3 baseViewAngles, uintptr_t enemyPlayer, uintptr_t boneArray, MemoryManagement::moduleData client);
12 | void moveMouseToLocation(Vector3 pos);
13 | void triggerBot(LocalPlayer localPlayer, DWORD_PTR base);
14 |
15 | uintptr_t lockedPlayer = 0;
16 | }
17 |
--------------------------------------------------------------------------------
/features/bomb.cpp:
--------------------------------------------------------------------------------
1 | #include "bomb.hpp"
2 | #include "misc.hpp"
3 |
4 | #include
5 |
6 | void bomb::timer(C_C4 C_C4) {
7 | if (!overlayESP::isMenuOpen()) {
8 | if (!misc::isGameWindowActive()) return;
9 | }
10 | bool planted = C_C4.isPlanted();
11 | bool defusing = C_C4.isBeingDefused();
12 | float defuseTime = C_C4.getDefuseTime();
13 |
14 | static float overlayWidth = 200.f;
15 | ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize;
16 | ImGui::SetNextWindowPos({ (ImGui::GetIO().DisplaySize.x - overlayWidth) / 2.f, 80.f }, ImGuiCond_FirstUseEver);
17 | ImGui::SetNextWindowSize({ overlayWidth, 60 }, ImGuiCond_FirstUseEver);
18 |
19 | ImGui::Begin("Bomb Timer", nullptr, flags);
20 |
21 | uint64_t time = currentTimeMillis();
22 |
23 | if (planted && !isPlanted && (plantTime == NULL || time - plantTime > 60000)) {
24 | isPlanted = true;
25 | plantTime = time;
26 | }
27 |
28 | float remaining = (40000 - (int64_t)time + plantTime) / (float)1000;
29 |
30 | ImGui::SetCursorPosX((ImGui::GetWindowSize().x - 100.f) * .5f);
31 | float bar = planted ? remaining <= 0.f ? 0.f : remaining >= 40.f ? 1.f : (remaining / 40.f) : 0.f;
32 |
33 | if (isPlanted && remaining >= 0) {
34 | std::ostringstream oss;
35 |
36 | std::vector sites = {
37 | "A",
38 | "B",
39 | "C"
40 | };
41 |
42 | oss.precision(4);
43 | oss << "Bomb on " << sites[C_C4.getPlantedSite()] << ": " << std::fixed << remaining << " s";
44 |
45 | std::string Text = std::move(oss).str().c_str();
46 |
47 | float windowWidth = ImGui::GetWindowSize().x;
48 | float textWidth = ImGui::CalcTextSize(Text.c_str()).x;
49 | ImGui::SetCursorPosX((windowWidth - textWidth) * 0.5f);
50 | ImGui::Text(Text.c_str());
51 | }
52 | else {
53 | std::string Text = "C4 not planted";
54 |
55 | float windowWidth = ImGui::GetWindowSize().x;
56 | float textWidth = ImGui::CalcTextSize(Text.c_str()).x;
57 | ImGui::SetCursorPosX((windowWidth - textWidth) * 0.5f);
58 | ImGui::Text(Text.c_str());
59 | }
60 |
61 | if (isPlanted && !planted) {
62 | isPlanted = false;
63 | bar = 0.f;
64 | }
65 |
66 | ImGui::PushStyleColor(ImGuiCol_PlotHistogram, utils::float3ToImColor(miscConf.bombTimerColours, miscConf.bombTimerColours[3]).Value);
67 | ImGui::ProgressBar(bar, { overlayWidth - 20, 15 });
68 | ImGui::PopStyleColor();
69 | ImGui::End();
70 | }
--------------------------------------------------------------------------------
/features/bomb.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "include.hpp"
4 |
5 | #include "../util/config.hpp"
6 | #include "../gui/overlay.hpp"
7 |
8 | namespace bomb {
9 | bool isPlanted;
10 | std::time_t plantTime;
11 |
12 | void timer(C_C4 C_C4);
13 | }
--------------------------------------------------------------------------------
/features/entry.cpp:
--------------------------------------------------------------------------------
1 | #include "entry.hpp"
2 |
3 | void mainLoop(bool state, MemoryManagement::moduleData client) {
4 | // Classes
5 | CCSPlayerController CCSPlayerController(client.base);
6 | CBasePlayerController CBasePlayerController;
7 | C_CSPlayerPawn C_CSPlayerPawn(client.base);
8 | CGameSceneNode CGameSceneNode;
9 | LocalPlayer localPlayer(client.base);
10 | C_C4 C_C4(client.base);
11 |
12 |
13 | // Shared variables (between features)
14 | view_matrix_t viewMatrix = MemMan.ReadMem(client.base + offsets::clientDLL["dwViewMatrix"]);
15 | Vector3 baseViewAngles = MemMan.ReadMem(client.base + offsets::clientDLL["dwViewAngles"]);
16 | DWORD_PTR baseViewAnglesAddy = client.base + offsets::clientDLL["dwViewAngles"];
17 | uintptr_t entityList = MemMan.ReadMem(client.base + offsets::clientDLL["dwEntityList"]);
18 |
19 | // NOTE: Cheats that only need local player / visuals that don't relate to gameplay
20 | localPlayer.getPlayerPawn();
21 |
22 | CBasePlayerController.controller = localPlayer.getPlayerController();
23 | if (Shared::steamId != CBasePlayerController.getSteamId())
24 | Shared::steamId = CBasePlayerController.steamId;
25 | // Aimbot FOV circle
26 | if (aimConf.fovCircle) {
27 | if (!overlayESP::isMenuOpen()) {
28 | if (!misc::isGameWindowActive()) return;
29 | }
30 |
31 | ImVec2 p = ImGui::GetWindowPos();
32 | float screenMidX = GetSystemMetrics(SM_CXSCREEN) / 2.f;
33 | float screenMidY = GetSystemMetrics(SM_CYSCREEN) / 2.f;
34 |
35 | ImGui::GetBackgroundDrawList()->AddCircle({ screenMidX ,screenMidY }, (aimConf.fov * 10), ImColor(1.f, 1.f, 1.f, 1.f), 0, 1.f);
36 | }
37 | // Recoil control
38 | if (aimConf.rcs) aim::recoilControl(localPlayer, true);
39 |
40 | // Bomb Timer
41 | if (miscConf.bombTimer) bomb::timer(C_C4);
42 |
43 | // Tigger
44 | if (aimConf.trigger) aim::triggerBot(localPlayer, client.base);
45 |
46 | std::vector spectators{};
47 |
48 | // Main loop
49 | for (int i = 0; i < 64; i++) {
50 | // Player controller
51 | CCSPlayerController.id = i;
52 | CCSPlayerController.getListEntry();
53 | if (!CCSPlayerController.listEntry) continue;
54 | CCSPlayerController.getController();
55 | if (CCSPlayerController.value == 0) continue;
56 | CCSPlayerController.getPawnName();
57 |
58 | // Player pawn
59 | C_CSPlayerPawn.value = CCSPlayerController.getC_CSPlayerPawn();
60 | C_CSPlayerPawn.getListEntry();
61 | C_CSPlayerPawn.getPlayerPawn();
62 | C_CSPlayerPawn.getPawnHealth();
63 |
64 | // Spectator List
65 | if (miscConf.spectator && CCSPlayerController.isSpectating(true))
66 | spectators.push_back(CCSPlayerController.pawnName);
67 |
68 | // Checks
69 | if (aim::lockedPlayer == C_CSPlayerPawn.playerPawn && (C_CSPlayerPawn.pawnHealth <= 0 || (aimConf.checkSpotted && !C_CSPlayerPawn.getEntitySpotted()))) aim::lockedPlayer = 0;
70 | if ((C_CSPlayerPawn.pawnHealth <= 0 || C_CSPlayerPawn.pawnHealth > 100) || strcmp(CCSPlayerController.pawnName.c_str(), "DemoRecorder") == 0) continue;
71 | if (localPlayer.getTeam() == CCSPlayerController.getPawnTeam() && !miscConf.deathmatchMode) continue;
72 |
73 | // Game scene node
74 | CGameSceneNode.value = C_CSPlayerPawn.getCGameSceneNode();
75 |
76 | // ESP
77 | if (espConf.state) {
78 | if (C_CSPlayerPawn.getPlayerPawn() == localPlayer.getPlayerPawn()) continue;
79 | esp::sharedData::weaponID = C_CSPlayerPawn.getWeaponID();
80 | esp::sharedData::weaponName = C_CSPlayerPawn.getWeaponName();
81 | esp::sharedData::localOrigin = localPlayer.getOrigin();
82 | esp::sharedData::entityOrigin = C_CSPlayerPawn.getOrigin();
83 | esp::sharedData::distance = (int)(utils::getDistance(esp::sharedData::localOrigin, esp::sharedData::entityOrigin)) / 100;
84 |
85 | C_CSPlayerPawn.getOrigin();
86 | CGameSceneNode.getBoneArray();
87 |
88 | if (espConf.checkSpotted) {
89 | if (SharedFunctions::spottedCheck(C_CSPlayerPawn, localPlayer)) {
90 | esp::boundingBox(C_CSPlayerPawn.origin, viewMatrix, CCSPlayerController.pawnName, C_CSPlayerPawn.pawnHealth, CGameSceneNode.boneArray, true);
91 | }
92 | }
93 | else {
94 | esp::boundingBox(C_CSPlayerPawn.origin, viewMatrix, CCSPlayerController.pawnName, C_CSPlayerPawn.pawnHealth, CGameSceneNode.boneArray, SharedFunctions::spottedCheck(C_CSPlayerPawn, localPlayer));
95 | }
96 | }
97 |
98 | // C4 ESP
99 | if (espConf.c4State) {
100 | if (!overlayESP::isMenuOpen()) {
101 | if (!misc::isGameWindowActive()) return;
102 | }
103 | CGameSceneNode.value = C_C4.getCGameSceneNode();
104 | CGameSceneNode.getOrigin();
105 |
106 | esp::drawC4(CGameSceneNode.origin, viewMatrix, localPlayer, C_C4);
107 | }
108 |
109 | // Aim
110 | if (aimConf.state) {
111 |
112 | if (C_CSPlayerPawn.getPlayerPawn() == localPlayer.getPlayerPawn()) continue;
113 |
114 | // Player lock
115 | if (aimConf.playerLock) {
116 | aim::lockedPlayer = doPreferred(C_CSPlayerPawn, CGameSceneNode, localPlayer, aim::lockedPlayer, viewMatrix, aimConf.aimModeMap[aimConf.aimModes[aimConf.aimMode]], client).playerPawn;
117 | if (aim::lockedPlayer != C_CSPlayerPawn.playerPawn) continue;
118 | C_CSPlayerPawn.playerPawn = aim::lockedPlayer;
119 | }
120 |
121 | if (C_CSPlayerPawn.getPawnHealth() <= 0 || C_CSPlayerPawn.pawnHealth > 100) {
122 | aim::lockedPlayer = 0;
123 | continue;
124 | }
125 |
126 | CGameSceneNode.value = C_CSPlayerPawn.getCGameSceneNode();
127 | CGameSceneNode.getBoneArray();
128 |
129 | localPlayer.getCameraPos();
130 | localPlayer.getEyePos();
131 | localPlayer.getViewAngles();
132 |
133 | if (aimConf.checkSpotted) {
134 | if (SharedFunctions::spottedCheck(C_CSPlayerPawn, localPlayer)) {
135 | aim::aimBot(localPlayer, baseViewAngles, C_CSPlayerPawn.playerPawn, CGameSceneNode.boneArray, client);
136 | }
137 | }
138 | else {
139 | aim::aimBot(localPlayer, baseViewAngles, C_CSPlayerPawn.playerPawn, CGameSceneNode.boneArray, client);
140 | }
141 | }
142 | }
143 |
144 | if (miscConf.spectator) {
145 | if (!overlayESP::isMenuOpen()) {
146 | if (!misc::isGameWindowActive()) return;
147 | }
148 |
149 | ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize;
150 | ImGui::SetNextWindowPos({ 0.f, 200.f }, ImGuiCond_FirstUseEver);
151 | ImGui::SetNextWindowSize({ 100.f, 250.f }, ImGuiCond_FirstUseEver);
152 | if (ImGui::Begin("Spectators", nullptr, flags)) {
153 |
154 | for (int i = 0; i < spectators.size(); i++) {
155 | std::string name = spectators[i];
156 |
157 | ImGui::TextColored(utils::float3ToImColor(miscConf.spectatorColours, miscConf.spectatorColours[3]).Value, name.c_str());
158 | }
159 |
160 | ImGui::End();
161 | }
162 | }
163 |
164 | // Dropped Item
165 | if (miscConf.itemESP) misc::droppedItem(C_CSPlayerPawn, CGameSceneNode, viewMatrix);
166 | }
167 |
168 | C_CSPlayerPawn doPreferred(C_CSPlayerPawn C_CSPlayerPawn_, CGameSceneNode CGameSceneNode, LocalPlayer localPlayer, uintptr_t preferredTarget, view_matrix_t viewMatrix, int mode, MemoryManagement::moduleData client) {
169 | C_CSPlayerPawn target(client.base);
170 | if (preferredTarget == 0) return C_CSPlayerPawn_;
171 | target.playerPawn = preferredTarget;
172 |
173 | if (target.getPawnHealth() <= 0 || target.pawnHealth > 100)
174 | return C_CSPlayerPawn_;
175 |
176 | switch (mode) {
177 | case 0: {
178 | if (utils::getDistance(localPlayer.getOrigin(), target.getOrigin()) >
179 | utils::getDistance(localPlayer.getOrigin(), C_CSPlayerPawn_.getOrigin()))
180 | return C_CSPlayerPawn_;
181 | else return target;
182 | }
183 | case 1: {
184 | // C_CSPlayerPawn_ (Next player in entity list)
185 | Vector3 newOrigin = C_CSPlayerPawn_.getOrigin();
186 | Vector3 newOriginalPosToScreen = newOrigin.worldToScreen(viewMatrix);
187 |
188 | Vector3 newHeadPos = MemMan.ReadMem(CGameSceneNode.getBoneArray() + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
189 |
190 | Vector3 newHeadPosToScreen = newHeadPos.worldToScreen(viewMatrix);
191 |
192 | // preferredAimbot (Last potential target)
193 | CGameSceneNode.value = target.getCGameSceneNode();
194 |
195 | Vector3 oldOrigin = target.getOrigin();
196 | Vector3 oldOriginalPosToScreen = oldOrigin.worldToScreen(viewMatrix);
197 |
198 | Vector3 oldHeadPos = MemMan.ReadMem(CGameSceneNode.getBoneArray() + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
199 |
200 | Vector3 oldHeadPosToScreen = oldHeadPos.worldToScreen(viewMatrix);
201 |
202 | if (utils::getDistance({ oldHeadPosToScreen.x, oldHeadPosToScreen.y }, { (float)GetSystemMetrics(SM_CXSCREEN) / 2, (float)GetSystemMetrics(SM_CYSCREEN) / 2 }) >
203 | utils::getDistance({ newHeadPosToScreen.x, newHeadPosToScreen.y }, { (float)GetSystemMetrics(SM_CXSCREEN) / 2, (float)GetSystemMetrics(SM_CYSCREEN) / 2 }))
204 | return C_CSPlayerPawn_;
205 | else return target;
206 | }
207 | case 2: {
208 | // C_CSPlayerPawn_ (Next player in entity list)
209 | Vector3 newOrigin = C_CSPlayerPawn_.getOrigin();
210 | Vector3 newOriginalPosToScreen = newOrigin.worldToScreen(viewMatrix);
211 |
212 | Vector3 newHeadPos = MemMan.ReadMem(CGameSceneNode.getBoneArray() + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
213 |
214 | Vector3 newHeadPosToScreen = newHeadPos.worldToScreen(viewMatrix);
215 |
216 | // preferredAimbot (Last potential target)
217 | CGameSceneNode.value = target.getCGameSceneNode();
218 |
219 | Vector3 oldOrigin = target.getOrigin();
220 | Vector3 oldOriginalPosToScreen = oldOrigin.worldToScreen(viewMatrix);
221 |
222 | Vector3 oldHeadPos = MemMan.ReadMem(CGameSceneNode.getBoneArray() + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
223 |
224 | Vector3 oldHeadPosToScreen = oldHeadPos.worldToScreen(viewMatrix);
225 |
226 | if (utils::getDistance({ oldHeadPosToScreen.x, oldHeadPosToScreen.y }, { (float)GetSystemMetrics(SM_CXSCREEN) / 2, (float)GetSystemMetrics(SM_CYSCREEN) / 2 }) >
227 | utils::getDistance({ newHeadPosToScreen.x, newHeadPosToScreen.y }, { (float)GetSystemMetrics(SM_CXSCREEN) / 2, (float)GetSystemMetrics(SM_CYSCREEN) / 2 }))
228 | return target;
229 | else return C_CSPlayerPawn_;
230 | }
231 | case 3: {
232 | return target;
233 | }
234 | default: return C_CSPlayerPawn_;
235 | }
236 | }
--------------------------------------------------------------------------------
/features/entry.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "esp.hpp"
4 | #include "aim.hpp"
5 | #include "misc.hpp"
6 | #include "bomb.hpp"
7 | #include "include.hpp"
8 |
9 | #include "../util/config.hpp"
10 | #include "../util/utilFunctions.hpp"
11 |
12 | void mainLoop(bool state, MemoryManagement::moduleData client);
13 | C_CSPlayerPawn doPreferred(C_CSPlayerPawn C_CSPlayerPawn_, CGameSceneNode CGameSceneNode, LocalPlayer localPlayer, uintptr_t preferredTarget, view_matrix_t viewMatrix, int mode, MemoryManagement::moduleData client);
--------------------------------------------------------------------------------
/features/esp.cpp:
--------------------------------------------------------------------------------
1 | #include "esp.hpp"
2 | #include "misc.hpp"
3 |
4 | #include
5 |
6 | void esp::makeHealthBar(float health) {
7 | int healthBarYOffset = ((int)(sharedData::height * health * 0.01f));
8 |
9 | float red = (255.f - (health * 2.55f)) - 100.f;
10 | float green = (health * 2.55f) / 100.f;
11 |
12 | ImGui::GetBackgroundDrawList()->AddRectFilled({ sharedData::headPosToScreen.x - (sharedData::width + 2.f), sharedData::originalPosToScreen.y - sharedData::height }, { sharedData::headPosToScreen.x - (sharedData::width + 4.5f), sharedData::originalPosToScreen.y }, ImColor(0.f, 0.f, 0.f, 0.3f));
13 | ImGui::GetBackgroundDrawList()->AddRectFilled({ sharedData::headPosToScreen.x - (sharedData::width + 2.f), sharedData::originalPosToScreen.y - healthBarYOffset }, { sharedData::headPosToScreen.x - (sharedData::width + 4.5f), sharedData::originalPosToScreen.y }, ImColor(red, green, 0.f, 1.f));
14 | if (espConf.hpCounter) {
15 | ImGui::GetBackgroundDrawList()->AddText(imGuiMenu::espNameText, getFontSize(sideESPText, distance), { sharedData::headPosToScreen.x - (sharedData::width + 10.f), sharedData::originalPosToScreen.y - healthBarYOffset - 12.f }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2], espConf.attributeColours[3]), std::to_string((int)health).c_str());
16 | }
17 | }
18 |
19 |
20 | void esp::makeSkeleton(view_matrix_t viewMatrix, uintptr_t boneArray) {
21 | ImColor skeletonColour = ImColor(espConf.skeletonColours[0], espConf.skeletonColours[1], espConf.skeletonColours[2], espConf.skeletonColours[3]);
22 | ImColor jointColour = ImColor(espConf.jointColours[0], espConf.jointColours[1], espConf.jointColours[2], espConf.jointColours[3]);
23 | ImColor headColour = ImColor(espConf.headColours[0], espConf.headColours[1], espConf.headColours[2], espConf.headColours[3]);
24 | for (int i = 0; i < sizeof(boneConnections) / sizeof(boneConnections[0]); i++) {
25 | int bone1 = boneConnections[i].bone1;
26 | int bone2 = boneConnections[i].bone2;
27 |
28 | Vector3 VectorBone1 = MemMan.ReadMem(boneArray + bone1 * 32);
29 | Vector3 VectorBone2 = MemMan.ReadMem(boneArray + bone2 * 32);
30 |
31 | Vector3 b1 = VectorBone1.worldToScreen(viewMatrix);
32 | Vector3 b2 = VectorBone2.worldToScreen(viewMatrix);
33 |
34 | if (espConf.joint) ImGui::GetBackgroundDrawList()->AddCircleFilled({ b1.x, b1.y }, getJointSize(5.f, distance), jointColour);
35 |
36 | Render::Line(b1.x, b1.y, b2.x, b2.y, skeletonColour, 1.5);
37 | }
38 |
39 | if (espConf.head) {
40 | Vector3 headBone = MemMan.ReadMem(boneArray + bones::head * 32);
41 | Vector3 headBonePos = headBone.worldToScreen(viewMatrix);
42 | ImGui::GetBackgroundDrawList()->AddCircle({ headBonePos.x,headBonePos.y }, 40.f / (distance == 0 ? 1 : distance), headColour);
43 | }
44 | }
45 |
46 |
47 | void esp::makeName(std::string name) {
48 | ImVec2 textSize = ImGui::CalcTextSize(name.c_str());
49 | auto [horizontalOffset, verticalOffset] = getTextOffsets(textSize.x, textSize.y, 2.f);
50 |
51 | ImGui::GetBackgroundDrawList()->AddText(imGuiMenu::espNameText, getFontSize(normalESPText, distance), { sharedData::headPosToScreen.x - horizontalOffset, sharedData::headPosToScreen.y - verticalOffset }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2], espConf.attributeColours[3]), name.c_str());
52 | }
53 |
54 |
55 | void esp::makeWeaponname() {
56 | std::string name;
57 | if (strcmp(sharedData::weaponName.c_str(), "") == 0 || !std::filesystem::exists(DexterionSystem::weaponIconsTTF)) {
58 | name = getWeaponFromID(sharedData::weaponID);
59 | ImVec2 textSize = ImGui::CalcTextSize(name.c_str());
60 |
61 | auto [horizontalOffset, verticalOffset] = getTextOffsets(textSize.x, textSize.y, 2.f, (sharedData::height + 15.f));
62 |
63 | ImGui::GetBackgroundDrawList()->AddText(imGuiMenu::espNameText, getFontSize(normalESPText, distance), { sharedData::headPosToScreen.x - horizontalOffset, sharedData::headPosToScreen.y - verticalOffset }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2], espConf.attributeColours[3]), name.c_str());
64 | }
65 | else {
66 | name = gunIcon(weaponName);
67 | ImVec2 textSize = ImGui::CalcTextSize(name.c_str());
68 |
69 | auto [horizontalOffset, verticalOffset] = getTextOffsets(textSize.x, textSize.y, 2.f, (sharedData::height + 15.f));
70 |
71 | ImGui::GetBackgroundDrawList()->AddText(imGuiMenu::weaponIcons, getFontSize(normalESPText, distance), { sharedData::headPosToScreen.x - horizontalOffset - textSize.x, sharedData::headPosToScreen.y - verticalOffset }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2], espConf.attributeColours[3]), name.c_str());
72 | }
73 | }
74 |
75 | void esp::makeDistance() {
76 | std::string distanceText = std::format("[{} m]", std::to_string(sharedData::distance));
77 | ImVec2 textSize = ImGui::CalcTextSize(distanceText.c_str());
78 |
79 | auto [horizontalOffset, verticalOffset] = getTextOffsets(textSize.x, textSize.y, 2.f);
80 |
81 | ImGui::GetBackgroundDrawList()->AddText(imGuiMenu::espNameText, getFontSize(sideESPText, distance), { sharedData::headPosToScreen.x - horizontalOffset, sharedData::headPosToScreen.y - verticalOffset - 12 }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2], espConf.attributeColours[3]), distanceText.c_str());
82 | }
83 |
84 | void esp::drawC4(Vector3 origin, view_matrix_t viewMatrix, LocalPlayer localPlayer, C_C4 C_C4) {
85 | if (!C_C4.isPlanted()) return;
86 |
87 | Vector3 c4PosToScreen = origin.worldToScreen(viewMatrix);
88 |
89 | float distance = utils::getDistance(localPlayer.getOrigin(), origin) / 10;
90 |
91 | if (c4PosToScreen.z <= 0.f) return; // Check if C4 is behind the player
92 |
93 | float height = 40.f - (std::sqrt(distance)*5);
94 | height = height < 5 ? 5 : height;
95 | float width = height * 1.2f;
96 |
97 | float boxX = c4PosToScreen.x - width / 2;
98 | float boxY = c4PosToScreen.y - height / 2;
99 |
100 | Render::DrawGradientLine({ boxX, boxY }, { width + boxX, height + boxY }, ImColor(espConf.c4Colors[0], espConf.c4Colors[1], espConf.c4Colors[2], espConf.c4Colors[3]), (espConf.c4Gradient ? ImColor(espConf.c4ColorsGradient[0], espConf.c4ColorsGradient[1], espConf.c4ColorsGradient[2], espConf.c4ColorsGradient[3]) : ImColor(espConf.c4Colors[0], espConf.c4Colors[1], espConf.c4Colors[2], espConf.c4Colors[3])), espConf.c4Thickness);
101 | }
102 |
103 | void esp::boundingBox(Vector3 origin, view_matrix_t viewMatrix, std::string name, int health, uintptr_t boneArray, bool isSpotted) {
104 | if (origin.IsZero()) return;
105 |
106 | if (!overlayESP::isMenuOpen()) {
107 | if (!misc::isGameWindowActive()) return;
108 | }
109 |
110 | Vector3 originalPosToScreen = origin.worldToScreen(viewMatrix);
111 | sharedData::originalPosToScreen = originalPosToScreen;
112 | sharedData::origin = origin;
113 |
114 | Vector3 headPos = MemMan.ReadMem(boneArray + aimConf.boneMap[aimConf.bones[aimConf.boneSelect]] * 32);
115 | headPos.z = headPos.z + 15.f;
116 | sharedData::headPos = headPos;
117 |
118 | Vector3 headPosToScreen = headPos.worldToScreen(viewMatrix);
119 | sharedData::headPosToScreen = headPosToScreen;
120 |
121 | float height = originalPosToScreen.y - headPosToScreen.y;
122 | float width = height * espConf.width;
123 | width = width / 10.f;
124 | sharedData::height = height;
125 | sharedData::width = width;
126 |
127 | if (originalPosToScreen.z >= 0.1f) {
128 | if (espConf.boundBox) {
129 | ImColor filledBoxcolour;
130 | isSpotted == true ? filledBoxcolour = ImColor(espConf.spottedColours[0], espConf.spottedColours[1], espConf.spottedColours[2], espConf.spottedColours[3]) : filledBoxcolour = ImColor(espConf.notSpottedColours[0], espConf.notSpottedColours[1], espConf.notSpottedColours[2], espConf.notSpottedColours[3]);
131 |
132 | if (!espConf.gradient) ImGui::GetBackgroundDrawList()->AddRect({ headPosToScreen.x - width, headPosToScreen.y }, { headPosToScreen.x + width, originalPosToScreen.y }, ImColor(espConf.cornerColours[0], espConf.cornerColours[1], espConf.cornerColours[2], espConf.cornerColours[3]), 0.f, 0.f, espConf.boundBoxThickness);
133 | else Render::DrawGradientLine({ headPosToScreen.x - width, headPosToScreen.y }, { headPosToScreen.x + width, originalPosToScreen.y }, ImColor(espConf.cornerColours[0], espConf.cornerColours[1], espConf.cornerColours[2], espConf.cornerColours[3]), ImColor(espConf.cornerGradient[0], espConf.cornerGradient[1], espConf.cornerGradient[2], espConf.cornerGradient[3]), espConf.boundBoxThickness);
134 | if (espConf.filledBox) ImGui::GetBackgroundDrawList()->AddRectFilled({ headPosToScreen.x - width, headPosToScreen.y }, { headPosToScreen.x + width, originalPosToScreen.y }, filledBoxcolour, 0.f, 0.f);
135 | }
136 |
137 | if (espConf.isHealthBar) {
138 | makeHealthBar(health);
139 | }
140 |
141 | if (espConf.isPawnName) {
142 | makeName(name.c_str());
143 | }
144 |
145 | if (espConf.isPawnGun) {
146 | makeWeaponname();
147 | }
148 |
149 | if (espConf.skeleton) {
150 | makeSkeleton(viewMatrix, boneArray);
151 | }
152 |
153 | if (espConf.snapLines) {
154 | ImGui::GetBackgroundDrawList()->AddLine({ headPosToScreen.x - (width / 2.f), originalPosToScreen.y }, { (float)GetSystemMetrics(SM_CXSCREEN) / 2, (float)GetSystemMetrics(SM_CYSCREEN) }, ImColor(1.0f, 1.0f, 1.0f, 1.0f));
155 | }
156 |
157 | if (espConf.distance) {
158 | makeDistance();
159 | }
160 | }
161 | }
--------------------------------------------------------------------------------
/features/esp.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include "../gui/overlay.hpp"
7 | #include "../gui/menu.hpp"
8 |
9 | #include "../util/MemMan.hpp"
10 | #include "../util/attributes.hpp"
11 | #include "../util/config.hpp"
12 | #include "../util/Vectors.h"
13 |
14 | #include "../imgui/render.h"
15 |
16 | #include "../util/utilFunctions.hpp"
17 | #include "../util/weaponInfo.hpp"
18 |
19 | namespace esp {
20 | inline namespace sharedData {
21 | inline float width, height;
22 | inline Vector3 headPos, origin, headPosToScreen, originalPosToScreen;
23 | inline Vector3 localOrigin;
24 | inline Vector3 entityOrigin;
25 | inline uint64_t weaponID;
26 | inline int distance;
27 | inline std::string weaponName;
28 | };
29 |
30 | inline float normalESPText = 15.f;
31 | inline float sideESPText = 12.f;
32 |
33 | void makeHealthBar(float health);
34 | void makeSkeleton(view_matrix_t viewMatrix, uintptr_t boneArray);
35 | void makeName(std::string name);
36 | void makeWeaponname();
37 | void makeDistance();
38 |
39 | void boundingBox(Vector3 origin, view_matrix_t viewMatrix, std::string name, int health, uintptr_t boneArray,bool isSpotted = false);
40 |
41 | void drawC4(Vector3 origin, view_matrix_t viewMatrix, LocalPlayer localPlayer, C_C4 C_C4);
42 | }
--------------------------------------------------------------------------------
/features/include.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "../util/attributes.hpp"
6 | #include "../util/Vectors.h"
7 | #include "../imgui/render.h"
--------------------------------------------------------------------------------
/features/misc.cpp:
--------------------------------------------------------------------------------
1 | #include "misc.hpp"
2 |
3 | bool misc::isGameWindowActive() {
4 | HWND hwnd = GetForegroundWindow();
5 | if (hwnd) {
6 | char windowTitle[256];
7 | GetWindowTextA(hwnd, windowTitle, sizeof(windowTitle));
8 | return std::string(windowTitle).find("Counter-Strike 2") != std::string::npos;
9 | }
10 | return false;
11 | }
12 |
13 | void misc::droppedItem(C_CSPlayerPawn C_CSPlayerPawn, CGameSceneNode CGameSceneNode, view_matrix_t viewMatrix) {
14 | if (!overlayESP::isMenuOpen()) {
15 | if (!misc::isGameWindowActive()) return;
16 | }
17 |
18 | for (int i = 65; i < 1024; i++) {
19 | // Entity
20 | C_CSPlayerPawn.value = i;
21 | C_CSPlayerPawn.getListEntry();
22 | if (C_CSPlayerPawn.listEntry == 0) continue;
23 | C_CSPlayerPawn.getPlayerPawn();
24 | if (C_CSPlayerPawn.playerPawn == 0) continue;
25 | if (C_CSPlayerPawn.getOwner() != -1) continue;
26 |
27 | // Entity name
28 | uintptr_t entity = MemMan.ReadMem(C_CSPlayerPawn.playerPawn + 0x10);
29 | uintptr_t designerNameAddy = MemMan.ReadMem(entity + 0x20);
30 |
31 | char designerNameBuffer[MAX_PATH]{};
32 | MemMan.ReadRawMem(designerNameAddy, designerNameBuffer, MAX_PATH);
33 |
34 | std::string name = std::string(designerNameBuffer);
35 |
36 | if (strstr(name.c_str(), "weapon_")) name.erase(0, 7);
37 | else if (strstr(name.c_str(), "_projectile")) name.erase(name.length() - 11, 11);
38 | else if (strstr(name.c_str(), "baseanimgraph")) name = "defuse kit";
39 | else continue;
40 |
41 | // Origin position of entity
42 | CGameSceneNode.value = C_CSPlayerPawn.getCGameSceneNode();
43 | CGameSceneNode.getOrigin();
44 | CGameSceneNode.origin = CGameSceneNode.origin.worldToScreen(viewMatrix);
45 |
46 | // Drawing
47 | if (CGameSceneNode.origin.z >= 0.01f) {
48 | ImVec2 textSize = ImGui::CalcTextSize(name.c_str());
49 | auto [horizontalOffset, verticalOffset] = getTextOffsets(textSize.x, textSize.y, 2.f);
50 |
51 | ImFont* gunText = {};
52 | if (std::filesystem::exists(DexterionSystem::weaponIconsTTF)) {
53 | gunText = imGuiMenu::weaponIcons;
54 | name = gunIcon(name);
55 | }
56 | else gunText = imGuiMenu::espNameText;
57 |
58 | ImGui::GetBackgroundDrawList()->AddText(gunText, 12, { CGameSceneNode.origin.x - horizontalOffset, CGameSceneNode.origin.y - verticalOffset }, ImColor(espConf.attributeColours[0], espConf.attributeColours[1], espConf.attributeColours[2]), name.c_str());
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/features/misc.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "include.hpp"
4 |
5 | #include "../util/config.hpp"
6 | #include "../gui/menu.hpp"
7 | #include "../gui/overlay.hpp"
8 |
9 | namespace misc {
10 |
11 | inline namespace sharedData {
12 | inline int bhopInAir = (1 << 0);
13 | };
14 |
15 | void droppedItem(C_CSPlayerPawn C_CSPlayerPawn, CGameSceneNode CGameSceneNode, view_matrix_t viewMatrix);
16 | bool isGameWindowActive();
17 | }
--------------------------------------------------------------------------------
/fonts/weaponIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/fonts/weaponIcons.ttf
--------------------------------------------------------------------------------
/gui/menu.cpp:
--------------------------------------------------------------------------------
1 | #include "menu.hpp"
2 |
3 | #include "../features/entry.hpp"
4 | #include "../util/config.hpp"
5 | #include "../util/DiscordVerify.hpp"
6 | #include "../util/utilFunctions.hpp"
7 |
8 | void imGuiMenu::setStyle() {
9 | // Dexterion GUI style from ImThemes
10 | ImGuiStyle& style = ImGui::GetStyle();
11 |
12 | style.Alpha = 1.0f;
13 | style.DisabledAlpha = 1.0f;
14 | style.WindowPadding = ImVec2(12.0f, 12.0f);
15 | style.WindowRounding = 6.0f;
16 | style.WindowBorderSize = 0.0f;
17 | style.WindowMinSize = ImVec2(20.0f, 20.0f);
18 | style.WindowTitleAlign = ImVec2(0.0f, 0.5f);
19 | style.WindowMenuButtonPosition = ImGuiDir_Right;
20 | style.ChildRounding = 6.0f;
21 | style.ChildBorderSize = 1.0f;
22 | style.PopupRounding = 6.0f;
23 | style.PopupBorderSize = 1.0f;
24 | style.FramePadding = ImVec2(20.0f, 8.0f);
25 | style.FrameRounding = 6.0f;
26 | style.FrameBorderSize = 0.0f;
27 | style.ItemSpacing = ImVec2(7.900000095367432f, 6.0f);
28 | style.ItemInnerSpacing = ImVec2(6.0f, 3.0f);
29 | style.CellPadding = ImVec2(12.0f, 6.0f);
30 | style.IndentSpacing = 20.0f;
31 | style.ColumnsMinSpacing = 20.0f;
32 | style.ScrollbarSize = 15.89999961853027f;
33 | style.ScrollbarRounding = 20.0f;
34 | style.GrabMinSize = 10.0f;
35 | style.GrabRounding = 20.0f;
36 | style.TabRounding = 6.0f;
37 | style.TabBorderSize = 1.0f;
38 | style.TabMinWidthForCloseButton = 10.0f;
39 | style.ColorButtonPosition = ImGuiDir_Left;
40 | style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
41 | style.SelectableTextAlign = ImVec2(0.0f, 0.0f);
42 |
43 | style.Colors[ImGuiCol_Text] = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
44 | style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.2745098173618317f, 0.3176470696926117f, 0.4509803950786591f, 1.0f);
45 | style.Colors[ImGuiCol_WindowBg] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
46 | style.Colors[ImGuiCol_ChildBg] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
47 | style.Colors[ImGuiCol_PopupBg] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
48 | style.Colors[ImGuiCol_Border] = ImVec4(0.1568627506494522f, 0.168627455830574f, 0.1921568661928177f, 1.0f);
49 | style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
50 | style.Colors[ImGuiCol_FrameBg] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
51 | style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.1568627506494522f, 0.168627455830574f, 0.1921568661928177f, 1.0f);
52 | style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.2352941185235977f, 0.2156862765550613f, 0.5960784554481506f, 1.0f);
53 | style.Colors[ImGuiCol_TitleBg] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
54 | style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
55 | style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
56 | style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.09803921729326248f, 0.105882354080677f, 0.1215686276555061f, 1.0f);
57 | style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
58 | style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
59 | style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.1568627506494522f, 0.168627455830574f, 0.1921568661928177f, 1.0f);
60 | style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
61 | style.Colors[ImGuiCol_CheckMark] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
62 | style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
63 | style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.5372549295425415f, 0.5529412031173706f, 1.0f, 1.0f);
64 | style.Colors[ImGuiCol_Button] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
65 | style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.196078434586525f, 0.1764705926179886f, 0.5450980663299561f, 1.0f);
66 | style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.2352941185235977f, 0.2156862765550613f, 0.5960784554481506f, 1.0f);
67 | style.Colors[ImGuiCol_Header] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
68 | style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.196078434586525f, 0.1764705926179886f, 0.5450980663299561f, 1.0f);
69 | style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.2352941185235977f, 0.2156862765550613f, 0.5960784554481506f, 1.0f);
70 | style.Colors[ImGuiCol_Separator] = ImVec4(0.1568627506494522f, 0.1843137294054031f, 0.250980406999588f, 1.0f);
71 | style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.1568627506494522f, 0.1843137294054031f, 0.250980406999588f, 1.0f);
72 | style.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.1568627506494522f, 0.1843137294054031f, 0.250980406999588f, 1.0f);
73 | style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
74 | style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.196078434586525f, 0.1764705926179886f, 0.5450980663299561f, 1.0f);
75 | style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.2352941185235977f, 0.2156862765550613f, 0.5960784554481506f, 1.0f);
76 | style.Colors[ImGuiCol_Tab] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
77 | style.Colors[ImGuiCol_TabHovered] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
78 | style.Colors[ImGuiCol_TabActive] = ImVec4(0.09803921729326248f, 0.105882354080677f, 0.1215686276555061f, 1.0f);
79 | style.Colors[ImGuiCol_TabUnfocused] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
80 | style.Colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.0784313753247261f, 0.08627451211214066f, 0.1019607856869698f, 1.0f);
81 | style.Colors[ImGuiCol_PlotLines] = ImVec4(0.6394850015640259f, 0.650776743888855f, 1.0f, 1.0f);
82 | style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.0f, 0.4980392456054688f, 0.4980392456054688f, 1.0f);
83 | style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
84 | style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.0f, 0.4980392456054688f, 0.4980392456054688f, 1.0f);
85 | style.Colors[ImGuiCol_TableHeaderBg] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
86 | style.Colors[ImGuiCol_TableBorderStrong] = ImVec4(0.0470588244497776f, 0.05490196123719215f, 0.07058823853731155f, 1.0f);
87 | style.Colors[ImGuiCol_TableBorderLight] = ImVec4(0.0f, 0.0f, 0.0f, 1.0f);
88 | style.Colors[ImGuiCol_TableRowBg] = ImVec4(0.1176470592617989f, 0.1333333402872086f, 0.1490196138620377f, 1.0f);
89 | style.Colors[ImGuiCol_TableRowBgAlt] = ImVec4(0.09803921729326248f, 0.105882354080677f, 0.1215686276555061f, 1.0f);
90 | style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.2352941185235977f, 0.2156862765550613f, 0.5960784554481506f, 1.0f);
91 | style.Colors[ImGuiCol_DragDropTarget] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
92 | style.Colors[ImGuiCol_NavHighlight] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
93 | style.Colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.4980392158031464f, 0.5137255191802979f, 1.0f, 1.0f);
94 | style.Colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.196078434586525f, 0.1764705926179886f, 0.5450980663299561f, 0.501960813999176f);
95 | style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.196078434586525f, 0.1764705926179886f, 0.5450980663299561f, 0.501960813999176f);
96 | }
97 |
98 |
99 | void imGuiMenu::verticalSplitter(float width,float height) {
100 | ImGui::SameLine();
101 | ImGui::InvisibleButton("vsplitter", ImVec2(8.0f, height));
102 | if (ImGui::IsItemActive())
103 | width += ImGui::GetIO().MouseDelta.x;
104 | ImGui::SameLine();
105 | }
106 |
107 |
108 | void imGuiMenu::horizontalSplitter(float height) {
109 | ImGui::InvisibleButton("hsplitter", ImVec2(-1, 8.0f));
110 | if (ImGui::IsItemActive())
111 | height += ImGui::GetIO().MouseDelta.y;
112 | }
113 |
114 |
115 | void imGuiMenu::espRender() {
116 | if (tabCount == 1) {
117 |
118 | ImGui::BeginChild("Features", ImVec2(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt), true);
119 | ImGui::PushFont(imGuiMenu::titleText);
120 | ImGui::Text("Attributes");
121 | ImGui::PopFont();
122 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
123 | ImGui::Checkbox("ESP toggle", &espConf.state);
124 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
125 | if (espConf.state) {
126 | ImGui::Checkbox("Gradient Line", &espConf.gradient);
127 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
128 | ImGui::Checkbox("Bounding Box", &espConf.boundBox);
129 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
130 | ImGui::Checkbox("Player name", &espConf.isPawnName);
131 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
132 | ImGui::Checkbox("Weapon name", &espConf.isPawnGun);
133 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
134 | ImGui::Checkbox("Health bar", &espConf.isHealthBar);
135 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
136 | ImGui::Checkbox("Skeleton", &espConf.skeleton);
137 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
138 | ImGui::Checkbox("Head", &espConf.head);
139 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
140 | ImGui::Checkbox("Joints", &espConf.joint);
141 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
142 | ImGui::Checkbox("Distance", &espConf.distance);
143 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
144 | ImGui::Checkbox("Snap lines", &espConf.snapLines);
145 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
146 | }
147 | ImGui::Checkbox("C4 ESP Toggle", &espConf.c4State);
148 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
149 | if (espConf.c4State) {
150 | ImGui::Checkbox("Gradient", &espConf.c4Gradient);
151 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
152 | ImGui::Checkbox("Carrier", &espConf.c4Carrier);
153 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
154 | }
155 | ImGui::EndChild();
156 |
157 | verticalSplitter(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt);
158 |
159 | ImGui::BeginChild("Feature options", ImVec2(0, imGuiMenu::heightSeparatorInt), true);
160 | ImGui::PushFont(imGuiMenu::titleText);
161 | ImGui::Text("Feature options");
162 | ImGui::PopFont();
163 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
164 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
165 | ImGui::PushFont(imGuiMenu::subTitleText);
166 | ImGui::Text("Main options");
167 | ImGui::PopFont();
168 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
169 | ImGui::Checkbox("Visibility check", &espConf.checkSpotted);
170 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
171 | ImGui::PushFont(imGuiMenu::subTitleText);
172 | ImGui::Text("Health options");
173 | ImGui::PopFont();
174 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
175 | ImGui::Checkbox("HP counter", &espConf.hpCounter);
176 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
177 | ImGui::PushFont(imGuiMenu::subTitleText);
178 | ImGui::Text("Box options");
179 | ImGui::PopFont();
180 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
181 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
182 | ImGui::Checkbox("Colour fill", &espConf.filledBox);
183 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
184 | ImGui::SliderFloat("Width", &espConf.width, 1.f, 5.f);
185 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
186 | ImGui::SliderFloat("Thickness", &espConf.boundBoxThickness, 1.f, 3.f);
187 | if (espConf.c4State) {
188 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
189 | ImGui::SliderFloat("C4 Thickness", &espConf.c4Thickness, 1.f, 3.f);
190 | }
191 | ImGui::EndChild();
192 |
193 | horizontalSplitter(HEIGHT);
194 |
195 | ImGui::BeginChild("Colours", ImVec2(0, 0), true);
196 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
197 | ImGui::PushFont(imGuiMenu::titleText);
198 | ImGui::Text("Colours");
199 | ImGui::PopFont();
200 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
201 | ImGui::ColorEdit4("Box spotted", (float*)&espConf.spottedColours);
202 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
203 | ImGui::ColorEdit4("Box not spotted", (float*)&espConf.notSpottedColours);
204 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
205 | ImGui::ColorEdit4("Atrributes colour", (float*)&espConf.attributeColours);
206 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
207 | ImGui::ColorEdit4("Corner colours", (float*)&espConf.cornerColours);
208 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
209 | if (espConf.gradient) {
210 | ImGui::ColorEdit4("Corner gradient", (float*)&espConf.cornerGradient);
211 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
212 | }
213 | ImGui::ColorEdit4("Skeleton colour", (float*)&espConf.skeletonColours);
214 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
215 | ImGui::ColorEdit4("Head colours", (float*)&espConf.headColours);
216 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
217 | ImGui::ColorEdit4("Joint colours", (float*)&espConf.jointColours);
218 | if (espConf.c4State) {
219 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
220 | ImGui::ColorEdit4("C4 Colors", (float*)&espConf.c4Colors);
221 | if (espConf.c4Gradient) {
222 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
223 | ImGui::ColorEdit4("C4 Gradient", (float*)&espConf.c4ColorsGradient);
224 | }
225 | }
226 |
227 | ImGui::EndChild();
228 | }
229 | }
230 |
231 | void imGuiMenu::aimRender() {
232 | if (tabCount == 2) {
233 |
234 | ImGui::BeginChild("Aimbot", ImVec2(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt), true);
235 | ImGui::PushFont(imGuiMenu::titleText);
236 | ImGui::Text("Aimbot");
237 | ImGui::PopFont();
238 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
239 | ImGui::Checkbox("Aimbot", &aimConf.state);
240 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
241 | ImGui::Checkbox("Fov circle", &aimConf.fovCircle);
242 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
243 | ImGui::Checkbox("Visibility check", &aimConf.checkSpotted);
244 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
245 | ImGui::SliderFloat("FOV", &aimConf.fov, 1.f, 25.f);
246 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
247 | ImGui::SliderFloat("Smoothing", &aimConf.smoothing, 1.f, 5.f);
248 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
249 | ImGui::InputFloat("Aim Sensibility", &aimConf.sens, 0.01f, 8.f);
250 | ImGui::EndChild();
251 |
252 | verticalSplitter(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt);
253 |
254 | ImGui::BeginChild("Misc", ImVec2(0, imGuiMenu::heightSeparatorInt), true);
255 | ImGui::PushFont(imGuiMenu::titleText);
256 | ImGui::Text("Miscellaneous aim functions");
257 | ImGui::PopFont();
258 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
259 | ImGui::Checkbox("Recoil Control", &aimConf.rcs);
260 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
261 | ImGui::Checkbox("Player lock", &aimConf.playerLock);
262 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
263 | ImGui::Checkbox("Trigger Bot", &aimConf.trigger);
264 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
265 | ImGui::Checkbox("Trigger bot hot key", &aimConf.isHotTrigger);
266 | if (aimConf.isHotTrigger) {
267 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
268 | if (ImGui::BeginCombo("Hot key", aimConf.hotKey[aimConf.hotSelectTrigger].c_str())) {
269 | for (int i = 0; i < aimConf.hotKey.size(); ++i) {
270 | const bool isSelected = (aimConf.hotTrigger == i);
271 |
272 | if (ImGui::Selectable(aimConf.hotKey[i].c_str(), isSelected)) {
273 | aimConf.hotSelectTrigger = i;
274 | }
275 |
276 | if (isSelected) {
277 | ImGui::SetItemDefaultFocus();
278 | }
279 | }
280 | ImGui::EndCombo();
281 | }
282 | }
283 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
284 | if (ImGui::BeginCombo("Aimbot Preference", aimConf.aimModes[aimConf.aimMode].c_str())) {
285 | for (int i = 0; i < aimConf.aimModes.size(); ++i) {
286 | const bool isSelected = (aimConf.aimMode == i);
287 |
288 | if (ImGui::Selectable(aimConf.aimModes[i].c_str(), isSelected)) {
289 | aimConf.aimMode = i;
290 | }
291 |
292 | if (isSelected) {
293 | ImGui::SetItemDefaultFocus();
294 | }
295 | }
296 | ImGui::EndCombo();
297 | }
298 | ImGui::EndChild();
299 |
300 | horizontalSplitter(HEIGHT);
301 |
302 | ImGui::BeginChild("Hitboxes", ImVec2(0, 0), true);
303 | ImGui::PushFont(imGuiMenu::titleText);
304 | ImGui::Text("Hitboxes");
305 | ImGui::PopFont();
306 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
307 | if (ImGui::BeginCombo("Hit box", aimConf.bones[aimConf.boneSelect].c_str())) {
308 | for (int i = 0; i < aimConf.bones.size(); ++i) {
309 | const bool isSelected = (aimConf.bone == i);
310 |
311 | if (ImGui::Selectable(aimConf.bones[i].c_str(), isSelected)) {
312 | aimConf.boneSelect = i;
313 | }
314 |
315 | if (isSelected) {
316 | ImGui::SetItemDefaultFocus();
317 | }
318 | }
319 | ImGui::EndCombo();
320 | }
321 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
322 | ImGui::Checkbox("Aim bot hot key", &aimConf.isHotAim);
323 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
324 | if (aimConf.isHotAim) {
325 | if (ImGui::BeginCombo("Hot key", aimConf.hotKey[aimConf.hotSelectAim].c_str())) {
326 | for (int i = 0; i < aimConf.hotKey.size(); ++i) {
327 | const bool isSelected = (aimConf.hotAim == i);
328 |
329 | if (ImGui::Selectable(aimConf.hotKey[i].c_str(), isSelected)) {
330 | aimConf.hotSelectAim = i;
331 | }
332 |
333 | if (isSelected) {
334 | ImGui::SetItemDefaultFocus();
335 | }
336 | }
337 | ImGui::EndCombo();
338 | }
339 | }
340 | ImGui::EndChild();
341 | }
342 | }
343 |
344 | void imGuiMenu::miscRender() {
345 | if (tabCount == 3) {
346 | ImGui::BeginChild("Movement", ImVec2(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt), true);
347 | ImGui::PushFont(imGuiMenu::titleText);
348 | ImGui::Text("Utilities");
349 | ImGui::PopFont();
350 | ImGui::Checkbox("Console Visibility", &miscConf.consoleVisible);
351 | if (miscConf.consoleVisible != utils::intToBool(Shared::lastConsoleState)) {
352 | ShowWindow(GetConsoleWindow(), miscConf.consoleVisible ? SW_RESTORE : SW_HIDE);
353 | Shared::lastConsoleState = miscConf.consoleVisible ? SW_RESTORE : SW_HIDE;
354 | }
355 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
356 | ImGui::Checkbox("OBS BYPASS", &miscConf.obsBypass);
357 | if (miscConf.obsBypass != utils::intToBool(Shared::lastAffinity)) {
358 | SetWindowDisplayAffinity(GetForegroundWindow(), miscConf.obsBypass ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE);
359 | Shared::lastAffinity = miscConf.obsBypass ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
360 | }
361 | ImGui::EndChild();
362 |
363 | verticalSplitter(imGuiMenu::widthSeparatorInt, imGuiMenu::heightSeparatorInt);
364 |
365 | ImGui::BeginChild("Colours", ImVec2(0, imGuiMenu::heightSeparatorInt), true);
366 | ImGui::PushFont(imGuiMenu::titleText);
367 | ImGui::Text("Colours");
368 | ImGui::PopFont();
369 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
370 | ImGui::ColorEdit4("Spectator List", (float*)&miscConf.spectatorColours);
371 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
372 | ImGui::ColorEdit4("Bomb Timer", (float*)&miscConf.bombTimerColours);
373 | ImGui::EndChild();
374 |
375 | horizontalSplitter(HEIGHT);
376 |
377 | ImGui::BeginChild("Visual", ImVec2(0, 0), true);
378 | ImGui::PushFont(imGuiMenu::titleText);
379 | ImGui::Text("Visual");
380 | ImGui::PopFont();
381 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
382 | ImGui::Checkbox("DeathMatch Mode", &miscConf.deathmatchMode);
383 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
384 | ImGui::Checkbox("Dropped Item ESP", &miscConf.itemESP);
385 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
386 | ImGui::Checkbox("Spectator List", &miscConf.spectator);
387 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
388 | ImGui::Checkbox("Bomb Timer", &miscConf.bombTimer);
389 | ImGui::EndChild();
390 | }
391 | }
392 |
393 | void imGuiMenu::aboutMeRender() {
394 | if (tabCount == 4) {
395 | ImGui::BeginChild("About the project", ImVec2(0, 0), true);
396 | ImGui::PushFont(imGuiMenu::titleText);
397 | ImGui::Text("Github");
398 | ImGui::PopFont();
399 | ImGui::TextLinkOpenURL("Dexterion Github", "https://github.com/Skwrr/Dexterion");
400 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
401 | ImGui::TextLinkOpenURL("Tim Apple Github Fork", "https://github.com/kristofhracza/tim_apple");
402 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
403 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
404 | ImGui::PushFont(imGuiMenu::titleText);
405 | ImGui::Text("HackVsHack");
406 | ImGui::PopFont();
407 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
408 | ImGui::PushFont(imGuiMenu::subTitleText);
409 | ImGui::Text("Release thread");
410 | ImGui::PopFont();
411 | ImGui::TextLinkOpenURL("Dexterion", "https://hackvshack.net/threads/dexterion-semi-external-cs2-cheat-updated-10-07-2024.4978/");
412 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
413 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
414 | ImGui::PushFont(imGuiMenu::titleText);
415 | ImGui::Text("UnknownCheats");
416 | ImGui::PopFont();
417 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
418 | ImGui::PushFont(imGuiMenu::subTitleText);
419 | ImGui::Text("Release thread");
420 | ImGui::PopFont();
421 | ImGui::TextLinkOpenURL("Dexterion", " https://www.unknowncheats.me/forum/counter-strike-2-a/647464-dexterion-semi-external-cs2-cheat.html");
422 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
423 | ImGui::TextLinkOpenURL("Tim Apple", "https://www.unknowncheats.me/forum/counter-strike-2-releases/609206-cs2-external-cheat-tim-apple.html");
424 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
425 | ImGui::PushFont(imGuiMenu::subTitleText);
426 | ImGui::Text("Developer Profile");
427 | ImGui::PopFont();
428 | ImGui::TextLinkOpenURL("UC Author Profile", "https://www.unknowncheats.me/forum/members/6169955.html");
429 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
430 | ImGui::TextLinkOpenURL("Discord", "https://www.unknowncheats.me/forum/members/6169955.html");
431 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
432 | ImGui::PushFont(imGuiMenu::titleText);
433 | ImGui::Text("Discord");
434 | ImGui::PopFont();
435 | ImGui::TextLinkOpenURL("Click me!", "https://discord.gg/jwueZBpnyY");
436 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
437 | ImGui::PushFont(imGuiMenu::titleText);
438 | ImGui::Text(("Version: " + utils::version).c_str());
439 | ImGui::EndChild();
440 | }
441 | }
442 |
443 |
444 | void imGuiMenu::configRender() {
445 | if (tabCount == 5) {
446 | ImGui::BeginChild("Configuration File", ImVec2(0, 0), true);
447 | std::vector configNamesNarrow;
448 | // wide strings to narrow strings
449 | for (const auto& name : CONFIG_NAMES) {
450 | configNamesNarrow.push_back(std::string(name.begin(), name.end()));
451 | }
452 | // vector for combo
453 | std::vector configNamesCStr;
454 | for (const auto& name : configNamesNarrow) {
455 | configNamesCStr.push_back(name.c_str());
456 | }
457 |
458 | ImGui::Combo("Select Config", ¤tConfigIndex, configNamesCStr.data(), configNamesCStr.size());
459 |
460 | ImGui::Dummy(ImVec2(0.0f, textSeparatorSpace));
461 | if (ImGui::Button("Refresh Config", ImVec2(210, 50))) {
462 | config::refresh();
463 | for (const auto& name : CONFIG_NAMES) {
464 | configNamesNarrow.push_back(std::string(name.begin(), name.end()));
465 | }
466 | for (const auto& name : configNamesNarrow) {
467 | configNamesCStr.push_back(name.c_str());
468 | }
469 | }
470 | if (ImGui::Button("Save", ImVec2(100, 50))) config::save(currentConfigIndex);
471 | ImGui::SameLine();
472 | if (ImGui::Button("Load", ImVec2(100, 50))) config::load(currentConfigIndex);
473 |
474 | ImGui::EndChild();
475 | }
476 | }
477 |
478 | void imGuiMenu::accountRender() {
479 | if (tabCount == 6) {
480 | ImGui::BeginChild("Account", ImVec2(0, 0), true);
481 |
482 | if (ImGui::Button("Copy My Token", ImVec2(150, 40))) {
483 | ImGui::LogToClipboard();
484 | ImGui::LogText(DiscordVerify::getToken(Shared::steamId).c_str());
485 | ImGui::LogFinish();
486 | ImGui::OpenPopup("CopyToken");
487 | }
488 |
489 | if (ImGui::BeginPopupModal("CopyToken", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove)) {
490 | ImGui::Text("Your token has been copied to your clipboard!");
491 | ImGui::Separator();
492 | if (ImGui::Button("OK", ImVec2(120, 0))) { ImGui::CloseCurrentPopup(); }
493 | ImGui::EndPopup();
494 | }
495 |
496 | ImGui::EndChild();
497 | }
498 | }
499 |
500 | void imGuiMenu::menuBar() {
501 | ImGui::BeginMenuBar();
502 |
503 | if (ImGui::MenuItem("ESP")) tabCount = 1;
504 | if (ImGui::MenuItem("Aim")) tabCount = 2;
505 | if (ImGui::MenuItem("Misc")) tabCount = 3;
506 | if (ImGui::MenuItem("About")) tabCount = 4;
507 | if (ImGui::MenuItem("Config")) tabCount = 5;
508 | if (ImGui::MenuItem("Account")) tabCount = 6;
509 |
510 | ImGui::EndMenuBar();
511 | }
512 |
513 |
514 | void imGuiMenu::renderMenu(bool state) {
515 | ImGui::PushFont(normalText);
516 | ImGui::SetNextWindowSize({WIDTH,HEIGHT}, ImGuiCond_FirstUseEver);
517 | ImGui::Begin("Dexterion", NULL, ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoCollapse);
518 |
519 | // Config
520 | setStyle();
521 | menuBar();
522 |
523 | // Menus
524 | espRender();
525 | aimRender();
526 | miscRender();
527 | aboutMeRender();
528 | configRender();
529 | accountRender();
530 |
531 | ImGui::PopFont();
532 | ImGui::End();
533 | }
534 |
--------------------------------------------------------------------------------
/gui/menu.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "../imgui/imgui.h"
4 |
5 | namespace imGuiMenu {
6 | inline float WIDTH = 650.f;
7 | inline float HEIGHT = 720.f;
8 |
9 | inline int tabCount = 1;
10 |
11 | inline float areaSeparatorSpace = 8.f;
12 | inline float textSeparatorSpace = 4.f;
13 | inline float widthSeparatorInt = WIDTH / 2;
14 | inline float heightSeparatorInt = HEIGHT / 2 + 20;
15 | inline float bottomHeightSeparatorInt = HEIGHT;
16 |
17 | inline ImFont* normalText;
18 | inline ImFont* titleText;
19 | inline ImFont* highlightText;
20 | inline ImFont* espNameText;
21 | inline ImFont* subTitleText;
22 | inline ImFont* weaponIcons;
23 |
24 |
25 | void menuBar();
26 | void renderMenu(bool state);
27 | void setStyle();
28 |
29 | void verticalSplitter(float width, float height);
30 | void horizontalSplitter(float height);
31 |
32 |
33 | void espRender();
34 | void aimRender();
35 | void miscRender();
36 | void aboutMeRender();
37 | void configRender();
38 | void accountRender();
39 | }
--------------------------------------------------------------------------------
/gui/overlay.cpp:
--------------------------------------------------------------------------------
1 | #include "overlay.hpp"
2 | #include "menu.hpp"
3 | #include "thread";
4 |
5 | #include "../util/Vectors.h"
6 | #include "../util/MemMan.hpp"
7 | #include "../util/attributes.hpp"
8 | #include "../util/config.hpp"
9 |
10 | #include "../features/entry.hpp"
11 |
12 | WNDCLASSEXW overlayESP::createWindowClass(HINSTANCE hInstance, WNDPROC Wndproc, LPCWSTR windowname) {
13 | this->hInstance = hInstance;
14 |
15 | windowClass.cbSize = sizeof(WNDCLASSEXA);
16 | windowClass.hInstance = hInstance;
17 | windowClass.lpfnWndProc = Wndproc;
18 | windowClass.style = CS_HREDRAW | CS_VREDRAW;
19 | windowClass.lpszClassName = windowname;
20 |
21 | return windowClass;
22 | };
23 |
24 |
25 | HWND overlayESP::createWindow(int horizontalSize, int verticallSize) {
26 | HWND window = nullptr;
27 | RegisterClassExW(&windowClass);
28 |
29 | int winx = GetSystemMetrics(SM_CXSCREEN);
30 | int winy = GetSystemMetrics(SM_CYSCREEN);
31 |
32 | window = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, windowClass.lpszClassName, windowClass.lpszClassName, WS_POPUP, 0, 0, winx, winy, 0, 0, windowClass.hInstance, 0);
33 | SetLayeredWindowAttributes(window, RGB(0, 0, 0), BYTE(255), LWA_ALPHA);
34 |
35 | this->window = window;
36 |
37 | SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
38 | printf("[overlay.cpp] Overlay Created Succesfully!\n");
39 |
40 | return window;
41 | }
42 |
43 |
44 | void overlayESP::makeFrameIntoClientArea() {
45 |
46 | RECT clientArea{};
47 | GetClientRect(window, &clientArea);
48 |
49 | RECT windowArea{};
50 | GetWindowRect(window, &windowArea);
51 |
52 | POINT diff{};
53 | ClientToScreen(window, &diff);
54 |
55 | const MARGINS margins{
56 | windowArea.left + (diff.x - windowArea.left),
57 | windowArea.top + (diff.y - windowArea.top),
58 | clientArea.right,
59 | clientArea.bottom
60 | };
61 |
62 | DwmExtendFrameIntoClientArea(window, &margins);
63 | }
64 |
65 |
66 | void overlayESP::makeDeviceAndSwapChain() {
67 |
68 | swapChain.BufferDesc.RefreshRate.Numerator = 60;
69 | swapChain.BufferDesc.RefreshRate.Denominator = 1;
70 | swapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
71 | swapChain.SampleDesc.Count = 1;
72 | swapChain.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
73 | swapChain.BufferCount = 2;
74 | swapChain.OutputWindow = window;
75 | swapChain.Windowed = TRUE;
76 | swapChain.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
77 | swapChain.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
78 |
79 | D3D11CreateDeviceAndSwapChain(0, D3D_DRIVER_TYPE_HARDWARE, 0, 0, featureLevels, 2, D3D11_SDK_VERSION, &swapChain, &loadedSwapChain, &device, &loadedLevel, &deviceContext);
80 |
81 | loadedSwapChain->GetBuffer(0, IID_PPV_ARGS(&backBuffer));
82 |
83 | if (backBuffer) {
84 | device->CreateRenderTargetView(backBuffer, 0, &renderTargetView);
85 | backBuffer->Release();
86 | }
87 | };
88 |
89 | void overlayESP::initWindow(int nShowCmd) {
90 | ShowWindow(window, nShowCmd);
91 | UpdateWindow(window);
92 |
93 | ImGui::CreateContext();
94 | ImGuiIO& io = ImGui::GetIO();
95 | io.Fonts->AddFontDefault();
96 | imGuiMenu::normalText = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\Verdana.ttf", 15.f);
97 | imGuiMenu::titleText = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\verdanab.ttf", 16.f);
98 | imGuiMenu::subTitleText = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\verdanab.ttf", 15.f);
99 | imGuiMenu::highlightText = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\verdanai.ttf", 13.f);
100 | imGuiMenu::espNameText = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\verdanab.ttf", 15.f);
101 | imGuiMenu::weaponIcons = io.Fonts->AddFontFromFileTTF(DexterionSystem::weaponIconsTTF.c_str(), 20.f);
102 |
103 | ImGui::StyleColorsDark();
104 |
105 | ImGui_ImplWin32_Init(window);
106 | ImGui_ImplDX11_Init(device, deviceContext);
107 |
108 | Logger::success("[overlay.cpp] Overlay Drew Succesfully!");
109 | }
110 |
111 | bool overlayESP::menutoggle = true;
112 |
113 | bool overlayESP::isMenuOpen() {
114 | return menutoggle;
115 | }
116 |
117 | void overlayESP::renderLoop(MemoryManagement::moduleData client) {
118 | bool state = true;
119 | bool check = false;
120 |
121 | ShowWindow(GetConsoleWindow(), miscConf.consoleVisible ? SW_RESTORE : SW_HIDE);
122 | SetWindowDisplayAffinity(GetForegroundWindow(), miscConf.obsBypass ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE);
123 |
124 | while (state) {
125 | if (GetAsyncKeyState(VK_INSERT) & 1)
126 | menutoggle = !menutoggle;
127 |
128 | MSG msg;
129 | while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
130 | TranslateMessage(&msg);
131 | DispatchMessage(&msg);
132 |
133 | if (msg.message == WM_QUIT) {
134 | state = false;
135 | }
136 |
137 | if (!state) {
138 | break;
139 | }
140 | }
141 |
142 | if (GetAsyncKeyState(VK_END)) {
143 | this->destroyWindow();
144 | exit(0);
145 | }
146 |
147 | ImGui_ImplDX11_NewFrame();
148 | ImGui_ImplWin32_NewFrame();
149 | ImGui::NewFrame();
150 |
151 | mainLoop(state, client);
152 |
153 | if (menutoggle) {
154 | imGuiMenu::renderMenu(state);
155 | SetWindowLong(window, GWL_EXSTYLE, WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TOOLWINDOW);
156 | }
157 | else {
158 | SetWindowLong(window, GWL_EXSTYLE, WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED | WS_EX_TOOLWINDOW);
159 | }
160 |
161 | ImGui::EndFrame();
162 | ImGui::Render();
163 |
164 | float color[4]{ 0.f,0.f ,0.f ,0.f };
165 | deviceContext->OMSetRenderTargets(1, &renderTargetView, 0);
166 | deviceContext->ClearRenderTargetView(renderTargetView, color);
167 | ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
168 |
169 | loadedSwapChain->Present(1, 0);
170 |
171 | if (!check) {
172 | check = !check;
173 | Logger::success("[overlay.cpp] Overlay drew succesfully! Cheat loaded.");
174 | }
175 |
176 | std::this_thread::sleep_for(std::chrono::milliseconds(1 / 100));
177 | }
178 | }
179 |
180 | void overlayESP::destroyWindow() {
181 | ImGui_ImplDX11_Shutdown();
182 | ImGui_ImplWin32_Shutdown();
183 | ImGui::DestroyContext();
184 |
185 | if (loadedSwapChain) {
186 | loadedSwapChain->Release();
187 | }
188 | if (deviceContext) {
189 | deviceContext->Release();
190 | }
191 | if (device) {
192 | device->Release();
193 | }
194 | if (renderTargetView) {
195 | renderTargetView->Release();
196 | }
197 |
198 | DestroyWindow(window);
199 | UnregisterClassW(windowClass.lpszClassName, windowClass.hInstance);
200 | }
201 |
--------------------------------------------------------------------------------
/gui/overlay.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define WIN32_LEAN_AND_MEAN
4 |
5 | #include
6 | #include
7 | #include
8 |
9 | #include "../imgui/imgui.h"
10 | #include "../imgui/imgui_impl_dx11.h"
11 | #include "../imgui/imgui_impl_win32.h"
12 |
13 | #include "../util/MemMan.hpp"
14 |
15 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
16 |
17 | class overlayESP {
18 | public:
19 |
20 | HINSTANCE hInstance;
21 | WNDCLASSEXW windowClass;
22 | HWND window;
23 |
24 | DXGI_SWAP_CHAIN_DESC swapChain{};
25 | D3D_FEATURE_LEVEL featureLevels[2]{
26 | D3D_FEATURE_LEVEL_11_0,
27 | D3D_FEATURE_LEVEL_10_0
28 | };
29 | ID3D11Device* device{ 0 };
30 | ID3D11DeviceContext* deviceContext{ 0 };
31 | IDXGISwapChain* loadedSwapChain{ 0 };
32 | ID3D11RenderTargetView* renderTargetView{ 0 };
33 | D3D_FEATURE_LEVEL loadedLevel{};
34 | ID3D11Texture2D* backBuffer{ 0 };
35 |
36 | static bool menutoggle;
37 | static bool isMenuOpen();
38 | WNDCLASSEXW createWindowClass(HINSTANCE hInstance, WNDPROC Wndproc, LPCWSTR windowname);
39 |
40 | HWND createWindow(int horizontalSize, int verticallSize);
41 |
42 | void makeFrameIntoClientArea();
43 |
44 | void makeDeviceAndSwapChain();
45 |
46 | void initWindow(int nShowCmd);
47 |
48 | void renderLoop(MemoryManagement::moduleData client);
49 |
50 | void destroyWindow();
51 | };
52 |
--------------------------------------------------------------------------------
/imgui/imconfig.h:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------------
2 | // DEAR IMGUI COMPILE-TIME OPTIONS
3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
5 | //-----------------------------------------------------------------------------
6 | // A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
7 | // B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
8 | //-----------------------------------------------------------------------------
9 | // You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
10 | // files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
12 | // Call IMGUI_CHECKVERSION() from your .cpp file to verify that the data structures your files are using are matching the ones imgui.cpp is using.
13 | //-----------------------------------------------------------------------------
14 |
15 | #pragma once
16 |
17 | //---- Define assertion handler. Defaults to calling assert().
18 | // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
21 |
22 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
23 | // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
24 | // - Windows DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
25 | // for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
26 | //#define IMGUI_API __declspec(dllexport) // MSVC Windows: DLL export
27 | //#define IMGUI_API __declspec(dllimport) // MSVC Windows: DLL import
28 | //#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
29 |
30 | //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
31 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
32 | //#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
33 |
34 | //---- Disable all of Dear ImGui or don't implement standard windows/tools.
35 | // It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
36 | //#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
37 | //#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
38 | //#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.
39 |
40 | //---- Don't implement some functions to reduce linkage requirements.
41 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
42 | //#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
43 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
44 | //#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
45 | //#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
46 | //#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default io.PlatformOpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
47 | //#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
48 | //#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
49 | //#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
50 | //#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
51 | //#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
52 | //#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
53 |
54 | //---- Enable Test Engine / Automation features.
55 | //#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_config.h", see Test Engine for details.
56 |
57 | //---- Include imgui_user.h at the end of imgui.h as a convenience
58 | // May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
59 | //#define IMGUI_INCLUDE_IMGUI_USER_H
60 | //#define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
61 |
62 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
63 | //#define IMGUI_USE_BGRA_PACKED_COLOR
64 |
65 | //---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
66 | //#define IMGUI_USE_WCHAR32
67 |
68 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
69 | // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
70 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
71 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
72 | //#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if IMGUI_USE_STB_SPRINTF is defined.
73 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
74 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
75 | //#define IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION // only disabled if IMGUI_USE_STB_SPRINTF is defined.
76 |
77 | //---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
78 | // Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
79 | //#define IMGUI_USE_STB_SPRINTF
80 |
81 | //---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
82 | // Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
83 | // On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
84 | //#define IMGUI_ENABLE_FREETYPE
85 |
86 | //---- Use FreeType+lunasvg library to render OpenType SVG fonts (SVGinOT)
87 | // Requires lunasvg headers to be available in the include path + program to be linked with the lunasvg library (not provided).
88 | // Only works in combination with IMGUI_ENABLE_FREETYPE.
89 | // (implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
90 | //#define IMGUI_ENABLE_FREETYPE_LUNASVG
91 |
92 | //---- Use stb_truetype to build and rasterize the font atlas (default)
93 | // The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
94 | //#define IMGUI_ENABLE_STB_TRUETYPE
95 |
96 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
97 | // This will be inlined as part of ImVec2 and ImVec4 class declarations.
98 | /*
99 | #define IM_VEC2_CLASS_EXTRA \
100 | constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \
101 | operator MyVec2() const { return MyVec2(x,y); }
102 |
103 | #define IM_VEC4_CLASS_EXTRA \
104 | constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
105 | operator MyVec4() const { return MyVec4(x,y,z,w); }
106 | */
107 | //---- ...Or use Dear ImGui's own very basic math operators.
108 | //#define IMGUI_DEFINE_MATH_OPERATORS
109 |
110 | //---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
111 | // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
112 | // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
113 | // Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
114 | //#define ImDrawIdx unsigned int
115 |
116 | //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
117 | //struct ImDrawList;
118 | //struct ImDrawCmd;
119 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
120 | //#define ImDrawCallback MyImDrawCallback
121 |
122 | //---- Debug Tools: Macro to break in Debugger (we provide a default implementation of this in the codebase)
123 | // (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
124 | //#define IM_DEBUG_BREAK IM_ASSERT(0)
125 | //#define IM_DEBUG_BREAK __debugbreak()
126 |
127 | //---- Debug Tools: Enable slower asserts
128 | //#define IMGUI_DEBUG_PARANOID
129 |
130 | //---- Tip: You can add extra functions within the ImGui:: namespace from anywhere (e.g. your own sources/header files)
131 | /*
132 | namespace ImGui
133 | {
134 | void MyFunction(const char* name, MyMatrix44* mtx);
135 | }
136 | */
137 |
--------------------------------------------------------------------------------
/imgui/imgui_impl_dx11.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Renderer Backend for DirectX11
2 | // This needs to be used along with a Platform Backend (e.g. Win32)
3 |
4 | // Implemented features:
5 | // [X] Renderer: User texture binding. Use 'ID3D11ShaderResourceView*' as ImTextureID. Read the FAQ about ImTextureID!
6 | // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
7 |
8 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
9 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
10 | // Learn about Dear ImGui:
11 | // - FAQ https://dearimgui.com/faq
12 | // - Getting Started https://dearimgui.com/getting-started
13 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
14 | // - Introduction, links and more at the top of imgui.cpp
15 |
16 | #pragma once
17 | #include "imgui.h" // IMGUI_IMPL_API
18 | #ifndef IMGUI_DISABLE
19 |
20 | struct ID3D11Device;
21 | struct ID3D11DeviceContext;
22 |
23 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context);
24 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown();
25 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame();
26 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data);
27 |
28 | // Use if you want to reset your rendering device without losing Dear ImGui state.
29 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects();
30 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects();
31 |
32 | #endif // #ifndef IMGUI_DISABLE
33 |
--------------------------------------------------------------------------------
/imgui/imgui_impl_win32.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Platform Backend for Windows (standard windows API for 32-bits AND 64-bits applications)
2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
3 |
4 | // Implemented features:
5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui)
6 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
10 |
11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
13 | // Learn about Dear ImGui:
14 | // - FAQ https://dearimgui.com/faq
15 | // - Getting Started https://dearimgui.com/getting-started
16 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
17 | // - Introduction, links and more at the top of imgui.cpp
18 |
19 | #pragma once
20 | #include "imgui.h" // IMGUI_IMPL_API
21 | #ifndef IMGUI_DISABLE
22 |
23 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd);
24 | IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd);
25 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown();
26 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame();
27 |
28 | // Win32 message handler your application need to call.
29 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper.
30 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it.
31 | // - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE.
32 |
33 | #if 0
34 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
35 | #endif
36 |
37 | // DPI-related helpers (optional)
38 | // - Use to enable DPI awareness without having to create an application manifest.
39 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps.
40 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc.
41 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime,
42 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies.
43 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness();
44 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd
45 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor
46 |
47 | // Transparency related helpers (optional) [experimental]
48 | // - Use to enable alpha compositing transparency with the desktop.
49 | // - Use together with e.g. clearing your framebuffer with zero-alpha.
50 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd
51 |
52 | #endif // #ifndef IMGUI_DISABLE
53 |
--------------------------------------------------------------------------------
/imgui/imstb_rectpack.h:
--------------------------------------------------------------------------------
1 | // [DEAR IMGUI]
2 | // This is a slightly modified version of stb_rect_pack.h 1.01.
3 | // Grep for [DEAR IMGUI] to find the changes.
4 | //
5 | // stb_rect_pack.h - v1.01 - public domain - rectangle packing
6 | // Sean Barrett 2014
7 | //
8 | // Useful for e.g. packing rectangular textures into an atlas.
9 | // Does not do rotation.
10 | //
11 | // Before #including,
12 | //
13 | // #define STB_RECT_PACK_IMPLEMENTATION
14 | //
15 | // in the file that you want to have the implementation.
16 | //
17 | // Not necessarily the awesomest packing method, but better than
18 | // the totally naive one in stb_truetype (which is primarily what
19 | // this is meant to replace).
20 | //
21 | // Has only had a few tests run, may have issues.
22 | //
23 | // More docs to come.
24 | //
25 | // No memory allocations; uses qsort() and assert() from stdlib.
26 | // Can override those by defining STBRP_SORT and STBRP_ASSERT.
27 | //
28 | // This library currently uses the Skyline Bottom-Left algorithm.
29 | //
30 | // Please note: better rectangle packers are welcome! Please
31 | // implement them to the same API, but with a different init
32 | // function.
33 | //
34 | // Credits
35 | //
36 | // Library
37 | // Sean Barrett
38 | // Minor features
39 | // Martins Mozeiko
40 | // github:IntellectualKitty
41 | //
42 | // Bugfixes / warning fixes
43 | // Jeremy Jaussaud
44 | // Fabian Giesen
45 | //
46 | // Version history:
47 | //
48 | // 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section
49 | // 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
50 | // 0.99 (2019-02-07) warning fixes
51 | // 0.11 (2017-03-03) return packing success/fail result
52 | // 0.10 (2016-10-25) remove cast-away-const to avoid warnings
53 | // 0.09 (2016-08-27) fix compiler warnings
54 | // 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
55 | // 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
56 | // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
57 | // 0.05: added STBRP_ASSERT to allow replacing assert
58 | // 0.04: fixed minor bug in STBRP_LARGE_RECTS support
59 | // 0.01: initial release
60 | //
61 | // LICENSE
62 | //
63 | // See end of file for license information.
64 |
65 | //////////////////////////////////////////////////////////////////////////////
66 | //
67 | // INCLUDE SECTION
68 | //
69 |
70 | #ifndef STB_INCLUDE_STB_RECT_PACK_H
71 | #define STB_INCLUDE_STB_RECT_PACK_H
72 |
73 | #define STB_RECT_PACK_VERSION 1
74 |
75 | #ifdef STBRP_STATIC
76 | #define STBRP_DEF static
77 | #else
78 | #define STBRP_DEF extern
79 | #endif
80 |
81 | #ifdef __cplusplus
82 | extern "C" {
83 | #endif
84 |
85 | typedef struct stbrp_context stbrp_context;
86 | typedef struct stbrp_node stbrp_node;
87 | typedef struct stbrp_rect stbrp_rect;
88 |
89 | typedef int stbrp_coord;
90 |
91 | #define STBRP__MAXVAL 0x7fffffff
92 | // Mostly for internal use, but this is the maximum supported coordinate value.
93 |
94 | STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
95 | // Assign packed locations to rectangles. The rectangles are of type
96 | // 'stbrp_rect' defined below, stored in the array 'rects', and there
97 | // are 'num_rects' many of them.
98 | //
99 | // Rectangles which are successfully packed have the 'was_packed' flag
100 | // set to a non-zero value and 'x' and 'y' store the minimum location
101 | // on each axis (i.e. bottom-left in cartesian coordinates, top-left
102 | // if you imagine y increasing downwards). Rectangles which do not fit
103 | // have the 'was_packed' flag set to 0.
104 | //
105 | // You should not try to access the 'rects' array from another thread
106 | // while this function is running, as the function temporarily reorders
107 | // the array while it executes.
108 | //
109 | // To pack into another rectangle, you need to call stbrp_init_target
110 | // again. To continue packing into the same rectangle, you can call
111 | // this function again. Calling this multiple times with multiple rect
112 | // arrays will probably produce worse packing results than calling it
113 | // a single time with the full rectangle array, but the option is
114 | // available.
115 | //
116 | // The function returns 1 if all of the rectangles were successfully
117 | // packed and 0 otherwise.
118 |
119 | struct stbrp_rect
120 | {
121 | // reserved for your use:
122 | int id;
123 |
124 | // input:
125 | stbrp_coord w, h;
126 |
127 | // output:
128 | stbrp_coord x, y;
129 | int was_packed; // non-zero if valid packing
130 |
131 | }; // 16 bytes, nominally
132 |
133 |
134 | STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
135 | // Initialize a rectangle packer to:
136 | // pack a rectangle that is 'width' by 'height' in dimensions
137 | // using temporary storage provided by the array 'nodes', which is 'num_nodes' long
138 | //
139 | // You must call this function every time you start packing into a new target.
140 | //
141 | // There is no "shutdown" function. The 'nodes' memory must stay valid for
142 | // the following stbrp_pack_rects() call (or calls), but can be freed after
143 | // the call (or calls) finish.
144 | //
145 | // Note: to guarantee best results, either:
146 | // 1. make sure 'num_nodes' >= 'width'
147 | // or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
148 | //
149 | // If you don't do either of the above things, widths will be quantized to multiples
150 | // of small integers to guarantee the algorithm doesn't run out of temporary storage.
151 | //
152 | // If you do #2, then the non-quantized algorithm will be used, but the algorithm
153 | // may run out of temporary storage and be unable to pack some rectangles.
154 |
155 | STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
156 | // Optionally call this function after init but before doing any packing to
157 | // change the handling of the out-of-temp-memory scenario, described above.
158 | // If you call init again, this will be reset to the default (false).
159 |
160 |
161 | STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
162 | // Optionally select which packing heuristic the library should use. Different
163 | // heuristics will produce better/worse results for different data sets.
164 | // If you call init again, this will be reset to the default.
165 |
166 | enum
167 | {
168 | STBRP_HEURISTIC_Skyline_default=0,
169 | STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
170 | STBRP_HEURISTIC_Skyline_BF_sortHeight
171 | };
172 |
173 |
174 | //////////////////////////////////////////////////////////////////////////////
175 | //
176 | // the details of the following structures don't matter to you, but they must
177 | // be visible so you can handle the memory allocations for them
178 |
179 | struct stbrp_node
180 | {
181 | stbrp_coord x,y;
182 | stbrp_node *next;
183 | };
184 |
185 | struct stbrp_context
186 | {
187 | int width;
188 | int height;
189 | int align;
190 | int init_mode;
191 | int heuristic;
192 | int num_nodes;
193 | stbrp_node *active_head;
194 | stbrp_node *free_head;
195 | stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
196 | };
197 |
198 | #ifdef __cplusplus
199 | }
200 | #endif
201 |
202 | #endif
203 |
204 | //////////////////////////////////////////////////////////////////////////////
205 | //
206 | // IMPLEMENTATION SECTION
207 | //
208 |
209 | #ifdef STB_RECT_PACK_IMPLEMENTATION
210 | #ifndef STBRP_SORT
211 | #include
212 | #define STBRP_SORT qsort
213 | #endif
214 |
215 | #ifndef STBRP_ASSERT
216 | #include
217 | #define STBRP_ASSERT assert
218 | #endif
219 |
220 | #ifdef _MSC_VER
221 | #define STBRP__NOTUSED(v) (void)(v)
222 | #define STBRP__CDECL __cdecl
223 | #else
224 | #define STBRP__NOTUSED(v) (void)sizeof(v)
225 | #define STBRP__CDECL
226 | #endif
227 |
228 | enum
229 | {
230 | STBRP__INIT_skyline = 1
231 | };
232 |
233 | STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
234 | {
235 | switch (context->init_mode) {
236 | case STBRP__INIT_skyline:
237 | STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
238 | context->heuristic = heuristic;
239 | break;
240 | default:
241 | STBRP_ASSERT(0);
242 | }
243 | }
244 |
245 | STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
246 | {
247 | if (allow_out_of_mem)
248 | // if it's ok to run out of memory, then don't bother aligning them;
249 | // this gives better packing, but may fail due to OOM (even though
250 | // the rectangles easily fit). @TODO a smarter approach would be to only
251 | // quantize once we've hit OOM, then we could get rid of this parameter.
252 | context->align = 1;
253 | else {
254 | // if it's not ok to run out of memory, then quantize the widths
255 | // so that num_nodes is always enough nodes.
256 | //
257 | // I.e. num_nodes * align >= width
258 | // align >= width / num_nodes
259 | // align = ceil(width/num_nodes)
260 |
261 | context->align = (context->width + context->num_nodes-1) / context->num_nodes;
262 | }
263 | }
264 |
265 | STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
266 | {
267 | int i;
268 |
269 | for (i=0; i < num_nodes-1; ++i)
270 | nodes[i].next = &nodes[i+1];
271 | nodes[i].next = NULL;
272 | context->init_mode = STBRP__INIT_skyline;
273 | context->heuristic = STBRP_HEURISTIC_Skyline_default;
274 | context->free_head = &nodes[0];
275 | context->active_head = &context->extra[0];
276 | context->width = width;
277 | context->height = height;
278 | context->num_nodes = num_nodes;
279 | stbrp_setup_allow_out_of_mem(context, 0);
280 |
281 | // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
282 | context->extra[0].x = 0;
283 | context->extra[0].y = 0;
284 | context->extra[0].next = &context->extra[1];
285 | context->extra[1].x = (stbrp_coord) width;
286 | context->extra[1].y = (1<<30);
287 | context->extra[1].next = NULL;
288 | }
289 |
290 | // find minimum y position if it starts at x1
291 | static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
292 | {
293 | stbrp_node *node = first;
294 | int x1 = x0 + width;
295 | int min_y, visited_width, waste_area;
296 |
297 | STBRP__NOTUSED(c);
298 |
299 | STBRP_ASSERT(first->x <= x0);
300 |
301 | #if 0
302 | // skip in case we're past the node
303 | while (node->next->x <= x0)
304 | ++node;
305 | #else
306 | STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
307 | #endif
308 |
309 | STBRP_ASSERT(node->x <= x0);
310 |
311 | min_y = 0;
312 | waste_area = 0;
313 | visited_width = 0;
314 | while (node->x < x1) {
315 | if (node->y > min_y) {
316 | // raise min_y higher.
317 | // we've accounted for all waste up to min_y,
318 | // but we'll now add more waste for everything we've visted
319 | waste_area += visited_width * (node->y - min_y);
320 | min_y = node->y;
321 | // the first time through, visited_width might be reduced
322 | if (node->x < x0)
323 | visited_width += node->next->x - x0;
324 | else
325 | visited_width += node->next->x - node->x;
326 | } else {
327 | // add waste area
328 | int under_width = node->next->x - node->x;
329 | if (under_width + visited_width > width)
330 | under_width = width - visited_width;
331 | waste_area += under_width * (min_y - node->y);
332 | visited_width += under_width;
333 | }
334 | node = node->next;
335 | }
336 |
337 | *pwaste = waste_area;
338 | return min_y;
339 | }
340 |
341 | typedef struct
342 | {
343 | int x,y;
344 | stbrp_node **prev_link;
345 | } stbrp__findresult;
346 |
347 | static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
348 | {
349 | int best_waste = (1<<30), best_x, best_y = (1 << 30);
350 | stbrp__findresult fr;
351 | stbrp_node **prev, *node, *tail, **best = NULL;
352 |
353 | // align to multiple of c->align
354 | width = (width + c->align - 1);
355 | width -= width % c->align;
356 | STBRP_ASSERT(width % c->align == 0);
357 |
358 | // if it can't possibly fit, bail immediately
359 | if (width > c->width || height > c->height) {
360 | fr.prev_link = NULL;
361 | fr.x = fr.y = 0;
362 | return fr;
363 | }
364 |
365 | node = c->active_head;
366 | prev = &c->active_head;
367 | while (node->x + width <= c->width) {
368 | int y,waste;
369 | y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
370 | if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
371 | // bottom left
372 | if (y < best_y) {
373 | best_y = y;
374 | best = prev;
375 | }
376 | } else {
377 | // best-fit
378 | if (y + height <= c->height) {
379 | // can only use it if it first vertically
380 | if (y < best_y || (y == best_y && waste < best_waste)) {
381 | best_y = y;
382 | best_waste = waste;
383 | best = prev;
384 | }
385 | }
386 | }
387 | prev = &node->next;
388 | node = node->next;
389 | }
390 |
391 | best_x = (best == NULL) ? 0 : (*best)->x;
392 |
393 | // if doing best-fit (BF), we also have to try aligning right edge to each node position
394 | //
395 | // e.g, if fitting
396 | //
397 | // ____________________
398 | // |____________________|
399 | //
400 | // into
401 | //
402 | // | |
403 | // | ____________|
404 | // |____________|
405 | //
406 | // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
407 | //
408 | // This makes BF take about 2x the time
409 |
410 | if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
411 | tail = c->active_head;
412 | node = c->active_head;
413 | prev = &c->active_head;
414 | // find first node that's admissible
415 | while (tail->x < width)
416 | tail = tail->next;
417 | while (tail) {
418 | int xpos = tail->x - width;
419 | int y,waste;
420 | STBRP_ASSERT(xpos >= 0);
421 | // find the left position that matches this
422 | while (node->next->x <= xpos) {
423 | prev = &node->next;
424 | node = node->next;
425 | }
426 | STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
427 | y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
428 | if (y + height <= c->height) {
429 | if (y <= best_y) {
430 | if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
431 | best_x = xpos;
432 | //STBRP_ASSERT(y <= best_y); [DEAR IMGUI]
433 | best_y = y;
434 | best_waste = waste;
435 | best = prev;
436 | }
437 | }
438 | }
439 | tail = tail->next;
440 | }
441 | }
442 |
443 | fr.prev_link = best;
444 | fr.x = best_x;
445 | fr.y = best_y;
446 | return fr;
447 | }
448 |
449 | static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
450 | {
451 | // find best position according to heuristic
452 | stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
453 | stbrp_node *node, *cur;
454 |
455 | // bail if:
456 | // 1. it failed
457 | // 2. the best node doesn't fit (we don't always check this)
458 | // 3. we're out of memory
459 | if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
460 | res.prev_link = NULL;
461 | return res;
462 | }
463 |
464 | // on success, create new node
465 | node = context->free_head;
466 | node->x = (stbrp_coord) res.x;
467 | node->y = (stbrp_coord) (res.y + height);
468 |
469 | context->free_head = node->next;
470 |
471 | // insert the new node into the right starting point, and
472 | // let 'cur' point to the remaining nodes needing to be
473 | // stiched back in
474 |
475 | cur = *res.prev_link;
476 | if (cur->x < res.x) {
477 | // preserve the existing one, so start testing with the next one
478 | stbrp_node *next = cur->next;
479 | cur->next = node;
480 | cur = next;
481 | } else {
482 | *res.prev_link = node;
483 | }
484 |
485 | // from here, traverse cur and free the nodes, until we get to one
486 | // that shouldn't be freed
487 | while (cur->next && cur->next->x <= res.x + width) {
488 | stbrp_node *next = cur->next;
489 | // move the current node to the free list
490 | cur->next = context->free_head;
491 | context->free_head = cur;
492 | cur = next;
493 | }
494 |
495 | // stitch the list back in
496 | node->next = cur;
497 |
498 | if (cur->x < res.x + width)
499 | cur->x = (stbrp_coord) (res.x + width);
500 |
501 | #ifdef _DEBUG
502 | cur = context->active_head;
503 | while (cur->x < context->width) {
504 | STBRP_ASSERT(cur->x < cur->next->x);
505 | cur = cur->next;
506 | }
507 | STBRP_ASSERT(cur->next == NULL);
508 |
509 | {
510 | int count=0;
511 | cur = context->active_head;
512 | while (cur) {
513 | cur = cur->next;
514 | ++count;
515 | }
516 | cur = context->free_head;
517 | while (cur) {
518 | cur = cur->next;
519 | ++count;
520 | }
521 | STBRP_ASSERT(count == context->num_nodes+2);
522 | }
523 | #endif
524 |
525 | return res;
526 | }
527 |
528 | static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
529 | {
530 | const stbrp_rect *p = (const stbrp_rect *) a;
531 | const stbrp_rect *q = (const stbrp_rect *) b;
532 | if (p->h > q->h)
533 | return -1;
534 | if (p->h < q->h)
535 | return 1;
536 | return (p->w > q->w) ? -1 : (p->w < q->w);
537 | }
538 |
539 | static int STBRP__CDECL rect_original_order(const void *a, const void *b)
540 | {
541 | const stbrp_rect *p = (const stbrp_rect *) a;
542 | const stbrp_rect *q = (const stbrp_rect *) b;
543 | return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
544 | }
545 |
546 | STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
547 | {
548 | int i, all_rects_packed = 1;
549 |
550 | // we use the 'was_packed' field internally to allow sorting/unsorting
551 | for (i=0; i < num_rects; ++i) {
552 | rects[i].was_packed = i;
553 | }
554 |
555 | // sort according to heuristic
556 | STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
557 |
558 | for (i=0; i < num_rects; ++i) {
559 | if (rects[i].w == 0 || rects[i].h == 0) {
560 | rects[i].x = rects[i].y = 0; // empty rect needs no space
561 | } else {
562 | stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
563 | if (fr.prev_link) {
564 | rects[i].x = (stbrp_coord) fr.x;
565 | rects[i].y = (stbrp_coord) fr.y;
566 | } else {
567 | rects[i].x = rects[i].y = STBRP__MAXVAL;
568 | }
569 | }
570 | }
571 |
572 | // unsort
573 | STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
574 |
575 | // set was_packed flags and all_rects_packed status
576 | for (i=0; i < num_rects; ++i) {
577 | rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
578 | if (!rects[i].was_packed)
579 | all_rects_packed = 0;
580 | }
581 |
582 | // return the all_rects_packed status
583 | return all_rects_packed;
584 | }
585 | #endif
586 |
587 | /*
588 | ------------------------------------------------------------------------------
589 | This software is available under 2 licenses -- choose whichever you prefer.
590 | ------------------------------------------------------------------------------
591 | ALTERNATIVE A - MIT License
592 | Copyright (c) 2017 Sean Barrett
593 | Permission is hereby granted, free of charge, to any person obtaining a copy of
594 | this software and associated documentation files (the "Software"), to deal in
595 | the Software without restriction, including without limitation the rights to
596 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
597 | of the Software, and to permit persons to whom the Software is furnished to do
598 | so, subject to the following conditions:
599 | The above copyright notice and this permission notice shall be included in all
600 | copies or substantial portions of the Software.
601 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
602 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
603 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
604 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
605 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
606 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
607 | SOFTWARE.
608 | ------------------------------------------------------------------------------
609 | ALTERNATIVE B - Public Domain (www.unlicense.org)
610 | This is free and unencumbered software released into the public domain.
611 | Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
612 | software, either in source code form or as a compiled binary, for any purpose,
613 | commercial or non-commercial, and by any means.
614 | In jurisdictions that recognize copyright laws, the author or authors of this
615 | software dedicate any and all copyright interest in the software to the public
616 | domain. We make this dedication for the benefit of the public at large and to
617 | the detriment of our heirs and successors. We intend this dedication to be an
618 | overt act of relinquishment in perpetuity of all present and future rights to
619 | this software under copyright law.
620 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
621 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
622 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
623 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
624 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
625 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
626 | ------------------------------------------------------------------------------
627 | */
628 |
--------------------------------------------------------------------------------
/imgui/render.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "imgui.h"
3 |
4 | inline namespace Render {
5 | inline void DrawRect(int x, int y, int w, int h, ImColor color, int thick) {
6 | ImGui::GetBackgroundDrawList()->AddRect(ImVec2(x, y), ImVec2(x + w, y + h), color, 0, 0, thick);
7 | }
8 |
9 | inline void Line(float x1, float y1, float x2, float y2, ImColor color, float thick) {
10 | ImGui::GetBackgroundDrawList()->AddLine(ImVec2(x1, y1), ImVec2(x2, y2), color, thick);
11 | }
12 |
13 | inline void DrawGradientLine(ImVec2 start, ImVec2 end, ImColor start_color, ImColor end_color, float thickness) {
14 | ImGui::GetBackgroundDrawList()->AddRectFilledMultiColor(ImVec2(start.x, start.y + thickness), ImVec2(end.x, start.y), start_color, start_color, start_color, start_color);
15 | ImGui::GetBackgroundDrawList()->AddRectFilledMultiColor(ImVec2(start.x - thickness, start.y), ImVec2(start.x, end.y), start_color, start_color, end_color, end_color);
16 | ImGui::GetBackgroundDrawList()->AddRectFilledMultiColor(ImVec2(end.x - thickness, start.y), ImVec2(end.x, end.y), start_color, start_color, end_color, end_color);
17 | ImGui::GetBackgroundDrawList()->AddRectFilledMultiColor(ImVec2(end.x, end.y + thickness), ImVec2(start.x, end.y), end_color, end_color, end_color, end_color);
18 | }
19 |
20 | inline void DrawText(ImVec2 pos, ImColor color, const char* text) {
21 | ImGui::GetBackgroundDrawList()->AddText(pos, (ImU32)color, text);
22 | }
23 | }
--------------------------------------------------------------------------------
/json/jsonOps.cpp:
--------------------------------------------------------------------------------
1 | #include "jsonOps.hpp"
2 |
3 | nlohmann::json json::readFromJsonFile(std::wstring path, std::wstring fileName) {
4 | nlohmann::json fileContent;
5 | try {
6 | std::wstring currentPath;
7 | std::wstring Directory = path;
8 | Directory = Directory + L"\\";
9 | currentPath = Directory.append(fileName);
10 |
11 | std::ifstream f(currentPath);
12 | fileContent = nlohmann::json::parse(f);
13 |
14 | f.close();
15 | }
16 | catch (nlohmann::json::parse_error& ex) {
17 | return 0;
18 | }
19 | catch (nlohmann::json::type_error& ex) {
20 | return 0;
21 | }
22 | return fileContent;
23 | }
24 |
--------------------------------------------------------------------------------
/json/jsonOps.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "json.hpp"
6 | #include "../util/utilFunctions.hpp"
7 |
8 | namespace json {
9 | std::wstring clientDLLFile = L"\\client.dll.json";
10 | std::wstring offsetFile = L"\\offsets.json";
11 | std::wstring buttonsFile = L"\\buttons.json";
12 |
13 | nlohmann::json readFromJsonFile(std::wstring path, std::wstring fileName);
14 | }
15 |
--------------------------------------------------------------------------------
/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nocture-Insight/Dexterion/a91915d86014baf89f4e8a0b355385cdeff331fa/resource.h
--------------------------------------------------------------------------------
/updateoffsets.cmd:
--------------------------------------------------------------------------------
1 | curl https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/buttons.json > buttons.json
2 | curl https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/client_dll.json > client.dll.json
3 | curl https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.json > offsets.json
--------------------------------------------------------------------------------
/util/DiscordVerify.hpp:
--------------------------------------------------------------------------------
1 | #include "utilFunctions.hpp"
2 | #include "HTTPRequest.hpp"
3 | #include
4 | #include
5 |
6 | #pragma comment(lib, "WS2_32.lib")
7 |
8 | size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
9 | ((std::string*)userp)->append((char*)contents, size * nmemb);
10 | return size * nmemb;
11 | }
12 |
13 | namespace DiscordVerify {
14 | std::string getToken(uint64_t steamId) {
15 | std::string serverUrl = "http://spain2.firecloudllc.info:36570/getToken";
16 | std::string userData = std::format("HWID={}&SteamId={}&Timezone={}", utils::get_hwid(), steamId, std::chrono::system_clock::now().time_since_epoch().count());
17 |
18 | std::string tokenString;
19 | try
20 | {
21 | http::Request request{ serverUrl };
22 | const auto response = request.send("POST", userData, {
23 | {"Content-Type", "application/x-www-form-urlencoded"}
24 | });
25 | tokenString = std::string{ response.body.begin(), response.body.end() };
26 |
27 | std::cout << tokenString << std::endl;
28 |
29 | nlohmann::json tokenJson = nlohmann::json::parse(tokenString);
30 |
31 | return tokenJson["token"];
32 | }
33 | catch (const std::exception& e)
34 | {
35 | Logger::error("[DiscordVerify.hpp] Request failed");
36 | return "Failed to parse token";
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/util/MemMan.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma warning (disable : 6001 )
3 | #pragma warning (disable : 4244 )
4 |
5 | #define WIN32_LEAN_AND_MEAN
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 |
17 | class MemoryManagement {
18 | public:
19 | HANDLE proc;
20 |
21 | struct moduleData {
22 | HMODULE module;
23 | DWORD_PTR base;
24 | uintptr_t size;
25 | };
26 |
27 |
28 | template
29 | T ReadMem(uintptr_t addr)
30 | {
31 | T x;
32 | ReadProcessMemory(proc, (LPBYTE*)addr, &x, sizeof(x), NULL);
33 | return x;
34 | }
35 |
36 | bool ReadRawMem(uintptr_t addr, void* buffer, size_t size)
37 | {
38 | SIZE_T bytesRead;
39 | if (ReadProcessMemory(proc, reinterpret_cast(addr), buffer, size, &bytesRead))
40 | {
41 | return bytesRead == size;
42 | }
43 | return false;
44 | }
45 |
46 |
47 | HANDLE getProcess(const wchar_t* name) {
48 | HANDLE processID = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
49 | uintptr_t process;
50 | PROCESSENTRY32W processEntry;
51 | processEntry.dwSize = sizeof(processEntry);
52 |
53 | do {
54 | if (!_wcsicmp(processEntry.szExeFile, name)) {
55 | process = processEntry.th32ProcessID;
56 | proc = OpenProcess(PROCESS_ALL_ACCESS, false, process);
57 | }
58 | } while (Process32NextW(processID, &processEntry));
59 |
60 | CloseHandle(processID);
61 |
62 | return proc;
63 | };
64 |
65 |
66 | uintptr_t getPid(const wchar_t* name) {
67 | HANDLE processID = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
68 | uintptr_t process;
69 | PROCESSENTRY32W processEntry;
70 | processEntry.dwSize = sizeof(processEntry);
71 |
72 | do {
73 | if (!_wcsicmp(processEntry.szExeFile, name)) {
74 | process = processEntry.th32ProcessID;
75 | proc = OpenProcess(PROCESS_ALL_ACCESS, false, process);
76 | }
77 | } while (Process32NextW(processID, &processEntry));
78 |
79 | CloseHandle(processID);
80 |
81 | return process;
82 | }
83 |
84 |
85 | HMODULE getModule(uintptr_t pid, const wchar_t* name) {
86 | HANDLE module = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
87 | MODULEENTRY32W moduleEntry;
88 | moduleEntry.dwSize = sizeof(moduleEntry);
89 |
90 | do {
91 | if (!_wcsicmp(moduleEntry.szModule, name)) {
92 | CloseHandle(module);
93 | return moduleEntry.hModule;
94 | }
95 | } while (Module32NextW(module, &moduleEntry));
96 |
97 | return 0;
98 | }
99 |
100 |
101 | DWORD_PTR getModuleBase(DWORD pid, const char* name) {
102 | DWORD_PTR dwBase = 0;
103 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
104 | MODULEENTRY32 ModuleEntry32;
105 | ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
106 |
107 | if (Module32First(hSnapshot, &ModuleEntry32)) {
108 | do {
109 | if (_tcsicmp(ModuleEntry32.szModule, name) == 0) {
110 | dwBase = (DWORD_PTR)ModuleEntry32.modBaseAddr;
111 | }
112 | } while (Module32Next(hSnapshot, &ModuleEntry32));
113 | };
114 |
115 | return dwBase;
116 | }
117 |
118 |
119 | DWORD getModuleSize(DWORD pid, LPCTSTR name) {
120 | DWORD dwSize = 0;
121 |
122 | do {
123 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid);
124 | if (hSnapshot == INVALID_HANDLE_VALUE) { continue; }
125 |
126 | MODULEENTRY32 ModuleEntry32;
127 | ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
128 |
129 | if (Module32First(hSnapshot, &ModuleEntry32)) {
130 | do {
131 | if (_tcsicmp(ModuleEntry32.szModule, name) == 0) {
132 | dwSize = ModuleEntry32.modBaseSize;
133 | break;
134 | }
135 | } while (Module32Next(hSnapshot, &ModuleEntry32));
136 | }
137 |
138 | CloseHandle(hSnapshot);
139 | } while (!dwSize);
140 |
141 | return dwSize;
142 | }
143 | };
144 |
--------------------------------------------------------------------------------
/util/Vectors.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma warning (disable: 4172)
3 |
4 |
5 | #define WIN32_LEAN_AND_MEAN
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 |
13 | struct view_matrix_t {
14 | float* operator[ ](int index) {
15 | return matrix[index];
16 | }
17 | float matrix[4][4];
18 | };
19 |
20 |
21 | struct Vector2 {
22 | float x, y;
23 | };
24 |
25 |
26 | struct Vector3 {
27 | constexpr Vector3(
28 | const float x = 0.f,
29 | const float y = 0.f,
30 | const float z = 0.f) noexcept :
31 | x(x), y(y), z(z) { }
32 |
33 | constexpr const Vector3& operator-(const Vector3& other) const noexcept
34 | {
35 | return Vector3{ x - other.x, y - other.y, z - other.z };
36 | }
37 |
38 | constexpr const Vector3& operator+(const Vector3& other) const noexcept
39 | {
40 | return Vector3{ x + other.x, y + other.y, z + other.z };
41 | }
42 |
43 | constexpr const Vector3& operator/(const float factor) const noexcept
44 | {
45 | return Vector3{ x / factor, y / factor, z / factor };
46 | }
47 |
48 | constexpr const Vector3& operator*(const float factor) const noexcept
49 | {
50 | return Vector3{ x * factor, y * factor, z * factor };
51 | }
52 |
53 | constexpr const Vector3& ToAngle() const noexcept
54 | {
55 | return Vector3{
56 | std::atan2(-z, std::hypot(x, y)) * (180.0f / std::numbers::pi_v),
57 | std::atan2(y, x) * (180.0f / std::numbers::pi_v),
58 | 0.0f
59 | };
60 | }
61 |
62 |
63 | Vector3 worldToScreen(view_matrix_t matrix) {
64 | float _x = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z + matrix[0][3];
65 | float _y = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z + matrix[1][3];
66 |
67 | float w = matrix[3][0] * x + matrix[3][1] * y + matrix[3][2] * z + matrix[3][3];
68 |
69 | float inv_w = 1.f / w;
70 | _x *= inv_w;
71 | _y *= inv_w;
72 |
73 | float screen_x = GetSystemMetrics(SM_CXSCREEN) * 0.5f;
74 | float screen_y = GetSystemMetrics(SM_CYSCREEN) * 0.5f;
75 |
76 | screen_x += 0.5f * _x * GetSystemMetrics(SM_CXSCREEN) + 0.5f;
77 | screen_y -= 0.5f * _y * GetSystemMetrics(SM_CYSCREEN) + 0.5f;
78 |
79 | return { screen_x, screen_y, w };
80 | }
81 |
82 | constexpr const bool IsZero() const noexcept
83 | {
84 | return x == 0.f && y == 0.f && z == 0.f;
85 | }
86 |
87 | float x, y, z;
88 | };
89 |
90 |
91 | inline constexpr Vector3 CalculateAngle(
92 | const Vector3& localPosition,
93 | const Vector3& enemyPosition,
94 | const Vector3& viewAngles) noexcept
95 | {
96 | return (enemyPosition - localPosition).ToAngle() - viewAngles;
97 | };
98 |
99 |
100 | inline Vector3 clampAngles(Vector3 angles) {
101 | if (angles.x > 89.0f && angles.x <= 180.0f){
102 | angles.x = 89.0f;
103 | }
104 |
105 | if (angles.x > 180.0f){
106 | angles.x -= 360.0f;
107 | }
108 |
109 | if (angles.x < -89.0f){
110 | angles.x = -89.0f;
111 | }
112 |
113 | if (angles.y > 180.0f){
114 | angles.y -= 360.0f;
115 | }
116 |
117 | if (angles.y < -180.0f){
118 | angles.y += 360.0f;
119 | }
120 | angles.z = 0;
121 |
122 | return angles;
123 | };
124 |
125 |
126 | inline Vector3 normalizeAngles(Vector3 angle) {
127 | while (angle.x > 180.f)
128 | angle.x -= 360.0f;
129 |
130 | while (angle.x < -180.0f)
131 | angle.x += 360.0f;
132 |
133 | while (angle.y > 180.0f)
134 | angle.y -= 360.0f;
135 |
136 | while (angle.y < -180.0f)
137 | angle.y += 360.0f;
138 |
139 | return angle;
140 | };
141 |
142 |
143 |
144 | inline Vector3 calculateBestAngle(Vector3 angle,Vector3 configFov) {
145 | Vector3 newAngle;
146 |
147 | float calcFov = std::hypot(angle.x+configFov.x, angle.y+configFov.y);
148 | float fov = configFov.z;
149 |
150 | if (calcFov < fov) {
151 | calcFov = fov;
152 | newAngle = angle;
153 | }
154 | return newAngle;
155 | }
--------------------------------------------------------------------------------
/util/attributes.cpp:
--------------------------------------------------------------------------------
1 | #include "attributes.hpp"
2 |
3 |
4 |
5 | bool clientDLL::load() {
6 | clientDLLOffsets = json::readFromJsonFile(utils::getExePath(), json::clientDLLFile);
7 |
8 | if (clientDLLOffsets == 0)
9 | return 0;
10 |
11 | clientDLLOffsets = clientDLLOffsets["client.dll"]["classes"];
12 |
13 | C_BaseEntity_ = clientDLLOffsets["C_BaseEntity"]["fields"];
14 | C_BaseModelEntity_ = clientDLLOffsets["C_BaseModelEntity"]["fields"];
15 | CCSPlayerController_ = clientDLLOffsets["CCSPlayerController"]["fields"];
16 | CBasePlayerController_ = clientDLLOffsets["CBasePlayerController"]["fields"];
17 | C_BasePlayerPawn_ = clientDLLOffsets["C_BasePlayerPawn"]["fields"];
18 | C_CSPlayerPawn_ = clientDLLOffsets["C_CSPlayerPawn"]["fields"];
19 | C_CSPlayerPawnBase_ = clientDLLOffsets["C_CSPlayerPawnBase"]["fields"];
20 | CBaseAnimGraph_ = clientDLLOffsets["CBaseAnimGraph"]["fields"];
21 | C_EconItemView_ = clientDLLOffsets["C_EconItemView"]["fields"];
22 | C_AttributeContainer_ = clientDLLOffsets["C_AttributeContainer"]["fields"];
23 | C_EconEntity_ = clientDLLOffsets["C_EconEntity"]["fields"];
24 | CSkeletonInstance_ = clientDLLOffsets["CSkeletonInstance"]["fields"];
25 | CGameSceneNode_ = clientDLLOffsets["CGameSceneNode"]["fields"];
26 | EntitySpottedState_t_ = clientDLLOffsets["EntitySpottedState_t"]["fields"];
27 | C_CSGameRules_ = clientDLLOffsets["C_CSGameRules"]["fields"];
28 | CCSWeaponBaseVData_ = clientDLLOffsets["CCSWeaponBaseVData"]["fields"];
29 | CCSPlayerBase_CameraServices_ = clientDLLOffsets["CCSPlayerBase_CameraServices"]["fields"];
30 | C_PlantedC4_ = clientDLLOffsets["C_PlantedC4"]["fields"];
31 |
32 | return 1;
33 | }
34 |
35 | bool offsets::load()
36 | {
37 | clientDLL = json::readFromJsonFile(utils::getExePath(), json::offsetFile);
38 |
39 | if (clientDLL == 0)
40 | return 0;
41 |
42 | clientDLL = clientDLL["client.dll"];
43 |
44 | return 1;
45 | }
46 |
47 | bool loadJson() {
48 | buttons = json::readFromJsonFile(utils::getExePath(), json::buttonsFile);
49 |
50 | if (buttons == 0)
51 | return 0;
52 |
53 | buttons = buttons["client.dll"];
54 |
55 | if (!offsets::load())
56 | return 0;
57 |
58 | if (!clientDLL::load())
59 | return 0;
60 |
61 | return 1;
62 | }
63 |
64 | uintptr_t CCSPlayerController::getListEntry() {
65 | listEntry = MemMan.ReadMem(entityList + (0x8 * (id & 0x7FFF) >> 9) + 0x10);
66 | return listEntry;
67 | }
68 |
69 | uintptr_t CCSPlayerController::getController() {
70 | value = MemMan.ReadMem(listEntry + 0x78 * (id & 0x1FF));
71 | return value;
72 | }
73 |
74 | int CCSPlayerController::getPawnHealth() {
75 | pawnHealth = MemMan.ReadMem(value + clientDLL::CCSPlayerController_["m_iPawnHealth"]);
76 | return pawnHealth;
77 | }
78 |
79 | bool CCSPlayerController::isAlive()
80 | {
81 | alive = MemMan.ReadMem(value + clientDLL::CCSPlayerController_["m_iPawnHealth"]) > 0 && MemMan.ReadMem(value + clientDLL::CCSPlayerController_["m_iPawnHealth"]) < 2000;
82 | return alive;
83 | }
84 |
85 | uintptr_t getAddressBase(uintptr_t entityList, uintptr_t playerPawn) {
86 | uintptr_t listEntrySecond = MemMan.ReadMem(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
87 | return listEntrySecond == 0
88 | ? 0
89 | : MemMan.ReadMem(listEntrySecond + 120 * (playerPawn & 0x1FF));
90 | }
91 |
92 | bool CCSPlayerController::isSpectating(bool localPlayer)
93 | {
94 | uintptr_t LocalPlayer = MemMan.ReadMem(baseAddy + offsets::clientDLL["dwLocalPlayerController"]);
95 | uintptr_t localPlayerPawn = MemMan.ReadMem(LocalPlayer + clientDLL::clientDLLOffsets["CBasePlayerController"]["fields"]["m_hPawn"]);
96 | uintptr_t list_entry2 = MemMan.ReadMem(entityList + 0x8 * ((localPlayerPawn & 0x7FFF) >> 9) + 16);
97 | if (!list_entry2)
98 | return false;
99 |
100 | const uintptr_t CSlocalPlayerPawn = MemMan.ReadMem(list_entry2 + 120 * (localPlayerPawn & 0x1FF));
101 |
102 | if (localPlayer)
103 | return this->getSpectating() == CSlocalPlayerPawn;
104 | return this->getSpectating() != 0;
105 | }
106 |
107 | uintptr_t CCSPlayerController::getSpectating()
108 | {
109 | uint32_t spectatorPawn = MemMan.ReadMem(value + clientDLL::clientDLLOffsets["CBasePlayerController"]["fields"]["m_hPawn"]);
110 | uintptr_t pawn = getAddressBase(entityList, spectatorPawn);
111 |
112 | uintptr_t obs = MemMan.ReadMem(pawn + clientDLL::clientDLLOffsets["C_BasePlayerPawn"]["fields"]["m_pObserverServices"]);
113 | uint64_t oTarget = MemMan.ReadMem(obs + clientDLL::clientDLLOffsets["CPlayer_ObserverServices"]["fields"]["m_hObserverTarget"]);
114 | uintptr_t handle = getAddressBase(entityList, oTarget);
115 |
116 | if (obs)
117 | return spectatorTarget = handle;
118 | return spectatorTarget = 0;
119 | }
120 |
121 | std::uint32_t CCSPlayerController::getC_CSPlayerPawn() {
122 | C_CSPlayerPawn_ = MemMan.ReadMem(value + clientDLL::CCSPlayerController_["m_hPlayerPawn"]);
123 | return C_CSPlayerPawn_;
124 | }
125 |
126 | uintptr_t CCSPlayerController::getPawnTeam() {
127 | pawnTeam = MemMan.ReadMem(value + clientDLL::C_BaseEntity_["m_iTeamNum"]);
128 | return pawnTeam;
129 | }
130 |
131 | std::string CCSPlayerController::getPawnName() {
132 | pawnNameAddress = MemMan.ReadMem(value + clientDLL::CCSPlayerController_["m_sSanitizedPlayerName"]);
133 | if (pawnNameAddress) {
134 | char buf[MAX_PATH] = {};
135 | MemMan.ReadRawMem(pawnNameAddress, buf, MAX_PATH);
136 | pawnName = std::string(buf);
137 | }
138 | else {
139 | pawnName = "Unknown";
140 | }
141 | return pawnName;
142 | }
143 |
144 |
145 |
146 | uintptr_t C_CSPlayerPawn::getListEntry() {
147 | listEntry = MemMan.ReadMem(entityList + 0x8 * ((value & 0x7FFF) >> 9) + 0x10);
148 | return listEntry;
149 | }
150 |
151 | uintptr_t C_CSPlayerPawn::getPlayerPawn() {
152 | playerPawn = MemMan.ReadMem(listEntry + 0x78 * (value & 0x1FF));
153 | return playerPawn;
154 | }
155 |
156 | uintptr_t C_CSPlayerPawn::getPlayerPawnByCrossHairID(int crossHairEntity) {
157 | uintptr_t crosshairEntityEntry = MemMan.ReadMem(entityList + 0x8 * (crossHairEntity >> 9) + 0x10);
158 | playerPawn = MemMan.ReadMem(crosshairEntityEntry + 0x78 * (crossHairEntity & 0x1FF));
159 | return playerPawn;
160 | }
161 |
162 | Vector3 C_CSPlayerPawn::getOrigin() {
163 | origin = MemMan.ReadMem(playerPawn + clientDLL::C_BasePlayerPawn_["m_vOldOrigin"]);
164 | return origin;
165 | }
166 |
167 | Vector3 C_CSPlayerPawn::getCameraPos() {
168 | cameraPos = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawnBase_["m_vecLastClipCameraPos"]);
169 | return cameraPos;
170 | }
171 |
172 | Vector3 C_CSPlayerPawn::getEyePos() {
173 | eyePos = MemMan.ReadMem(playerPawn + clientDLL::C_BasePlayerPawn_["m_vOldOrigin"]) +
174 | MemMan.ReadMem(playerPawn + clientDLL::C_BaseModelEntity_["m_vecViewOffset"]);
175 | return eyePos;
176 | }
177 |
178 | uintptr_t C_CSPlayerPawn::getCGameSceneNode() {
179 | CGameSceneNode = MemMan.ReadMem(playerPawn + clientDLL::C_BaseEntity_["m_pGameSceneNode"]);
180 | return CGameSceneNode;
181 | }
182 |
183 | Vector3 C_CSPlayerPawn::getViewAngles() {
184 | viewAngles = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawnBase_["m_angEyeAngles"]);
185 | return viewAngles;
186 | }
187 |
188 | Vector3 C_CSPlayerPawn::getPosition() {
189 | position = MemMan.ReadMem(playerPawn + clientDLL::CBaseAnimGraph_["m_vLastSlopeCheckPos"]);
190 | return position;
191 | }
192 |
193 | uint16_t C_CSPlayerPawn::getWeaponID() {
194 | C_CSWeaponBase = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawnBase_["m_pClippingWeapon"]);
195 | weaponID = MemMan.ReadMem(C_CSWeaponBase + clientDLL::C_EconItemView_["m_iItemDefinitionIndex"] + clientDLL::C_AttributeContainer_["m_Item"] + clientDLL::C_EconEntity_["m_AttributeManager"]);
196 | return weaponID;
197 | }
198 |
199 | std::string C_CSPlayerPawn::getWeaponName() {
200 | C_CSWeaponBase = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawnBase_["m_pClippingWeapon"]);
201 | uint64_t weaponData = MemMan.ReadMem(C_CSWeaponBase + clientDLL::C_BaseEntity_["m_nSubclassID"] + 0x8);
202 | uint64_t weaponNameAddress = MemMan.ReadMem(weaponData + clientDLL::CCSWeaponBaseVData_["m_szName"]);
203 |
204 | if (!weaponNameAddress) {
205 | weaponName = "NULL";
206 | }
207 | else {
208 | char buf[MAX_PATH] = {};
209 | MemMan.ReadRawMem(weaponNameAddress, buf, MAX_PATH);
210 | weaponName = std::string(buf);
211 | if (weaponName.compare(0, 7, "weapon_") == 0) {
212 | weaponName = weaponName.substr(7, weaponName.length());
213 | }
214 | }
215 | return weaponName;
216 | }
217 |
218 | int C_CSPlayerPawn::getPawnHealth() {
219 | pawnHealth = MemMan.ReadMem(playerPawn + clientDLL::C_BaseEntity_["m_iHealth"]);
220 | return pawnHealth;
221 | }
222 |
223 | uintptr_t C_CSPlayerPawn::getPawnTeam() {
224 | pawnTeam = MemMan.ReadMem(value + clientDLL::C_BaseEntity_["m_iTeamNum"]);
225 | return pawnTeam;
226 | }
227 |
228 | int C_CSPlayerPawn::getEntitySpotted() {
229 | spotted = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_entitySpottedState"] + clientDLL::EntitySpottedState_t_["m_bSpottedByMask"]);
230 | return spotted;
231 | }
232 |
233 | int C_CSPlayerPawn::getOwner() {
234 | owner = MemMan.ReadMem(playerPawn + clientDLL::C_BaseEntity_["m_hOwnerEntity"]);
235 | return owner;
236 | }
237 |
238 |
239 |
240 |
241 | uintptr_t LocalPlayer::getPlayerPawn() {
242 | playerPawn = MemMan.ReadMem(base + offsets::clientDLL["dwLocalPlayerPawn"]);
243 | return playerPawn;
244 | }
245 |
246 | uintptr_t LocalPlayer::getPlayerController() {
247 | playerController = MemMan.ReadMem(base + offsets::clientDLL["dwLocalPlayerController"]);
248 | return playerController;
249 | }
250 |
251 | uintptr_t LocalPlayer::getTeam() {
252 | team = MemMan.ReadMem(localPlayer + clientDLL::C_BaseEntity_["m_iTeamNum"]);
253 | return team;
254 | }
255 |
256 | Vector3 LocalPlayer::getCameraPos() {
257 | cameraPos = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawnBase_["m_vecLastClipCameraPos"]);
258 | return cameraPos;
259 | }
260 |
261 | Vector3 LocalPlayer::getViewAngles() {
262 | viewAngles = MemMan.ReadMem(playerPawn + clientDLL::C_BasePlayerPawn_["v_angle"]);
263 | return viewAngles;
264 | }
265 |
266 | Vector3 LocalPlayer::getPosition() {
267 | position = MemMan.ReadMem(playerPawn + clientDLL::CBaseAnimGraph_["m_vLastSlopeCheckPos"]);
268 | return position;
269 | }
270 |
271 | Vector3 LocalPlayer::getOrigin() {
272 | origin = MemMan.ReadMem(playerPawn + clientDLL::C_BasePlayerPawn_["m_vOldOrigin"]);
273 | return origin;
274 | }
275 |
276 | Vector3 LocalPlayer::getEyePos() {
277 | eyepos = this->getOrigin() + MemMan.ReadMem(playerPawn + clientDLL::C_BaseModelEntity_["m_vecViewOffset"]);
278 | return eyepos;
279 | }
280 |
281 | int LocalPlayer::getFlags() {
282 | flags = MemMan.ReadMem(playerPawn + clientDLL::C_BaseEntity_["m_fFlags"]);
283 | return flags;
284 | }
285 |
286 | C_UTL_VECTOR LocalPlayer::getAimPunchCache() {
287 | aimPunchCache = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_aimPunchCache"]);
288 | return aimPunchCache;
289 | }
290 |
291 | Vector2 LocalPlayer::getAimPunchAngle() {
292 | aimPunchAngle = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_aimPunchAngle"]);
293 | return aimPunchAngle;
294 | }
295 |
296 | int LocalPlayer::getShotsFired() {
297 | shotsFired = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_iShotsFired"]);
298 | return shotsFired;
299 | }
300 |
301 | int LocalPlayer::getEntitySpotted() {
302 | spotted = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_entitySpottedState"] + clientDLL::EntitySpottedState_t_["m_bSpottedByMask"]);
303 | return spotted;
304 | }
305 |
306 | bool LocalPlayer::getIsScoped() {
307 | isScoped = MemMan.ReadMem(playerPawn + clientDLL::C_CSPlayerPawn_["m_bIsScoped"]);
308 | return isScoped;
309 | }
310 |
311 |
312 |
313 | uintptr_t CGameSceneNode::getBoneArray() {
314 | boneArray = MemMan.ReadMem(value + clientDLL::CSkeletonInstance_["m_modelState"] + 0x80);
315 | return boneArray;
316 | }
317 |
318 | Vector3 CGameSceneNode::getOrigin() {
319 | origin = MemMan.ReadMem(value + clientDLL::CGameSceneNode_["m_vecAbsOrigin"]);
320 | return origin;
321 | }
322 |
323 |
324 |
325 | bool SharedFunctions::spottedCheck(C_CSPlayerPawn C_CSPlayerPawn, LocalPlayer localPlayer) {
326 | if (C_CSPlayerPawn.getEntitySpotted() & (1 << (localPlayer.playerPawn)) || localPlayer.getEntitySpotted() & (1 << (C_CSPlayerPawn.playerPawn))) return 1;
327 | return 0;
328 | }
329 |
330 | bool SharedFunctions::inGame(DWORD_PTR base) {
331 | uintptr_t gameRules = MemMan.ReadMem(base + offsets::clientDLL["dwGameRules"]);
332 |
333 | bool warmup = MemMan.ReadMem(gameRules + clientDLL::C_CSGameRules_["m_bWarmupPeriod"]);
334 | bool match = MemMan.ReadMem(gameRules + clientDLL::C_CSGameRules_["m_bHasMatchStarted"]);
335 | bool freeze = MemMan.ReadMem(gameRules + clientDLL::C_CSGameRules_["m_bFreezePeriod"]);
336 |
337 | return match;
338 | }
339 |
340 |
341 |
342 | bool C_C4::isPlanted() {
343 | planted = MemMan.ReadMem(base + offsets::clientDLL["dwPlantedC4"] - 0x8);
344 | return planted;
345 | }
346 |
347 | bool C_C4::isCarrier(int index) {
348 | return m_bCarrier = false;
349 | }
350 |
351 | uintptr_t C_C4::getCarrier() {
352 | return m_pCarrier = 0x0;
353 | }
354 |
355 | int C_C4::getPlantedSite()
356 | {
357 | return site = MemMan.ReadMem(c4 + clientDLL::C_PlantedC4_["m_nBombSite"]);
358 | }
359 |
360 | bool C_C4::isBeingDefused()
361 | {
362 | return isDefusing = MemMan.ReadMem(c4 + clientDLL::C_PlantedC4_["m_bBeingDefused"]);
363 | }
364 |
365 | long C_C4::getDefuseTime()
366 | {
367 | return defuseTime = MemMan.ReadMem(c4 + clientDLL::C_PlantedC4_["m_flDefuseCountDown"]);
368 | }
369 |
370 | uintptr_t C_C4::getCGameSceneNode() {
371 | scene = MemMan.ReadMem(c4 + clientDLL::C_BaseEntity_["m_pGameSceneNode"]);
372 | return scene;
373 | }
374 |
375 | uint32_t CBasePlayerController::getDesiredFov()
376 | {
377 | return iDesiredFov = MemMan.ReadMem(controller + clientDLL::CBasePlayerController_["m_iDesiredFov"]);
378 | }
379 |
380 | uint64_t CBasePlayerController::getSteamId()
381 | {
382 | return steamId = MemMan.ReadMem(controller + clientDLL::CBasePlayerController_["m_steamID"]);
383 | }
--------------------------------------------------------------------------------
/util/attributes.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #pragma warning (disable: 26495)
3 |
4 | #include
5 | #include
6 |
7 | #include "Vectors.h"
8 | #include "MemMan.hpp"
9 |
10 | #include "../json/jsonOps.hpp"
11 |
12 | #include "weaponInfo.hpp"
13 |
14 | struct C_UTL_VECTOR
15 | {
16 | DWORD_PTR count = 0;
17 | DWORD_PTR data = 0;
18 | };
19 |
20 |
21 | MemoryManagement MemMan;
22 |
23 | namespace clientDLL {
24 | nlohmann::json clientDLLOffsets;
25 |
26 | nlohmann::json C_BaseEntity_;
27 | nlohmann::json C_BaseModelEntity_;
28 | nlohmann::json CCSPlayerController_;
29 | nlohmann::json CBasePlayerController_;
30 | nlohmann::json C_BasePlayerPawn_;
31 | nlohmann::json C_CSPlayerPawn_;
32 | nlohmann::json C_CSPlayerPawnBase_;
33 | nlohmann::json CBaseAnimGraph_;
34 | nlohmann::json C_EconItemView_;
35 | nlohmann::json C_AttributeContainer_;
36 | nlohmann::json C_EconEntity_;
37 | nlohmann::json CSkeletonInstance_;
38 | nlohmann::json CGameSceneNode_;
39 | nlohmann::json EntitySpottedState_t_;
40 | nlohmann::json C_CSGameRules_;
41 | nlohmann::json CCSWeaponBaseVData_;
42 | nlohmann::json CCSPlayerBase_CameraServices_;
43 | nlohmann::json C_PlantedC4_;
44 |
45 | bool load();
46 | };
47 |
48 |
49 | namespace offsets {
50 | nlohmann::json clientDLL;
51 |
52 | bool load();
53 | };
54 |
55 | bool loadJson();
56 |
57 | nlohmann::json buttons;
58 |
59 | class CCSPlayerController{
60 | public:
61 | uintptr_t entityList;
62 | uintptr_t baseAddy;
63 | int id;
64 |
65 | CCSPlayerController(uintptr_t base) {
66 | baseAddy = base;
67 | entityList = MemMan.ReadMem(base + offsets::clientDLL["dwEntityList"]);
68 | }
69 |
70 | uintptr_t listEntry;
71 | uintptr_t getListEntry();
72 |
73 | uintptr_t value;
74 | uintptr_t getController();
75 |
76 | int pawnHealth;
77 | int getPawnHealth();
78 |
79 | bool alive;
80 | bool isAlive();
81 |
82 | bool spectating;
83 | bool isSpectating(bool localPlayer);
84 |
85 | uintptr_t spectatorTarget;
86 | uintptr_t getSpectating();
87 |
88 | uintptr_t pawnTeam;
89 | uintptr_t getPawnTeam();
90 |
91 | uintptr_t pawnNameAddress;
92 | std::string pawnName;
93 | std::string getPawnName();
94 |
95 | // C_CSPlayerPawn
96 | std::uint32_t C_CSPlayerPawn_;
97 | std::uint32_t getC_CSPlayerPawn();
98 | };
99 |
100 | class CBasePlayerController {
101 | public:
102 | uintptr_t controller;
103 |
104 | uint32_t iDesiredFov;
105 | uint32_t getDesiredFov();
106 |
107 | uint64_t steamId;
108 | uint64_t getSteamId();
109 | };
110 |
111 |
112 | class C_CSPlayerPawn {
113 | public:
114 | std::uint32_t value;
115 | uintptr_t entityList;
116 |
117 | C_CSPlayerPawn(uintptr_t base) {
118 | entityList = MemMan.ReadMem(base + offsets::clientDLL["dwEntityList"]);
119 | }
120 |
121 | uintptr_t listEntry;
122 | uintptr_t getListEntry();
123 |
124 | uintptr_t playerPawn;
125 | uintptr_t getPlayerPawn();
126 | uintptr_t getPlayerPawnByCrossHairID(int crossHairEntity);
127 |
128 | Vector3 origin;
129 | Vector3 getOrigin();
130 |
131 | Vector3 cameraPos;
132 | Vector3 getCameraPos();
133 |
134 | Vector3 viewAngles;
135 | Vector3 getViewAngles();
136 |
137 | Vector3 position;
138 | Vector3 getPosition();
139 |
140 | Vector3 eyePos;
141 | Vector3 getEyePos();
142 |
143 | int pawnHealth;
144 | int getPawnHealth();
145 |
146 | uintptr_t pawnTeam;
147 | uintptr_t getPawnTeam();
148 |
149 | uint64_t C_CSWeaponBase;
150 | uint16_t weaponID;
151 | std::string weaponName;
152 | uint16_t getWeaponID();
153 | std::string getWeaponName();
154 |
155 | int spotted;
156 | int getEntitySpotted();
157 |
158 | int owner;
159 | int getOwner();
160 |
161 | // CGameSceneNode
162 | uintptr_t CGameSceneNode;
163 | uintptr_t getCGameSceneNode();
164 |
165 | };
166 |
167 | class CGameSceneNode {
168 | public:
169 | uintptr_t value;
170 |
171 | uintptr_t boneArray;
172 | uintptr_t getBoneArray();
173 |
174 | Vector3 origin;
175 | Vector3 getOrigin();
176 | };
177 |
178 | class C_C4 {
179 | public:
180 | uintptr_t c4;
181 | uintptr_t base;
182 |
183 | C_C4(uintptr_t baseAddy) {
184 | base = baseAddy;
185 | c4 = MemMan.ReadMem(MemMan.ReadMem(baseAddy + offsets::clientDLL["dwPlantedC4"]));
186 | }
187 |
188 | bool planted;
189 | bool isPlanted();
190 |
191 | bool m_bCarrier;
192 | bool isCarrier(int index);
193 |
194 | uintptr_t m_pCarrier;
195 | uintptr_t getCarrier();
196 |
197 | int site;
198 | int getPlantedSite();
199 |
200 | bool isDefusing;
201 | bool isBeingDefused();
202 |
203 | long defuseTime;
204 | long getDefuseTime();
205 |
206 | uintptr_t scene;
207 | uintptr_t getCGameSceneNode();
208 | };
209 |
210 | class LocalPlayer {
211 | public:
212 | uintptr_t localPlayer;
213 | uintptr_t base;
214 |
215 | LocalPlayer(uintptr_t baseAddy) {
216 | base = baseAddy;
217 | localPlayer = MemMan.ReadMem(base + offsets::clientDLL["dwLocalPlayerController"]);
218 | }
219 |
220 | uintptr_t playerPawn;
221 | uintptr_t getPlayerPawn();
222 |
223 | uintptr_t playerController;
224 | uintptr_t getPlayerController();
225 |
226 | uintptr_t team;
227 | uintptr_t getTeam();
228 |
229 | Vector3 cameraPos;
230 | Vector3 getCameraPos();
231 |
232 | Vector3 origin;
233 | Vector3 getOrigin();
234 |
235 | Vector3 eyepos;
236 | Vector3 getEyePos();
237 |
238 | Vector3 viewAngles;
239 | Vector3 getViewAngles();
240 |
241 | Vector3 position;
242 | Vector3 getPosition();
243 |
244 | int flags;
245 | int getFlags();
246 |
247 | C_UTL_VECTOR aimPunchCache;
248 | C_UTL_VECTOR getAimPunchCache();
249 |
250 | Vector2 aimPunchAngle;
251 | Vector2 getAimPunchAngle();
252 |
253 | int shotsFired;
254 | int getShotsFired();
255 |
256 | void noFlash();
257 |
258 | int spotted;
259 | int getEntitySpotted();
260 |
261 | bool isScoped;
262 | bool getIsScoped();
263 | };
264 |
265 |
266 | // This is unrelated to all the other classes, but this is the most convenient way to share functions between features
267 | class SharedFunctions {
268 | public:
269 | static bool spottedCheck(C_CSPlayerPawn C_CSPlayerPawn, LocalPlayer localPlayer);
270 | static bool inGame(DWORD_PTR base);
271 | };
272 |
273 | namespace Shared {
274 | uint64_t steamId;
275 | int lastConsoleState;
276 | int lastAffinity;
277 | }
--------------------------------------------------------------------------------
/util/config.cpp:
--------------------------------------------------------------------------------
1 | #include "config.hpp"
2 |
3 | inline nlohmann::json aimConfig::to_json() {
4 | nlohmann::json json;
5 | json["rcs"] = rcs;
6 | json["fov"] = fov;
7 | json["bone"] = bone;
8 | json["sens"] = sens;
9 | json["state"] = state;
10 | json["bones"] = bones;
11 | json["hotAim"] = hotAim;
12 | json["hotKey"] = hotKey;
13 | json["trigger"] = trigger;
14 | json["boneMap"] = boneMap;
15 | json["aimMode"] = aimMode;
16 | json["isHotAim"] = isHotAim;
17 | json["aimModes"] = aimModes;
18 | json["smoothing"] = smoothing;
19 | json["hotKeyMap"] = hotKeyMap;
20 | json["fovCircle"] = fovCircle;
21 | json["boneSelect"] = boneSelect;
22 | json["hotTrigger"] = hotTrigger;
23 | json["playerLock"] = playerLock;
24 | json["aimModeMap"] = aimModeMap;
25 | json["checkSpotter"] = checkSpotted;
26 | json["hotSelectAim"] = hotSelectAim;
27 | json["isHotTrigger"] = isHotTrigger;
28 | json["hotSelectTrigger"] = hotSelectTrigger;
29 | return json;
30 | }
31 |
32 | inline bool aimConfig::from_json(nlohmann::json json) {
33 | try {
34 | rcs = json["rcs"];
35 | fov = json["fov"];
36 | bone = json["bone"];
37 | sens = json["sens"];
38 | state = json["state"];
39 | bones = json["bones"];
40 | hotAim = json["hotAim"];
41 | hotKey = json["hotKey"];
42 | trigger = json["trigger"];
43 | boneMap = json["boneMap"];
44 | aimMode = json["aimMode"];
45 | isHotAim = json["isHotAim"];
46 | aimModes = json["aimModes"];
47 | smoothing = json["smoothing"];
48 | hotKeyMap = json["hotKeyMap"];
49 | fovCircle = json["fovCircle"];
50 | boneSelect = json["boneSelect"];
51 | hotTrigger = json["hotTrigger"];
52 | playerLock = json["playerLock"];
53 | aimModeMap = json["aimModeMap"];
54 | checkSpotted = json["checkSpotter"];
55 | hotSelectAim = json["hotSelectAim"];
56 | isHotTrigger = json["isHotTrigger"];
57 | hotSelectTrigger = json["hotSelectTrigger"];
58 | }
59 | catch (nlohmann::json::type_error& ignored) {
60 | Logger::warn("[Config.cpp] aimConfig section has missing properties, using defaults for missing options.");
61 | }
62 |
63 | return true;
64 | }
65 |
66 | inline nlohmann::json espConfig::to_json() {
67 | nlohmann::json json;
68 | json["head"] = head;
69 | json["joint"] = joint;
70 | json["state"] = state;
71 | json["width"] = width;
72 | json["health"] = health;
73 | json["pawnGun"] = pawnGun;
74 | json["c4State"] = c4State;
75 | json["distance"] = distance;
76 | json["skeleton"] = skeleton;
77 | json["pawnName"] = pawnName;
78 | json["boundBox"] = boundBox;
79 | json["gradient"] = gradient;
80 | json["c4Colors"] = c4Colors;
81 | json["snapLines"] = snapLines;
82 | json["hpCounter"] = hpCounter;
83 | json["isPawnGun"] = isPawnGun;
84 | json["filledBox"] = filledBox;
85 | json["c4Carrier"] = c4Carrier;
86 | json["c4Gradient"] = c4Gradient;
87 | json["isPawnName"] = isPawnName;
88 | json["headColours"] = headColours;
89 | json["isHealthBar"] = isHealthBar;
90 | json["c4Thickness"] = c4Thickness;
91 | json["jointColours"] = jointColours;
92 | json["checkSpotted"] = checkSpotted;
93 | json["cornerColours"] = cornerColours;
94 | json["spottedColours"] = spottedColours;
95 | json["cornerGradient"] = cornerGradient;
96 | json["skeletonColours"] = skeletonColours;
97 | json["attributeColours"] = attributeColours;
98 | json["c4ColorsGradient"] = c4ColorsGradient;
99 | json["boundBoxThickness"] = boundBoxThickness;
100 | json["notSpottedColours"] = notSpottedColours;
101 |
102 | return json;
103 | }
104 |
105 | inline bool espConfig::from_json(nlohmann::json json) {
106 | try {
107 | head = json["head"];
108 | joint = json["joint"];
109 | state = json["state"];
110 | width = json["width"];
111 | health[0] = json["health"][0];
112 | health[1] = json["health"][1];
113 | health[2] = json["health"][2];
114 | health[3] = json["health"][3];
115 | pawnGun = json["pawnGun"];
116 | c4State = json["c4State"];
117 | distance = json["distance"];
118 | skeleton = json["skeleton"];
119 | pawnName = json["pawnName"];
120 | boundBox = json["boundBox"];
121 | gradient = json["gradient"];
122 | snapLines = json["snapLines"];
123 | hpCounter = json["hpCounter"];
124 | isPawnGun = json["isPawnGun"];
125 | c4Gradient = json["c4Gradient"];
126 | cornerGradient[0] = json["cornerGradient"][0];
127 | cornerGradient[1] = json["cornerGradient"][1];
128 | cornerGradient[2] = json["cornerGradient"][2];
129 | cornerGradient[3] = json["cornerGradient"][3];
130 | filledBox = json["filledBox"];
131 | c4Carrier = json["c4Carrier"];
132 | isPawnName = json["isPawnName"];
133 | headColours[0] = json["headColours"][0];
134 | headColours[1] = json["headColours"][1];
135 | headColours[2] = json["headColours"][2];
136 | headColours[3] = json["headColours"][3];
137 | isHealthBar = json["isHealthBar"];
138 | jointColours[0] = json["jointColours"][0];
139 | jointColours[1] = json["jointColours"][1];
140 | jointColours[2] = json["jointColours"][2];
141 | jointColours[3] = json["jointColours"][3];
142 | c4Colors[0] = json["c4Colors"][0];
143 | c4Colors[1] = json["c4Colors"][1];
144 | c4Colors[2] = json["c4Colors"][2];
145 | c4Colors[3] = json["c4Colors"][3];
146 | c4Thickness = json["c4Thickness"];
147 | checkSpotted = json["checkSpotted"];
148 | cornerColours[0] = json["cornerColours"][0];
149 | cornerColours[1] = json["cornerColours"][1];
150 | cornerColours[2] = json["cornerColours"][2];
151 | cornerColours[3] = json["cornerColours"][3];
152 | spottedColours[0] = json["spottedColours"][0];
153 | spottedColours[1] = json["spottedColours"][1];
154 | spottedColours[2] = json["spottedColours"][2];
155 | spottedColours[3] = json["spottedColours"][3];
156 | skeletonColours[0] = json["skeletonColours"][0];
157 | skeletonColours[1] = json["skeletonColours"][1];
158 | skeletonColours[2] = json["skeletonColours"][2];
159 | skeletonColours[3] = json["skeletonColours"][3];
160 | attributeColours[0] = json["attributeColours"][0];
161 | attributeColours[1] = json["attributeColours"][1];
162 | attributeColours[2] = json["attributeColours"][2];
163 | attributeColours[3] = json["attributeColours"][3];
164 | boundBoxThickness = json["boundBoxThickness"];
165 | notSpottedColours[0] = json["notSpottedColours"][0];
166 | notSpottedColours[1] = json["notSpottedColours"][1];
167 | notSpottedColours[2] = json["notSpottedColours"][2];
168 | notSpottedColours[3] = json["notSpottedColours"][3];
169 | c4ColorsGradient[0] = json["c4ColorsGradient"][0];
170 | c4ColorsGradient[1] = json["c4ColorsGradient"][1];
171 | c4ColorsGradient[2] = json["c4ColorsGradient"][2];
172 | c4ColorsGradient[3] = json["c4ColorsGradient"][3];
173 | }
174 | catch (nlohmann::json::type_error& ignored) {
175 | std::cout << "[Config.cpp] espConfig section has missing properties, using defaults for missing options." << std::endl;
176 | }
177 |
178 | return true;
179 | }
180 |
181 |
182 | inline nlohmann::json miscConfig::to_json() {
183 | nlohmann::json json;
184 | json["itemESP"] = itemESP;
185 | json["bombTimer"] = bombTimer;
186 | json["spectator"] = spectator;
187 | json["deathmatchMode"] = deathmatchMode;
188 | json["consoleVisible"] = consoleVisible;
189 | json["obsBypass"] = obsBypass;
190 | json["spectatorColours"] = spectatorColours;
191 | json["bombTimerColours"] = bombTimerColours;
192 | return json;
193 | }
194 |
195 | inline bool miscConfig::from_json(nlohmann::json json) {
196 | try {
197 | itemESP = json["itemESP"];
198 | spectator = json["spectator"];
199 | consoleVisible = json["consoleVisible"];
200 | obsBypass = json["obsBypass"];
201 | deathmatchMode = json["deathmatchMode"];
202 | spectatorColours[0] = json["spectatorColours"][0];
203 | spectatorColours[1] = json["spectatorColours"][1];
204 | spectatorColours[2] = json["spectatorColours"][2];
205 | bombTimer = json["bombTimer"];
206 | bombTimerColours[0] = json["bombTimerColours"][0];
207 | bombTimerColours[1] = json["bombTimerColours"][1];
208 | bombTimerColours[2] = json["bombTimerColours"][2];
209 | }
210 | catch (nlohmann::json::type_error& ignored) {
211 | Logger::warn("[Config.cpp] miscConfig section has missing properties, using defaults for missing options.");
212 | }
213 |
214 | return true;
215 | }
216 |
217 | nlohmann::json config::to_json() {
218 | nlohmann::json json;
219 | json["espConf"] = espConf.to_json();
220 | json["aimConf"] = aimConf.to_json();
221 | json["miscConf"] = miscConf.to_json();
222 | return json;
223 | }
224 |
225 | void config::load(int index) {
226 | if (index < 0 || index >= CONFIG_NAMES.size() || index >= MAX_CONFIGS) return;
227 |
228 | try {
229 | Logger::info(L"[Config.cpp] Loading config: " + CONFIG_NAMES[index], true);
230 | configFiles[index] = json::readFromJsonFile(utils::getConfigPath(), CONFIG_NAMES[index]);
231 | aimConf.from_json(configFiles[index]["aimConf"]);
232 | espConf.from_json(configFiles[index]["espConf"]);
233 | miscConf.from_json(configFiles[index]["miscConf"]);
234 |
235 | ShowWindow(GetConsoleWindow(), miscConf.consoleVisible ? SW_RESTORE : SW_HIDE);
236 | SetWindowDisplayAffinity(GetForegroundWindow(), miscConf.obsBypass ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE);
237 | }
238 | catch (const nlohmann::json::type_error& e) {
239 | std::ostringstream str;
240 |
241 | str << "[Config.cpp] Error: " << e.what();
242 |
243 | Logger::error(str.str(), true);
244 | Logger::warn("[Config.cpp] Configuration section has missing properties, using defaults for missing options.", true);
245 | }
246 | }
247 |
248 |
249 | void config::save(int index) {
250 | if (index < 0 || index >= CONFIG_NAMES.size() || index >= MAX_CONFIGS) return;
251 |
252 | std::wstring filePath = utils::getConfigPath() + L"\\" + CONFIG_NAMES[index];
253 | //std::wcout << filePath << " Current index: " << index << std::endl; // debug
254 | std::ofstream outfile(filePath, std::ios_base::out);
255 | outfile << config::to_json();
256 | outfile.close();
257 | }
258 |
259 | void config::refresh() {
260 |
261 | Logger::info("[Config.cpp] Refreshing configs!");
262 |
263 | CONFIG_NAMES.clear();
264 | configFiles->clear();
265 | currentConfigIndex = 0;
266 |
267 | if (!std::filesystem::exists(utils::getDexterionPath()))
268 | std::filesystem::create_directory(utils::getDexterionPath());
269 |
270 | if (std::filesystem::exists(utils::getConfigPath()) && std::filesystem::is_directory(utils::getConfigPath()))
271 | {
272 | for (auto const& entry : std::filesystem::recursive_directory_iterator(utils::getConfigPath()))
273 | {
274 | if (std::filesystem::is_regular_file(entry) && entry.path().extension() == ".json" && 0 != json::readFromJsonFile(utils::getConfigPath(), entry.path().filename().wstring()))
275 | CONFIG_NAMES.push_back(entry.path().filename().wstring());
276 | }
277 | }
278 | else
279 | std::filesystem::create_directory(utils::getConfigPath());
280 |
281 | Logger::success("[Config.cpp] Config files refreshed succesfully!");
282 | }
283 |
284 | void config::create(std::wstring name) {
285 | std::wstring filePath = utils::getConfigPath() + L"\\" + name;
286 | std::ofstream outfile(filePath);
287 | outfile.close();
288 |
289 | CONFIG_NAMES.push_back(name);
290 | }
291 |
292 | bool config::exists(int index) {
293 | if (index < 0 || index >= CONFIG_NAMES.size() || index >= MAX_CONFIGS) return false;
294 |
295 | std::wstring filePath = utils::getConfigPath() + L"\\" + CONFIG_NAMES[index];
296 | return std::ifstream(filePath).good();
297 | }
298 |
--------------------------------------------------------------------------------
/util/config.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 | #include