├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── FEATURES.md ├── LICENSE ├── NatvisFile.natvis ├── README.md ├── SickoBanner.png ├── SickoMenu.sln ├── SickoMenu.vcxproj ├── SickoMenu.vcxproj.filters ├── appdata ├── il2cpp-api-functions.h ├── il2cpp-classes.h ├── il2cpp-functions.cpp ├── il2cpp-functions.h ├── il2cpp-translations.h ├── il2cpp-types - Copy.h └── il2cpp-types.h ├── events ├── CastVoteEvent.cpp ├── CheatDetectedEvent.cpp ├── DisconnectEvent.cpp ├── KillEvent.cpp ├── ProtectPlayerEvent.cpp ├── ReportDeadBodyEvent.cpp ├── ShapeShiftEvent.cpp ├── TaskCompletedEvent.cpp ├── VentEvent.cpp ├── WalkEvent.cpp └── _events.h ├── framework ├── dllmain.cpp ├── il2cpp-appdata.h ├── il2cpp-helpers.cpp ├── il2cpp-helpers.h ├── il2cpp-init.cpp ├── il2cpp-init.h ├── pch-il2cpp.cpp ├── pch-il2cpp.h ├── version.cpp ├── version.def └── version.h ├── gui ├── RenderCmd.cpp ├── RenderCmd.hpp ├── Renderer.cpp ├── Renderer.hpp ├── console.cpp ├── console.hpp ├── esp.cpp ├── esp.hpp ├── gui-helpers.cpp ├── gui-helpers.hpp ├── menu.cpp ├── menu.hpp ├── radar.cpp ├── radar.hpp ├── replay.cpp ├── replay.hpp ├── tabs │ ├── about_tab.cpp │ ├── about_tab.h │ ├── debug_tab.cpp │ ├── debug_tab.h │ ├── doors_tab.cpp │ ├── doors_tab.h │ ├── esp_tab.cpp │ ├── esp_tab.h │ ├── game_tab.cpp │ ├── game_tab.h │ ├── host_tab.cpp │ ├── host_tab.h │ ├── players_tab.cpp │ ├── players_tab.h │ ├── radar_tab.cpp │ ├── radar_tab.h │ ├── replay_tab.cpp │ ├── replay_tab.h │ ├── sabotage_tab.cpp │ ├── sabotage_tab.h │ ├── self_tab.cpp │ ├── self_tab.h │ ├── settings_tab.cpp │ ├── settings_tab.h │ ├── tasks_tab.cpp │ └── tasks_tab.h ├── theme.cpp └── theme.hpp ├── hooks ├── AccountManager.cpp ├── AirshipStatus.cpp ├── Camera.cpp ├── Chat.cpp ├── DirectX.cpp ├── DirectX.h ├── Dleks.cpp ├── Doors.cpp ├── EOSManager.cpp ├── ExileController.cpp ├── FungleShipStatus.cpp ├── GameOptionsManager.cpp ├── HudManager.cpp ├── InnerNetClient.cpp ├── KeyboardJoystick.cpp ├── LobbyBehaviour.cpp ├── MeetingHud.cpp ├── NoShadowBehaviour.cpp ├── PlainDoor.cpp ├── PlayerBanData.cpp ├── PlayerControl.cpp ├── PlayerPhysics.cpp ├── PlayerStorageManager.cpp ├── PolusShipStatus.cpp ├── RoleManager.cpp ├── RoleManager.hpp ├── SabotageSystemType.cpp ├── SaveManager.cpp ├── SceneManager.cpp ├── ShipStatus.cpp ├── SignatureScan.hpp ├── UnityDebug.cpp ├── Vent.cpp ├── _hooks.cpp └── _hooks.h ├── includes ├── crc32.cpp ├── crc32.h ├── detours │ ├── detours.cpp │ ├── detours.h │ ├── disasm.cpp │ └── modules.cpp ├── directx11.cpp ├── directx11.h ├── imgui │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_draw.cpp │ ├── imgui_impl_dx11.cpp │ ├── imgui_impl_dx11.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── imgui_internal.h │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ └── imstb_truetype.h ├── json.hpp └── stb_image.h ├── resources ├── airship.png ├── cross.png ├── dead_body.png ├── fungle.png ├── kill.png ├── mira_hq.png ├── pause.png ├── play.png ├── player.png ├── player_visor.png ├── polus.png ├── report.png ├── resource_data.h ├── resource_data.rc ├── skeld.png ├── tick.png ├── vent_in.png └── vent_out.png ├── rpc ├── CmdCheckMurder.cpp ├── CustomRpcHandler.cpp ├── RpcCloseDoorsOfType.cpp ├── RpcCompleteTask.cpp ├── RpcMurderPlayer.cpp ├── RpcPlayAnimation.cpp ├── RpcPlayerAppearance.cpp ├── RpcReportBody.cpp ├── RpcSetColor.cpp ├── RpcSetName.cpp ├── RpcSetRole.cpp ├── RpcSetScanner.cpp ├── RpcSnapTo.cpp ├── RpcUpdateSystem.cpp ├── RpcUsePlatform.cpp └── _rpc.h ├── screenshot.png ├── used_types.txt └── user ├── DestroyableSingleton.h ├── achievements.cpp ├── achievements.hpp ├── game.cpp ├── game.h ├── keybinds.cpp ├── keybinds.h ├── logger.cpp ├── logger.h ├── main.cpp ├── main.h ├── profiler.cpp ├── profiler.h ├── resources.cpp ├── resources.h ├── state.cpp ├── state.hpp ├── utility.cpp └── utility.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | #credit goes to https://github.com/cpguy5089/AmongUsMenu_Ghost/blob/main/.github/workflows/build.yml 2 | name: Build Project 3 | 4 | on: 5 | workflow_dispatch: 6 | release: 7 | types: [published] 8 | #push: 9 | #branches: [ "main" ] 10 | 11 | jobs: 12 | Build_Release: 13 | runs-on: windows-2022 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2.3.4 17 | 18 | - name: Build Release 19 | shell: bash 20 | run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Release' 21 | 22 | - name: Build Release_Version 23 | shell: bash 24 | run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Release_Version' 25 | 26 | - name: Package Release Builds 27 | shell: cmd 28 | run: | 29 | move /y Release\SickoMenu.dll SickoMenu.dll 30 | move /y Release_Version\version.dll version.dll 31 | tar -caf Release.zip SickoMenu.dll version.dll LICENSE 32 | 33 | - name: Upload Release Artifact 34 | uses: actions/upload-artifact@v4.2.0 35 | with: 36 | name: Release 37 | path: Release.zip 38 | 39 | Build_Debug: 40 | runs-on: windows-2022 41 | steps: 42 | - name: Checkout 43 | uses: actions/checkout@v2.3.4 44 | 45 | - name: Build Debug 46 | shell: bash 47 | run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Debug' 48 | 49 | - name: Build Debug_Version 50 | shell: bash 51 | run: '"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin/MSBuild.exe" -property:Configuration=Debug_Version' 52 | 53 | - name: Package Debug Builds 54 | shell: cmd 55 | run: | 56 | move /y Debug\SickoMenu.dll SickoMenu.dll 57 | move /y Debug_Version\version.dll version.dll 58 | tar -caf Debug.zip SickoMenu.dll version.dll LICENSE 59 | 60 | - name: Upload Debug Artifact 61 | uses: actions/upload-artifact@v4.2.0 62 | with: 63 | name: Debug 64 | path: Debug.zip 65 | 66 | AutoRelease: 67 | runs-on: windows-2022 68 | needs: [Build_Release, Build_Debug] 69 | steps: 70 | # - name: Parse tag semver 71 | # uses: booxmedialtd/ws-action-parse-semver@3576f3a20a39f8752fe0d8195f5ed384090285dc 72 | # id: semver_parser 73 | # with: 74 | # input_string: ${{ github.ref }} 75 | # version_extractor_regex: '\/v(.*)$' 76 | 77 | # please keep this for an adjustment period, will help diagnose any issues 78 | # - name: Debug semver 79 | # run: | 80 | # echo 'major: ${{ steps.semver_parser.outputs.major }}' 81 | # echo 'minor: ${{ steps.semver_parser.outputs.minor }}' 82 | # echo 'patch: ${{ steps.semver_parser.outputs.patch }}' 83 | # echo 'feature (is pre-release?): ${{ steps.semver_parser.outputs.prerelease }}' 84 | # echo 'feature ver: ${{ steps.semver_parser.outputs.build }}' 85 | # echo 'full: ${{ steps.semver_parser.outputs.fullversion }}' 86 | # echo 'is pre-release: ${{ steps.semver_parser.outputs.prerelease != 0 }}' 87 | 88 | - name: Download Release Artifact 89 | uses: actions/download-artifact@v4.1.7 90 | with: 91 | name: Release 92 | 93 | - name: Download Debug Artifact 94 | uses: actions/download-artifact@v4.1.7 95 | with: 96 | name: Debug 97 | 98 | - name: Automatic Releases 99 | uses: marvinpinto/action-automatic-releases@latest #maybe this fixed auto release versioning? 100 | id: "automatic_releases" 101 | with: 102 | repo_token: "${{ secrets.GITHUB_TOKEN }}" #this is gonna give me a stroke 103 | automatic_release_tag: "latest" 104 | prerelease: false 105 | files: | 106 | Release.zip 107 | Debug.zip -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Rr]elease_[Xx]input/ 21 | [Rr]elease_[Vv]ersion/ 22 | [Dd]ebug_[Xx]input/ 23 | [Dd]ebug_[Vv]ersion/ 24 | [Dd]ebug/ 25 | [Dd]ebugPublic/ 26 | [Rr]elease/ 27 | [Rr]eleases/ 28 | x64/ 29 | x86/ 30 | [Aa][Rr][Mm]/ 31 | [Aa][Rr][Mm]64/ 32 | bld/ 33 | [Bb]in/ 34 | [Oo]bj/ 35 | [Ll]og/ 36 | [Ll]ogs/ 37 | [SS]icko[Mm]enu/ 38 | 39 | # Visual Studio 2015/2017 cache/options directory 40 | .vs/ 41 | # Uncomment if you have tasks that create the project's static files in wwwroot 42 | #wwwroot/ 43 | 44 | # Visual Studio 2017 auto generated files 45 | Generated\ Files/ 46 | 47 | # MSTest test Results 48 | [Tt]est[Rr]esult*/ 49 | [Bb]uild[Ll]og.* 50 | 51 | # NUnit 52 | *.VisualState.xml 53 | TestResult.xml 54 | nunit-*.xml 55 | 56 | # Build Results of an ATL Project 57 | [Dd]ebugPS/ 58 | [Rr]eleasePS/ 59 | dlldata.c 60 | 61 | # Benchmark Results 62 | BenchmarkDotNet.Artifacts/ 63 | 64 | # .NET Core 65 | project.lock.json 66 | project.fragment.lock.json 67 | artifacts/ 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Visual Studio code coverage results 146 | *.coverage 147 | *.coveragexml 148 | 149 | # NCrunch 150 | _NCrunch_* 151 | .*crunch*.local.xml 152 | nCrunchTemp_* 153 | 154 | # MightyMoose 155 | *.mm.* 156 | AutoTest.Net/ 157 | 158 | # Web workbench (sass) 159 | .sass-cache/ 160 | 161 | # Installshield output folder 162 | [Ee]xpress/ 163 | 164 | # DocProject is a documentation generator add-in 165 | DocProject/buildhelp/ 166 | DocProject/Help/*.HxT 167 | DocProject/Help/*.HxC 168 | DocProject/Help/*.hhc 169 | DocProject/Help/*.hhk 170 | DocProject/Help/*.hhp 171 | DocProject/Help/Html2 172 | DocProject/Help/html 173 | 174 | # Click-Once directory 175 | publish/ 176 | 177 | # Publish Web Output 178 | *.[Pp]ublish.xml 179 | *.azurePubxml 180 | # Note: Comment the next line if you want to checkin your web deploy settings, 181 | # but database connection strings (with potential passwords) will be unencrypted 182 | *.pubxml 183 | *.publishproj 184 | 185 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 186 | # checkin your Azure Web App publish settings, but sensitive information contained 187 | # in these scripts will be unencrypted 188 | PublishScripts/ 189 | 190 | # NuGet Packages 191 | *.nupkg 192 | # NuGet Symbol Packages 193 | *.snupkg 194 | # The packages folder can be ignored because of Package Restore 195 | **/[Pp]ackages/* 196 | # except build/, which is used as an MSBuild target. 197 | !**/[Pp]ackages/build/ 198 | # Uncomment if necessary however generally it will be regenerated when needed 199 | #!**/[Pp]ackages/repositories.config 200 | # NuGet v3's project.json files produces more ignorable files 201 | *.nuget.props 202 | *.nuget.targets 203 | 204 | # Microsoft Azure Build Output 205 | csx/ 206 | *.build.csdef 207 | 208 | # Microsoft Azure Emulator 209 | ecf/ 210 | rcf/ 211 | 212 | # Windows Store app package directories and files 213 | AppPackages/ 214 | BundleArtifacts/ 215 | Package.StoreAssociation.xml 216 | _pkginfo.txt 217 | *.appx 218 | *.appxbundle 219 | *.appxupload 220 | 221 | # Visual Studio cache files 222 | # files ending in .cache can be ignored 223 | *.[Cc]ache 224 | # but keep track of directories ending in .cache 225 | !?*.[Cc]ache/ 226 | 227 | # Others 228 | ClientBin/ 229 | ~$* 230 | *~ 231 | *.dbmdl 232 | *.dbproj.schemaview 233 | *.jfm 234 | *.pfx 235 | *.publishsettings 236 | orleans.codegen.cs 237 | 238 | # Including strong name files can present a security risk 239 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 240 | #*.snk 241 | 242 | # Since there are multiple workflows, uncomment next line to ignore bower_components 243 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 244 | #bower_components/ 245 | 246 | # RIA/Silverlight projects 247 | Generated_Code/ 248 | 249 | # Backup & report files from converting an old project file 250 | # to a newer Visual Studio version. Backup files are not needed, 251 | # because we have git ;-) 252 | _UpgradeReport_Files/ 253 | Backup*/ 254 | UpgradeLog*.XML 255 | UpgradeLog*.htm 256 | ServiceFabricBackup/ 257 | *.rptproj.bak 258 | 259 | # SQL Server files 260 | *.mdf 261 | *.ldf 262 | *.ndf 263 | 264 | # Business Intelligence projects 265 | *.rdl.data 266 | *.bim.layout 267 | *.bim_*.settings 268 | *.rptproj.rsuser 269 | *- [Bb]ackup.rdl 270 | *- [Bb]ackup ([0-9]).rdl 271 | *- [Bb]ackup ([0-9][0-9]).rdl 272 | 273 | # Microsoft Fakes 274 | FakesAssemblies/ 275 | 276 | # GhostDoc plugin setting file 277 | *.GhostDoc.xml 278 | 279 | # Node.js Tools for Visual Studio 280 | .ntvs_analysis.dat 281 | node_modules/ 282 | 283 | # Visual Studio 6 build log 284 | *.plg 285 | 286 | # Visual Studio 6 workspace options file 287 | *.opt 288 | 289 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 290 | *.vbw 291 | 292 | # Visual Studio LightSwitch build output 293 | **/*.HTMLClient/GeneratedArtifacts 294 | **/*.DesktopClient/GeneratedArtifacts 295 | **/*.DesktopClient/ModelManifest.xml 296 | **/*.Server/GeneratedArtifacts 297 | **/*.Server/ModelManifest.xml 298 | _Pvt_Extensions 299 | 300 | # Paket dependency manager 301 | .paket/paket.exe 302 | paket-files/ 303 | 304 | # FAKE - F# Make 305 | .fake/ 306 | 307 | # CodeRush personal settings 308 | .cr/personal 309 | 310 | # Python Tools for Visual Studio (PTVS) 311 | __pycache__/ 312 | *.pyc 313 | 314 | # Cake - Uncomment if you are using it 315 | # tools/** 316 | # !tools/packages.config 317 | 318 | # Tabs Studio 319 | *.tss 320 | 321 | # Telerik's JustMock configuration file 322 | *.jmconfig 323 | 324 | # BizTalk build output 325 | *.btp.cs 326 | *.btm.cs 327 | *.odx.cs 328 | *.xsd.cs 329 | 330 | # OpenCover UI analysis results 331 | OpenCover/ 332 | 333 | # Azure Stream Analytics local run output 334 | ASALocalRun/ 335 | 336 | # MSBuild Binary and Structured Log 337 | *.binlog 338 | 339 | # NVidia Nsight GPU debugger configuration file 340 | *.nvuser 341 | 342 | # MFractors (Xamarin productivity tool) working folder 343 | .mfractor/ 344 | 345 | # Local History for Visual Studio 346 | .localhistory/ 347 | 348 | # BeatPulse healthcheck temp database 349 | healthchecksdb 350 | 351 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 352 | MigrationBackup/ 353 | 354 | # Ionide (cross platform F# VS Code tools) working folder 355 | .ionide/ 356 | 357 | # gitparams.h is used for github workflow (we don't need to push it) 358 | gitparams.h -------------------------------------------------------------------------------- /SickoBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/SickoBanner.png -------------------------------------------------------------------------------- /SickoMenu.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 16 3 | VisualStudioVersion = 16.0.30717.126 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SickoMenu", "SickoMenu.vcxproj", "{AA556AC8-55E7-46C4-B59E-A7A781A4710A}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug_Version|x86 = Debug_Version|x86 10 | Debug|x86 = Debug|x86 11 | Release_Version|x86 = Release_Version|x86 12 | Release|x86 = Release|x86 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Debug_Version|x86.ActiveCfg = Debug_Version|Win32 16 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Debug_Version|x86.Build.0 = Debug_Version|Win32 17 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Debug|x86.ActiveCfg = Debug|Win32 18 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Debug|x86.Build.0 = Debug|Win32 19 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Release_Version|x86.ActiveCfg = Release_Version|Win32 20 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Release_Version|x86.Build.0 = Release_Version|Win32 21 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Release|x86.ActiveCfg = Release|Win32 22 | {AA556AC8-55E7-46C4-B59E-A7A781A4710A}.Release|x86.Build.0 = Release|Win32 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | GlobalSection(ExtensibilityGlobals) = postSolution 28 | SolutionGuid = {0439c985-2727-4d28-a7a5-44725d0e5784} 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /appdata/il2cpp-classes.h: -------------------------------------------------------------------------------- 1 | using namespace app; 2 | 3 | DO_APP_CLASS(AmongUsClient, "Assembly-CSharp, AmongUsClient"); 4 | DO_APP_CLASS(GameData, "Assembly-CSharp, GameData"); 5 | DO_APP_CLASS(Palette, "Assembly-CSharp, Palette"); 6 | DO_APP_CLASS(PlayerControl, "Assembly-CSharp, PlayerControl"); 7 | DO_APP_CLASS(VoteBanSystem, "Assembly-CSharp, VoteBanSystem"); 8 | DO_APP_CLASS(ShipStatus, "Assembly-CSharp, ShipStatus"); 9 | DO_APP_CLASS(Camera, "UnityEngine.CoreModule, UnityEngine.Camera"); 10 | DO_APP_CLASS(LobbyBehaviour, "Assembly-CSharp, LobbyBehaviour"); 11 | //DO_APP_CLASS(SaveManager, "Assembly-CSharp, SaveManager"); 12 | DO_APP_CLASS(MeetingHud, "Assembly-CSharp, MeetingHud"); 13 | DO_APP_CLASS(PlayerPhysics, "Assembly-CSharp, PlayerPhysics"); 14 | DO_APP_CLASS(GameManager, "Assembly-CSharp, GameManager"); 15 | DO_APP_CLASS(AccountManager, "Assembly-CSharp, AccountManager"); 16 | DO_APP_CLASS(SoundManager, "Assembly-CSharp, SoundManager"); 17 | DO_APP_CLASS(FriendsListUI, "Assembly-CSharp, FriendsListUI"); 18 | DO_APP_CLASS(GameContainer, "Assembly-CSharp, GameContainer"); 19 | //DO_APP_CLASS(DestroyableSingleton_1_RoleManager_, "Assembly-CSharp, DestroyableSingleton_1_RoleManager_"); -------------------------------------------------------------------------------- /appdata/il2cpp-functions.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" -------------------------------------------------------------------------------- /appdata/il2cpp-translations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | struct KLASS { 6 | std::string namespaze; 7 | std::string klass_name; 8 | 9 | size_t contains_type(std::string_view type_input) const { 10 | size_t position; 11 | 12 | if ((position = type_input.find(klass_name, 0)) != std::string_view::npos) 13 | return klass_name.length(); 14 | 15 | return 0; 16 | } 17 | 18 | friend bool operator==(const KLASS& lhs, const KLASS& rhs) { 19 | return (lhs.namespaze.compare(rhs.namespaze) == 0 && lhs.klass_name.compare(rhs.klass_name) == 0); 20 | } 21 | }; 22 | 23 | struct KLASS_PAIR { 24 | KLASS deobfuscated_klass; 25 | KLASS obfuscated_klass; 26 | }; 27 | 28 | const std::vector KLASS_TRANSLATIONS = { 29 | }; 30 | 31 | const std::vector> METHOD_TRANSLATIONS = { 32 | }; -------------------------------------------------------------------------------- /events/CastVoteEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | CastVoteEvent::CastVoteEvent(const EVENT_PLAYER& source, const std::optional& target) : EventInterface(source, EVENT_TYPES::EVENT_VOTE) { 6 | this->target = target; 7 | } 8 | 9 | void CastVoteEvent::Output() { 10 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 11 | ImGui::SameLine(); 12 | ImGui::Text(">"); 13 | ImGui::SameLine(); 14 | if (target.has_value()) ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(target->colorId)), target->playerName.c_str()); 15 | else ImGui::Text("Skipped"); 16 | ImGui::SameLine(); 17 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 18 | } 19 | 20 | void CastVoteEvent::ColoredEventOutput() { 21 | ImGui::Text("["); 22 | ImGui::SameLine(); 23 | ImGui::TextColored(ImVec4(0.3f, 0.4f, 1.f, 1.f), "VOTE"); 24 | ImGui::SameLine(); 25 | ImGui::Text("]"); 26 | } -------------------------------------------------------------------------------- /events/CheatDetectedEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | CheatDetectedEvent::CheatDetectedEvent(const EVENT_PLAYER& source, CHEAT_ACTIONS action) : EventInterface(source, EVENT_TYPES::EVENT_CHEAT) { 6 | this->action = action; 7 | } 8 | 9 | void CheatDetectedEvent::Output() { 10 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 11 | ImGui::SameLine(); 12 | ImGui::Text(">"); 13 | ImGui::SameLine(); 14 | ImGui::Text("Cheat detected: %s", CHEAT_ACTION_NAMES[(int)this->action]); 15 | ImGui::SameLine(); 16 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 17 | } 18 | 19 | void CheatDetectedEvent::ColoredEventOutput() { 20 | ImGui::Text("["); 21 | ImGui::SameLine(); 22 | ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "CHEAT"); 23 | ImGui::SameLine(); 24 | ImGui::Text("]"); 25 | } -------------------------------------------------------------------------------- /events/DisconnectEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | DisconnectEvent::DisconnectEvent(const EVENT_PLAYER& source) : EventInterface(source, EVENT_TYPES::EVENT_DISCONNECT) { } 6 | 7 | void DisconnectEvent::Output() { 8 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 9 | ImGui::SameLine(); 10 | ImGui::Text("has left the game"); 11 | ImGui::SameLine(); 12 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 13 | } 14 | 15 | void DisconnectEvent::ColoredEventOutput() { 16 | ImGui::Text("["); 17 | ImGui::SameLine(); 18 | ImGui::TextColored(ImVec4(1.f, 1.f, 1.f, 1.f), "DISCONNECT"); 19 | ImGui::SameLine(); 20 | ImGui::Text("]"); 21 | } -------------------------------------------------------------------------------- /events/KillEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | KillEvent::KillEvent(const EVENT_PLAYER& source, const EVENT_PLAYER& target, const Vector2& position, const Vector2& targetPosition) : EventInterface(source, EVENT_TYPES::EVENT_KILL) { 6 | this->target = target; 7 | this->targetPosition = targetPosition; 8 | this->position = position; 9 | this->systemType = GetSystemTypes(position); 10 | } 11 | 12 | void KillEvent::Output() { 13 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 14 | ImGui::SameLine(); 15 | ImGui::Text(">"); 16 | ImGui::SameLine(); 17 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(target.colorId)), target.playerName.c_str()); 18 | ImGui::SameLine(); 19 | ImGui::Text("(%s)", TranslateSystemTypes(systemType)); 20 | if (target.isProtected) { 21 | ImGui::SameLine(); 22 | ImGui::Text("["); 23 | ImGui::SameLine(0.f, 0.f); 24 | ImGui::TextColored(ImVec4(0.1f, 0.75f, 0.75f, 1.f), "Protected"); 25 | ImGui::SameLine(0.f, 0.f); 26 | ImGui::Text("]"); 27 | } 28 | ImGui::SameLine(); 29 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 30 | } 31 | 32 | void KillEvent::ColoredEventOutput() { 33 | ImGui::Text("["); 34 | ImGui::SameLine(); 35 | ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "KILL"); 36 | ImGui::SameLine(); 37 | ImGui::Text("]"); 38 | } -------------------------------------------------------------------------------- /events/ProtectPlayerEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | ProtectPlayerEvent::ProtectPlayerEvent(const EVENT_PLAYER& source, const EVENT_PLAYER& target) : EventInterface(source, EVENT_TYPES::EVENT_PROTECTPLAYER) { 6 | this->target = target; 7 | } 8 | 9 | void ProtectPlayerEvent::Output() { 10 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 11 | ImGui::SameLine(); 12 | ImGui::Text(">"); 13 | ImGui::SameLine(); 14 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(target.colorId)), target.playerName.c_str()); 15 | ImGui::SameLine(); 16 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 17 | } 18 | 19 | void ProtectPlayerEvent::ColoredEventOutput() { 20 | ImGui::Text("["); 21 | ImGui::SameLine(); 22 | ImGui::TextColored(ImVec4(0.1f, 0.75f, 0.75f, 1.f), "PROTECT"); 23 | ImGui::SameLine(); 24 | ImGui::Text("]"); 25 | } -------------------------------------------------------------------------------- /events/ReportDeadBodyEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | ReportDeadBodyEvent::ReportDeadBodyEvent(const EVENT_PLAYER& source, const std::optional& target, const Vector2& position, const std::optional& targetPosition) 6 | : EventInterface(source, (target.has_value() ? EVENT_TYPES::EVENT_REPORT : EVENT_TYPES::EVENT_MEETING)) { 7 | this->target = target; 8 | this->position = position; 9 | this->targetPosition = targetPosition; 10 | this->systemType = GetSystemTypes(position); 11 | } 12 | 13 | void ReportDeadBodyEvent::Output() { 14 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 15 | ImGui::SameLine(); 16 | if (target.has_value()) { 17 | ImGui::Text(">"); 18 | ImGui::SameLine(); 19 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(target->colorId)), target->playerName.c_str()); 20 | ImGui::SameLine(); 21 | } 22 | ImGui::Text("(%s)", TranslateSystemTypes(systemType)); 23 | ImGui::SameLine(); 24 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 25 | } 26 | 27 | void ReportDeadBodyEvent::ColoredEventOutput() { 28 | ImGui::Text("["); 29 | ImGui::SameLine(); 30 | ImGui::TextColored((target) ? ImVec4(1.f, 0.5f, 0.f, 1.f) : ImVec4(1.f, 1.f, 0, 1.f), (target.has_value()) ? "REPORT" : "MEETING"); 31 | ImGui::SameLine(); 32 | ImGui::Text("]"); 33 | } -------------------------------------------------------------------------------- /events/ShapeShiftEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | ShapeShiftEvent::ShapeShiftEvent(const EVENT_PLAYER& source, const EVENT_PLAYER& target) : EventInterface(source, EVENT_TYPES::EVENT_SHAPESHIFT) { 6 | this->target = target; 7 | } 8 | 9 | void ShapeShiftEvent::Output() { 10 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 11 | ImGui::SameLine(); 12 | ImGui::Text(">"); 13 | ImGui::SameLine(); 14 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(target.colorId)), target.playerName.c_str()); 15 | ImGui::SameLine(); 16 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 17 | } 18 | 19 | void ShapeShiftEvent::ColoredEventOutput() { 20 | ImGui::Text("["); 21 | ImGui::SameLine(); 22 | ImGui::TextColored(ImVec4(1.f, 0.5f, 0.f, 1.f), "SHAPESHIFT"); 23 | ImGui::SameLine(); 24 | ImGui::Text("]"); 25 | } 26 | 27 | PhantomEvent::PhantomEvent(const EVENT_PLAYER& source, PHANTOM_ACTIONS action) : EventInterface(source, EVENT_TYPES::EVENT_PHANTOM) 28 | { 29 | this->action = action; 30 | } 31 | 32 | void PhantomEvent::Output() 33 | { 34 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 35 | ImGui::SameLine(); 36 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 37 | } 38 | 39 | void PhantomEvent::ColoredEventOutput() 40 | { 41 | ImGui::Text("["); 42 | ImGui::SameLine(); 43 | 44 | ImVec4 color; 45 | ((action == PHANTOM_ACTIONS::PHANTOM_APPEAR) ? color = ImVec4(0.f, 1.f, 0.f, 1.f) : color = ImVec4(1.f, 0.f, 0.f, 1.f)); 46 | 47 | ImGui::TextColored(color, ((action == PHANTOM_ACTIONS::PHANTOM_APPEAR) ? "APPEAR" : "VANISH")); 48 | ImGui::SameLine(); 49 | ImGui::Text("]"); 50 | } -------------------------------------------------------------------------------- /events/TaskCompletedEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | TaskCompletedEvent::TaskCompletedEvent(const EVENT_PLAYER& source, const std::optional& taskType, const Vector2& position) : EventInterface(source, EVENT_TYPES::EVENT_TASK) { 6 | this->taskType = taskType; 7 | this->position = position; 8 | this->systemType = GetSystemTypes(position); 9 | } 10 | 11 | void TaskCompletedEvent::Output() { 12 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 13 | ImGui::SameLine(); 14 | ImGui::Text("> %s (%s)", (taskType.has_value()) ? TranslateTaskTypes(*taskType) : "UNKNOWN" , TranslateSystemTypes(systemType)); 15 | ImGui::SameLine(); 16 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 17 | } 18 | 19 | void TaskCompletedEvent::ColoredEventOutput() { 20 | ImGui::Text("["); 21 | ImGui::SameLine(); 22 | ImGui::TextColored(ImVec4(0.f, 1.f, 0.f, 1.f), "TASK"); 23 | ImGui::SameLine(); 24 | ImGui::Text("]"); 25 | } -------------------------------------------------------------------------------- /events/VentEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | VentEvent::VentEvent(const EVENT_PLAYER& source, const Vector2& position, VENT_ACTIONS action) : EventInterface(source, EVENT_TYPES::EVENT_VENT) 6 | { 7 | this->position = position; 8 | this->systemType = GetSystemTypes(position); 9 | this->action = action; 10 | } 11 | 12 | void VentEvent::Output() 13 | { 14 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 15 | ImGui::SameLine(); 16 | ImGui::Text("(%s)", TranslateSystemTypes(systemType)); 17 | ImGui::SameLine(); 18 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 19 | } 20 | 21 | void VentEvent::ColoredEventOutput() 22 | { 23 | ImGui::Text("[ VENT"); 24 | ImGui::SameLine(); 25 | 26 | ImVec4 color; 27 | ((action == VENT_ACTIONS::VENT_ENTER) ? color = ImVec4(0.f, 1.f, 0.f, 1.f) : color = ImVec4(1.f, 0.f, 0.f, 1.f)); 28 | 29 | ImGui::TextColored(color, ((action == VENT_ACTIONS::VENT_ENTER) ? "IN" : "OUT")); 30 | ImGui::SameLine(); 31 | ImGui::Text("]"); 32 | } 33 | 34 | SabotageEvent::SabotageEvent(const EVENT_PLAYER& source, SystemTypes__Enum systemType, SABOTAGE_ACTIONS action) : EventInterface(source, EVENT_TYPES::EVENT_SABOTAGE) 35 | { 36 | this->systemType = systemType; 37 | this->action = action; 38 | } 39 | 40 | void SabotageEvent::Output() 41 | { 42 | ImGui::TextColored(AmongUsColorToImVec4(GetPlayerColor(source.colorId)), source.playerName.c_str()); 43 | ImGui::SameLine(); 44 | ImGui::Text("(%s)", TranslateSystemTypes(systemType)); 45 | ImGui::SameLine(); 46 | ImGui::Text("[%s ago]", std::format("{:%OM:%OS}", (std::chrono::system_clock::now() - this->timestamp)).c_str()); 47 | } 48 | 49 | void SabotageEvent::ColoredEventOutput() 50 | { 51 | ImGui::Text("["); 52 | ImGui::SameLine(); 53 | 54 | ImVec4 color; 55 | ((action == SABOTAGE_ACTIONS::SABOTAGE_FIX) ? color = ImVec4(0.f, 1.f, 0.f, 1.f) : color = ImVec4(1.f, 0.f, 0.f, 1.f)); 56 | 57 | ImGui::TextColored(color, ((action == SABOTAGE_ACTIONS::SABOTAGE_CALL) ? "SABOTAGE" : "REPAIR")); 58 | ImGui::SameLine(); 59 | ImGui::Text("]"); 60 | } -------------------------------------------------------------------------------- /events/WalkEvent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_events.h" 3 | #include "utility.h" 4 | 5 | WalkEvent::WalkEvent(const EVENT_PLAYER& source, const Vector2& position) : EventInterface(source, EVENT_TYPES::EVENT_WALK) { 6 | this->position = position; 7 | } 8 | 9 | void WalkEvent::Output() { 10 | // not needed 11 | } 12 | 13 | void WalkEvent::ColoredEventOutput() { 14 | // not needed 15 | } -------------------------------------------------------------------------------- /framework/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #define WIN32_LEAN_AND_MEAN 2 | #include 3 | #include "il2cpp-init.h" 4 | #include "main.h" 5 | #if _VERSION 6 | #include "version.h" 7 | #endif 8 | 9 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 10 | { 11 | switch (ul_reason_for_call) 12 | { 13 | case DLL_PROCESS_ATTACH: 14 | DisableThreadLibraryCalls(hModule); 15 | #if _VERSION 16 | CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Load, hModule, NULL, NULL); 17 | #else 18 | CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Run, hModule, NULL, NULL); 19 | #endif 20 | break; 21 | case DLL_PROCESS_DETACH: 22 | #if _VERSION 23 | FreeLibrary(version_dll); 24 | #endif 25 | break; 26 | } 27 | return TRUE; 28 | } -------------------------------------------------------------------------------- /framework/il2cpp-appdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "il2cpp-types.h" 4 | #include "il2cpp-translations.h" 5 | #include "il2cpp-helpers.h" 6 | 7 | #define DO_API(r, n, p) extern r (*n) p 8 | #include "il2cpp-api-functions.h" 9 | #undef DO_API 10 | 11 | #define DO_APP_FUNC(r, n, p, s) extern r (*n) p 12 | namespace app { 13 | #include "il2cpp-functions.h" 14 | } 15 | #undef DO_APP_FUNC 16 | 17 | #define DO_APP_CLASS(n, s) extern n ## __Class* n ## __TypeInfo 18 | namespace app { 19 | #include "il2cpp-classes.h" 20 | } 21 | #undef DO_APP_CLASS -------------------------------------------------------------------------------- /framework/il2cpp-helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void new_console(); 4 | std::string convert_from_string(Il2CppString* input); 5 | std::string convert_from_string(app::String* input); 6 | app::String* convert_to_string(std::string_view input); 7 | std::string translate_type_name(std::string input); 8 | Il2CppMethodPointer find_method(Il2CppClass* klass, std::string_view returnType, std::string_view methodName, std::string_view paramTypes); 9 | Il2CppMethodPointer get_method(std::string methodSignature); 10 | Il2CppClass* get_class(std::string classSignature); 11 | Il2CppClass* get_class(std::string_view assemblyName, std::string namespaze, std::string className); 12 | std::string get_method_description(const MethodInfo* methodInfo); 13 | void output_class_methods(Il2CppClass* klass); 14 | void output_assembly_methods(const Il2CppAssembly* assembly); 15 | bool cctor_finished(Il2CppClass* klass); 16 | 17 | // NOTE ported this from c++23 so we can pin the project to c++20 18 | template 19 | inline constexpr bool is_scoped_enum_v = std::conjunction_v, std::negation>>; 20 | 21 | namespace app { 22 | namespace il2cpp { 23 | template 24 | class Dictionary { 25 | public: 26 | using iterator = decltype(&E::fields.entries->vector[0]); 27 | using key_type = decltype(E::fields.entries->vector->key); 28 | using value_type = decltype(E::fields.entries->vector->value); 29 | using pointer = std::conditional_t, value_type, value_type*>; 30 | constexpr Dictionary(E* dict) : _Ptr(dict) {} 31 | constexpr size_t size() const { 32 | if (!_Ptr) return 0; 33 | auto pDict = (Dictionary_2_SystemTypes_ISystemType_*)_Ptr; 34 | return ((size_t(*)(void*, const void*))(pDict->klass->vtable.get_Count.methodPtr))(pDict, pDict->klass->vtable.get_Count.method); 35 | } 36 | constexpr iterator begin() const { 37 | if (!_Ptr) return nullptr; 38 | return _Ptr->fields.entries->vector; 39 | } 40 | constexpr iterator end() const { return begin() + size(); } 41 | constexpr pointer operator[](const key_type& _Keyval) const { 42 | static_assert(std::is_arithmetic_v || is_scoped_enum_v); 43 | if (!_Ptr) return nullptr; 44 | const auto FindEntryMethod = ((System_Collections_Generic_Dictionary_TKey__TValue__RGCTXs*)(_Ptr->klass->rgctx_data)) 45 | ->_17_System_Collections_Generic_Dictionary_TKey__TValue__FindEntry; 46 | auto num = ((int32_t(*)(void*, key_type, const void*))(FindEntryMethod->methodPointer))(_Ptr, _Keyval, FindEntryMethod); 47 | if (num < 0) 48 | return nullptr; 49 | if constexpr (std::is_pointer_v) 50 | return _Ptr->fields.entries->vector[num].value; 51 | else 52 | return &_Ptr->fields.entries->vector[num].value; 53 | } 54 | constexpr E* get() const { return _Ptr; } 55 | protected: 56 | E* _Ptr; 57 | }; 58 | template 59 | class Array { 60 | public: 61 | using iterator = decltype(&E::vector[0]); 62 | constexpr Array(E* arr) : _Ptr(arr) {} 63 | constexpr size_t size() const { 64 | if (!_Ptr) return 0; 65 | if (_Ptr->bounds) 66 | return _Ptr->bounds->length; 67 | return _Ptr->max_length; 68 | } 69 | constexpr iterator begin() const { 70 | if (!_Ptr) return nullptr; 71 | return _Ptr->vector; 72 | } 73 | constexpr iterator end() const { return begin() + size(); } 74 | constexpr auto& operator[](const size_t _Pos) const { return begin()[_Pos]; } 75 | constexpr E* get() const { return _Ptr; } 76 | protected: 77 | E* _Ptr; 78 | }; 79 | template 80 | class List { 81 | public: 82 | using iterator = decltype(&E::fields._items->vector[0]); 83 | using value_type = std::remove_cvref_tvector[0])>; 84 | constexpr List(E* list) : _Ptr(list) {} 85 | constexpr size_t size() const { 86 | if (!_Ptr) return 0; 87 | auto pList = (List_1_PlayerTask_*)_Ptr; 88 | return ((size_t(*)(void*, const void*))(pList->klass->vtable.get_Count.methodPtr))(pList, pList->klass->vtable.get_Count.method); 89 | } 90 | constexpr void clear() { 91 | if (!_Ptr) return; 92 | auto pList = (List_1_PlayerTask_*)_Ptr; 93 | ((void(*)(void*, const void*))(pList->klass->vtable.Clear.methodPtr))(pList, pList->klass->vtable.Clear.method); 94 | } 95 | constexpr void erase(size_t _Pos) { 96 | if (!_Ptr || _Pos >= size()) return; 97 | auto pList = (List_1_PlayerTask_*)_Ptr; 98 | ((void(*)(void*, size_t, const void*))(pList->klass->vtable.RemoveAt.methodPtr))(pList, _Pos, pList->klass->vtable.RemoveAt.method); 99 | } 100 | constexpr void add(value_type item) { 101 | if (!_Ptr) return; 102 | auto pList = (List_1_PlayerTask_*)_Ptr; 103 | ((void(*)(void*, value_type, const void*))(pList->klass->vtable.Add.methodPtr))(pList, item, pList->klass->vtable.Add.method); 104 | } 105 | constexpr bool contains(value_type item) const { 106 | if (!_Ptr) return false; 107 | auto pList = (List_1_PlayerTask_*)_Ptr; 108 | return ((bool(*)(void*, value_type, const void*))(pList->klass->vtable.Contains.methodPtr))(pList, item, pList->klass->vtable.Contains.method); 109 | } 110 | constexpr iterator begin() const { 111 | if (!_Ptr) return nullptr; 112 | return _Ptr->fields._items->vector; 113 | } 114 | constexpr iterator end() const { return begin() + size(); } 115 | constexpr auto& operator[](const size_t _Pos) const { return begin()[_Pos]; } 116 | constexpr E* get() const { return _Ptr; } 117 | protected: 118 | E* _Ptr; 119 | }; 120 | 121 | Il2CppClass* get_system_type(); 122 | app::Type* get_type_of(Il2CppClass* klass); 123 | 124 | class generic_class { 125 | public: 126 | operator Il2CppClass* () const { 127 | return _klass; 128 | } 129 | protected: 130 | generic_class() = default; 131 | 132 | bool is_inited() const { 133 | return _klass != nullptr; 134 | } 135 | 136 | bool init(std::string_view classSignature, 137 | std::initializer_list types); 138 | 139 | Il2CppClass* _klass = nullptr; 140 | }; 141 | } 142 | } 143 | 144 | class ScopedThreadAttacher { 145 | public: 146 | ScopedThreadAttacher(); 147 | ~ScopedThreadAttacher(); 148 | 149 | void detach(); 150 | private: 151 | Il2CppThread* m_AttachedThread; 152 | }; -------------------------------------------------------------------------------- /framework/il2cpp-init.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "il2cpp-init.h" 3 | 4 | #define DO_API(r, n, p) r (*n) p 5 | #include "il2cpp-api-functions.h" 6 | #undef DO_API 7 | 8 | #define DO_APP_FUNC(r, n, p, s) r (*n) p 9 | namespace app { 10 | #include "il2cpp-functions.h" 11 | } 12 | #undef DO_APP_FUNC 13 | 14 | #define DO_APP_CLASS(n, s) n ## __Class* n ## __TypeInfo 15 | namespace app { 16 | #include "il2cpp-classes.h" 17 | } 18 | #undef DO_APP_CLASS 19 | 20 | void init_il2cpp() 21 | { 22 | HMODULE moduleHandle = GetModuleHandleW(L"GameAssembly.dll"); 23 | 24 | #define DO_API(r, n, p) n = (r (*) p)(GetProcAddress(moduleHandle, #n)) 25 | #include "il2cpp-api-functions.h" 26 | #undef DO_API 27 | 28 | using namespace app; 29 | 30 | #define DO_APP_FUNC(r, n, p, s) n = reinterpret_cast(get_method(s)) 31 | #include "il2cpp-functions.h" 32 | #undef DO_APP_FUNC 33 | 34 | #define DO_APP_CLASS(n, s) n ## __TypeInfo = reinterpret_cast(get_class(s)) 35 | #include "il2cpp-classes.h" 36 | #undef DO_APP_CLASS 37 | } -------------------------------------------------------------------------------- /framework/il2cpp-init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void init_il2cpp(); -------------------------------------------------------------------------------- /framework/pch-il2cpp.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" -------------------------------------------------------------------------------- /framework/pch-il2cpp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "il2cpp-appdata.h" 3 | #define WIN32_LEAN_AND_MEAN 4 | #include 5 | 6 | using namespace app; -------------------------------------------------------------------------------- /framework/version.cpp: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | #include 3 | #include 4 | #include "main.h" 5 | #include 6 | 7 | HMODULE version_dll; 8 | 9 | #define WRAPPER_GENFUNC(name) \ 10 | FARPROC o##name; \ 11 | __declspec(naked) void _##name() \ 12 | { \ 13 | __asm jmp[o##name] \ 14 | } 15 | 16 | WRAPPER_GENFUNC(GetFileVersionInfoA) 17 | WRAPPER_GENFUNC(GetFileVersionInfoByHandle) 18 | WRAPPER_GENFUNC(GetFileVersionInfoExW) 19 | WRAPPER_GENFUNC(GetFileVersionInfoExA) 20 | WRAPPER_GENFUNC(GetFileVersionInfoSizeA) 21 | WRAPPER_GENFUNC(GetFileVersionInfoSizeExA) 22 | WRAPPER_GENFUNC(GetFileVersionInfoSizeExW) 23 | WRAPPER_GENFUNC(GetFileVersionInfoSizeW) 24 | WRAPPER_GENFUNC(GetFileVersionInfoW) 25 | WRAPPER_GENFUNC(VerFindFileA) 26 | WRAPPER_GENFUNC(VerFindFileW) 27 | WRAPPER_GENFUNC(VerInstallFileA) 28 | WRAPPER_GENFUNC(VerInstallFileW) 29 | WRAPPER_GENFUNC(VerLanguageNameA) 30 | WRAPPER_GENFUNC(VerLanguageNameW) 31 | WRAPPER_GENFUNC(VerQueryValueA) 32 | WRAPPER_GENFUNC(VerQueryValueW) 33 | 34 | #define WRAPPER_FUNC(name) o##name = GetProcAddress(version_dll, ###name); 35 | 36 | void load_version() { 37 | char systemPath[MAX_PATH]; 38 | GetSystemDirectoryA(systemPath, MAX_PATH); 39 | strcat_s(systemPath, "\\version.dll"); 40 | version_dll = LoadLibraryA(systemPath); 41 | 42 | #if _DEBUG 43 | if (!version_dll) { 44 | std::string message = "Unable to load " + std::string(systemPath); 45 | MessageBoxA(NULL, message.c_str(), "SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); 46 | } 47 | #endif 48 | 49 | if (!version_dll) return; 50 | 51 | WRAPPER_FUNC(GetFileVersionInfoA); 52 | WRAPPER_FUNC(GetFileVersionInfoByHandle); 53 | WRAPPER_FUNC(GetFileVersionInfoExW); 54 | WRAPPER_FUNC(GetFileVersionInfoExA); 55 | WRAPPER_FUNC(GetFileVersionInfoSizeA); 56 | WRAPPER_FUNC(GetFileVersionInfoSizeExW); 57 | WRAPPER_FUNC(GetFileVersionInfoSizeExA); 58 | WRAPPER_FUNC(GetFileVersionInfoSizeW); 59 | WRAPPER_FUNC(GetFileVersionInfoW); 60 | WRAPPER_FUNC(VerFindFileA); 61 | WRAPPER_FUNC(VerFindFileW); 62 | WRAPPER_FUNC(VerInstallFileA); 63 | WRAPPER_FUNC(VerInstallFileW); 64 | WRAPPER_FUNC(VerLanguageNameA); 65 | WRAPPER_FUNC(VerLanguageNameW); 66 | WRAPPER_FUNC(VerQueryValueA); 67 | WRAPPER_FUNC(VerQueryValueW); 68 | } 69 | 70 | std::filesystem::path getApplicationPath() { 71 | TCHAR buff[MAX_PATH]; 72 | GetModuleFileName(NULL, buff, MAX_PATH); 73 | return std::filesystem::path(buff); 74 | } 75 | 76 | DWORD WINAPI Load(LPVOID lpParam) { 77 | auto applicationPath = getApplicationPath(); 78 | 79 | load_version(); 80 | if (!version_dll) 81 | return 0; 82 | 83 | if (applicationPath.filename() != "Among Us.exe") return 0; 84 | 85 | // Wait for Unity.InitializeEngineNoGraphics(). 86 | HWND hWnd = nullptr; 87 | while (true) { 88 | hWnd = FindWindowEx(nullptr, hWnd, TEXT("UnityWndClass"), nullptr); 89 | if (hWnd) { 90 | DWORD pid = 0; 91 | GetWindowThreadProcessId(hWnd, &pid); 92 | if (pid == GetCurrentProcessId()) { 93 | break; 94 | } 95 | continue; 96 | } 97 | std::this_thread::sleep_for(std::chrono::milliseconds(1000)); 98 | } 99 | // Wait for Unity.InitializeEngineGraphics(). 100 | while (!IsWindowVisible(hWnd)) { 101 | std::this_thread::sleep_for(std::chrono::milliseconds(1000)); 102 | } 103 | //std::this_thread::sleep_for(std::chrono::milliseconds(3000)); 104 | Run(lpParam); 105 | 106 | return 0; 107 | } -------------------------------------------------------------------------------- /framework/version.def: -------------------------------------------------------------------------------- 1 | LIBRARY "VERSION" 2 | EXPORTS 3 | 4 | GetFileVersionInfoA = _GetFileVersionInfoA 5 | GetFileVersionInfoByHandle = _GetFileVersionInfoByHandle 6 | GetFileVersionInfoExA = _GetFileVersionInfoExA 7 | GetFileVersionInfoExW = _GetFileVersionInfoExW 8 | GetFileVersionInfoSizeA = _GetFileVersionInfoSizeA 9 | GetFileVersionInfoSizeExA = _GetFileVersionInfoSizeExA 10 | GetFileVersionInfoSizeExW = _GetFileVersionInfoSizeExW 11 | GetFileVersionInfoSizeW = _GetFileVersionInfoSizeW 12 | GetFileVersionInfoW = _GetFileVersionInfoW 13 | VerFindFileA = _VerFindFileA 14 | VerFindFileW = _VerFindFileW 15 | VerInstallFileA = _VerInstallFileA 16 | VerInstallFileW = _VerInstallFileW 17 | VerLanguageNameA = _VerLanguageNameA 18 | VerLanguageNameW = _VerLanguageNameW 19 | VerQueryValueA = _VerQueryValueA 20 | VerQueryValueW = _VerQueryValueW -------------------------------------------------------------------------------- /framework/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define WIN32_LEAN_AND_MEAN 3 | #include 4 | 5 | extern HMODULE version_dll; 6 | 7 | DWORD WINAPI Load(LPVOID lpParam); -------------------------------------------------------------------------------- /gui/RenderCmd.cpp: -------------------------------------------------------------------------------- 1 | #include "RenderCmd.hpp" 2 | 3 | #include 4 | 5 | RenderCmdQueue::RenderCmdQueue() 6 | { 7 | m_CmdBuffer = new byte[10 * 1024 * 1024]; 8 | m_CmdBufferPtr = m_CmdBuffer; 9 | memset(m_CmdBuffer, 0, 10 * 1024 * 1024); 10 | } 11 | 12 | RenderCmdQueue::~RenderCmdQueue() 13 | { 14 | delete[] m_CmdBuffer; 15 | } 16 | 17 | void* RenderCmdQueue::Allocate(RenderCmdFunc function, uint32_t size) 18 | { 19 | *reinterpret_cast(m_CmdBufferPtr) = function; 20 | m_CmdBufferPtr += sizeof(RenderCmdFunc); 21 | 22 | *reinterpret_cast(m_CmdBufferPtr) = size; 23 | m_CmdBufferPtr += sizeof(uint32_t); 24 | 25 | void* memory = m_CmdBufferPtr; 26 | m_CmdBufferPtr += size; 27 | 28 | m_CmdCount++; 29 | return memory; 30 | } 31 | 32 | void RenderCmdQueue::Execute() 33 | { 34 | byte* buffer = m_CmdBuffer; 35 | 36 | for (uint32_t i = 0; i < m_CmdCount; i++) 37 | { 38 | RenderCmdFunc function = *reinterpret_cast(buffer); 39 | buffer += sizeof(RenderCmdFunc); 40 | 41 | uint32_t size = *reinterpret_cast(buffer); 42 | buffer += sizeof(uint32_t); 43 | function(buffer); 44 | buffer += size; 45 | } 46 | 47 | m_CmdBufferPtr = m_CmdBuffer; 48 | m_CmdCount = 0; 49 | } -------------------------------------------------------------------------------- /gui/RenderCmd.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using byte = uint8_t; 5 | 6 | class RenderCmdQueue 7 | { 8 | public: 9 | using RenderCmdFunc = void(*)(void*); 10 | 11 | RenderCmdQueue(); 12 | ~RenderCmdQueue(); 13 | 14 | void* Allocate(RenderCmdFunc function, uint32_t size); 15 | 16 | void Execute(); 17 | private: 18 | byte* m_CmdBuffer; 19 | byte* m_CmdBufferPtr; 20 | uint32_t m_CmdCount = 0; 21 | }; -------------------------------------------------------------------------------- /gui/Renderer.cpp: -------------------------------------------------------------------------------- 1 | #include "Renderer.hpp" 2 | #include "RenderCmd.hpp" 3 | #include "DirectX.h" 4 | #include "logger.h" 5 | 6 | static RenderCmdQueue s_CmdQueue; 7 | 8 | void ImGuiRenderer::ExecuteQueue() 9 | { 10 | WaitForSingleObject(DirectX::hRenderSemaphore, INFINITE); 11 | s_CmdQueue.Execute(); 12 | ReleaseSemaphore(DirectX::hRenderSemaphore, 1, NULL); 13 | } 14 | 15 | RenderCmdQueue& ImGuiRenderer::GetCmdQueue() 16 | { 17 | return s_CmdQueue; 18 | } -------------------------------------------------------------------------------- /gui/Renderer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RenderCmd.hpp" 4 | 5 | #include 6 | #include 7 | 8 | class ImGuiRenderer 9 | { 10 | public: 11 | using RenderCommandFunc = void(*)(void*); 12 | 13 | template 14 | static void Submit(Function&& function) 15 | { 16 | auto renderCmd = [](void* ptr) { 17 | auto pFunction = (Function*)ptr; 18 | (*pFunction)(); 19 | 20 | //static_assert(std::is_trivially_destructible_v, "Function must be trivially destructible"); 21 | pFunction->~Function(); 22 | }; 23 | auto storageBuffer = GetCmdQueue().Allocate(renderCmd, sizeof(function)); 24 | new (storageBuffer) Function(std::forward(function)); 25 | } 26 | 27 | static void ExecuteQueue(); 28 | private: 29 | static RenderCmdQueue& GetCmdQueue(); 30 | }; -------------------------------------------------------------------------------- /gui/console.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "console.hpp" 3 | #include "imgui/imgui.h" 4 | #include "gui-helpers.hpp" 5 | #include "state.hpp" 6 | #include "logger.h" 7 | 8 | namespace ConsoleGui 9 | { 10 | std::vector> event_filter = 11 | { 12 | #define ADD_EVENT(name, desc) {desc, false} 13 | ALL_EVENTS 14 | #undef ADD_EVENT 15 | }; 16 | 17 | std::array, Game::MAX_PLAYERS> player_filter; 18 | 19 | bool init = false; 20 | void Init() { 21 | ImGui::SetNextWindowSize(ImVec2(520, 320) * State.dpiScale, ImGuiCond_None); 22 | ImGui::SetNextWindowBgAlpha(State.MenuThemeColor.w); 23 | 24 | if (!init) 25 | { 26 | for (auto it = event_filter.begin(); it != event_filter.end(); it++) { 27 | // Exclude the following events 28 | switch (static_cast(it - event_filter.begin())) { 29 | case EVENT_TYPES::EVENT_WALK: 30 | it->first = ""; 31 | break; 32 | } 33 | } 34 | init = true; 35 | } 36 | } 37 | 38 | 39 | void Render() { 40 | ConsoleGui::Init(); 41 | ImGui::Begin("###Console", &State.ShowConsole, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoTitleBar); 42 | static ImVec4 titleCol = State.MenuThemeColor; 43 | if (State.RgbMenuTheme) 44 | titleCol = State.RgbColor; 45 | else 46 | titleCol = State.GradientMenuTheme ? State.MenuGradientColor : State.MenuThemeColor; 47 | titleCol.w = 1.f; 48 | ImGui::TextColored(titleCol, "Console"); 49 | ImGui::SameLine(ImGui::GetWindowWidth() - 20 * State.dpiScale); 50 | if (AnimatedButton("-")) State.ShowConsole = false; //minimize button 51 | ImGui::BeginChild("console#filter", ImVec2(520, 40) * State.dpiScale, true, ImGuiWindowFlags_NoBackground); 52 | ImGui::Text("Event Filter: "); 53 | ImGui::SameLine(); 54 | CustomListBoxIntMultiple("Event Types", &ConsoleGui::event_filter, 100.f * State.dpiScale); 55 | if (IsInGame()) { 56 | ImGui::SameLine(0.f * State.dpiScale, 5.f * State.dpiScale); 57 | ImGui::Text("Player Filter: "); 58 | ImGui::SameLine(); 59 | CustomListBoxPlayerSelectionMultiple("Players", &ConsoleGui::player_filter, 150.f * State.dpiScale); 60 | } 61 | if (AnimatedButton("Clear Console")) { 62 | synchronized(Replay::replayEventMutex) { 63 | State.liveConsoleEvents.clear(); 64 | } 65 | } 66 | ImGui::EndChild(); 67 | ImGui::Separator(); 68 | ImGui::BeginChild("console#scroll", ImVec2(511, 270) * State.dpiScale, true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoBackground); 69 | 70 | // pre-processing of filters 71 | bool isUsingEventFilter = false, isUsingPlayerFilter = false; 72 | for (const auto& pair : ConsoleGui::event_filter) { 73 | if (pair.second) { 74 | isUsingEventFilter = true; 75 | break; 76 | } 77 | } 78 | for (auto& pair : ConsoleGui::player_filter) { 79 | if (pair.second && pair.first.has_value()) { 80 | isUsingPlayerFilter = true; 81 | break; 82 | } 83 | } 84 | 85 | synchronized(Replay::replayEventMutex) { 86 | size_t i = State.liveConsoleEvents.size() - 1; 87 | for (auto rit = State.liveConsoleEvents.rbegin(); rit != State.liveConsoleEvents.rend(); ++rit, --i) { 88 | EventInterface* evt = (*rit).get(); 89 | if (evt == NULL) 90 | { 91 | STREAM_ERROR("State.liveConsoleEvents[" << i << "] was NULL (liveConsoleEvents.size(): " << State.liveConsoleEvents.size() << ")"); 92 | continue; 93 | } 94 | if (evt->getType() == EVENT_TYPES::EVENT_WALK) 95 | continue; 96 | 97 | if (isUsingEventFilter && ConsoleGui::event_filter.at((size_t)evt->getType()).second == false) 98 | continue; 99 | if (isUsingPlayerFilter) { 100 | if (evt->getSource().playerId < 0 || evt->getSource().playerId >= ConsoleGui::player_filter.size()) 101 | continue; 102 | auto& p = ConsoleGui::player_filter.at(evt->getSource().playerId); 103 | if (p.second == false) 104 | continue; 105 | if (!p.first.has_value()) 106 | continue; 107 | } 108 | 109 | evt->ColoredEventOutput(); 110 | ImGui::SameLine(); 111 | evt->Output(); 112 | } 113 | } 114 | ImGui::EndChild(); 115 | ImGui::End(); 116 | } 117 | } -------------------------------------------------------------------------------- /gui/console.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ConsoleGui { 5 | void Init(); 6 | void Render(); 7 | }; -------------------------------------------------------------------------------- /gui/esp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "state.hpp" 7 | #include "game.h" 8 | #include "DirectX.h" 9 | #include 10 | 11 | static bool IsWithinScreenBounds(const Vector2& pos) 12 | { 13 | return pos.x < (float)Screen_get_width(nullptr) && pos.y < (float)Screen_get_height(nullptr); 14 | } 15 | 16 | static float GetScaleFromValue(float value) 17 | { 18 | // NOTE : The res of the game can not be lower than the desktop res if the game is in fullscreen. 19 | // We always need to divide the camera height by 3 (not required as default zoom is now 1) 20 | // since 3 is the default zoom in the menu for some reason. (changed it to 1 XD) 21 | // We offset from 1080 since the w2s scale is defaulted to that. 22 | float scale = DirectX::GetWindowSize().y / 1080.0f; 23 | 24 | // If we enable zoom then we scale but otherwise don't 25 | float cameraHeight = (State.EnableZoom && !State.InMeeting) ? State.CameraHeight : 1.0f; 26 | return (value * scale) / cameraHeight; 27 | } 28 | 29 | static ImVec2 WorldToScreen(const Vector2& pos) 30 | { 31 | auto mainCamera = Camera_get_main(nullptr); 32 | Transform* cameraTransform = Component_get_transform(reinterpret_cast(mainCamera), nullptr); 33 | Vector3 cameraPosition = Transform_get_position(cameraTransform, nullptr); 34 | const Vector2& localPos = PlayerControl_GetTruePosition(*Game::pLocalPlayer, nullptr); 35 | 36 | // Calculation to compensate for Camera movement 37 | cameraPosition.x = localPos.x - (localPos.x - cameraPosition.x); 38 | cameraPosition.y = localPos.y - (localPos.y - cameraPosition.y); 39 | 40 | // The value 180 is specific for 1920x1080 so we need to scale it for other resolutions. 41 | // Scaling from the x axis would probably also work but now we scale from the y axis. 42 | float view = GetScaleFromValue(180.0f); 43 | const ImVec2 winsize = DirectX::GetWindowSize(); 44 | 45 | // Here we transform the world position to the screen position 46 | ImVec2 value; 47 | value.x = (pos.x - cameraPosition.x) * view + winsize.x * 0.5f; 48 | value.y = (cameraPosition.y - pos.y) * view + winsize.y * 0.5f; 49 | 50 | return value; 51 | } 52 | 53 | static Vector2 ScreenToWorld(Vector2 pos) 54 | { 55 | auto mainCamera = Camera_get_main(nullptr); 56 | Vector3 vec3 = Camera_ScreenToWorldPoint(mainCamera, { pos.x, pos.y, 0 }, nullptr); 57 | return { vec3.x, vec3.y }; 58 | } 59 | 60 | struct EspPlayerData 61 | { 62 | ImVec2 Position = { 0.0f, 0.0f }; 63 | ImVec4 Color{ 0.0f, 0.0f, 0.0f, 0.0f }; 64 | 65 | std::string Name = std::string(); 66 | 67 | float Distance = 0.0f; 68 | bool OnScreen = false; 69 | 70 | PlayerSelection playerData; 71 | }; 72 | 73 | typedef struct Drawing 74 | { 75 | std::mutex m_DrawingMutex; 76 | 77 | std::array m_Players; 78 | 79 | ImVec2 LocalPosition{ 0.0f, 0.0f }; 80 | } drawing_t; 81 | 82 | class Esp 83 | { 84 | public: 85 | static void Render(); 86 | static void Credit(); 87 | 88 | static drawing_t& GetDrawing() { return *s_Instance; } 89 | private: 90 | static drawing_t* s_Instance; 91 | }; -------------------------------------------------------------------------------- /gui/gui-helpers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "utility.h" 5 | #ifndef IMGUI_DEFINE_MATH_OPERATORS 6 | #define IMGUI_DEFINE_MATH_OPERATORS 7 | #endif 8 | #include "imgui/imgui_internal.h" 9 | #include "state.hpp" 10 | 11 | static inline ImVec2 operator+(const ImVec2& lhs, const float scalar) { return ImVec2(lhs.x + scalar, lhs.y + scalar); } 12 | static inline ImVec2 operator-(const ImVec2& lhs, const float scalar) { return ImVec2(lhs.x - scalar, lhs.y - scalar); } 13 | static inline ImVec2& operator+=(ImVec2& lhs, const float scalar) { lhs.x += scalar; lhs.y += scalar; return lhs; } 14 | static inline ImVec2& operator-=(ImVec2& lhs, const float scalar) { lhs.x -= scalar; lhs.y -= scalar; return lhs; } 15 | 16 | bool CustomListBoxInt(const char* label, int* value, const std::vector list, float width = 225.f, ImVec4 col = ImVec4(0, 0, 0, 0), ImGuiComboFlags flags = ImGuiComboFlags_None, const char* visualLabel = ""); 17 | bool CustomListBoxIntMultiple(const char* label, std::vector>* list, float width, bool resetButton = true, ImGuiComboFlags flags = ImGuiComboFlags_None); 18 | bool CustomListBoxPlayerSelectionMultiple(const char* label, std::array, Game::MAX_PLAYERS>* list, float width, bool resetButton = true, ImGuiComboFlags flags = ImGuiComboFlags_None); 19 | bool SteppedSliderFloat(const char* label, float* v, float v_min, float v_max, float v_step, const char* format, ImGuiSliderFlags flags); 20 | bool SliderChrono(const char* label, void* p_data, const void* p_min, const void* p_max, std::string_view format, ImGuiSliderFlags flags = ImGuiSliderFlags_None); 21 | bool HotKey(uint8_t& key); 22 | void drawPlayerDot(PlayerControl* player, const ImVec2& winPos, ImU32 color, ImU32 statusColor); 23 | void drawPlayerIcon(PlayerControl* player, const ImVec2& winPos, ImU32 color); 24 | void drawDeadPlayerDot(DeadBody* deadBody, const ImVec2& winPos, ImU32 color); 25 | void drawDeadPlayerIcon(DeadBody* deadBody, const ImVec2& winPos, ImU32 color); 26 | bool InputString(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 27 | bool InputStringMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 28 | bool InputStringWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 29 | bool ToggleButton(const char* str_id, bool* v); 30 | bool TabGroup(const char* label, bool highlight = false); 31 | bool ColoredButton(ImVec4 col, const char* label); 32 | void BoldText(const char* text, ImVec4 col = ImVec4(0.f, 0.f, 0.f, 0.f)); 33 | bool SliderIntV2(const char* label, int* v, int v_min, int v_max, const char* format, ImGuiSliderFlags flags); 34 | bool AnimatedButton(const char* label, const ImVec2& size = ImVec2(0, 0)); -------------------------------------------------------------------------------- /gui/menu.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Menu { 4 | enum Tabs { 5 | About, 6 | Settings, 7 | Game, 8 | Self, 9 | Radar, 10 | Replay, 11 | Esp, 12 | Players, 13 | Tasks, 14 | Sabotage, 15 | Doors, 16 | Host, 17 | Debug 18 | }; 19 | void CloseAllOtherTabs(Tabs openTab); 20 | void Init(); 21 | void Render(); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /gui/radar.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "radar.hpp" 3 | #include "DirectX.h" 4 | #include "utility.h" 5 | #include "state.hpp" 6 | #include "gui-helpers.hpp" 7 | 8 | namespace Radar { 9 | ImU32 GetRadarPlayerColor(NetworkedPlayerInfo* playerData) { 10 | auto outfit = GetPlayerOutfit(playerData); 11 | if (outfit == NULL) return ImU32(0); 12 | 13 | return ImGui::ColorConvertFloat4ToU32(AmongUsColorToImVec4((GetPlayerColor(outfit->fields.ColorId)))); 14 | } 15 | 16 | ImU32 GetRadarPlayerColorStatus(NetworkedPlayerInfo* playerData) { 17 | if (State.RevealRoles && playerData->fields.Role != nullptr) 18 | return ImGui::ColorConvertFloat4ToU32(AmongUsColorToImVec4(GetRoleColor(playerData->fields.Role))); 19 | else if (playerData->fields.IsDead) 20 | return ImGui::ColorConvertFloat4ToU32(AmongUsColorToImVec4(app::Palette__TypeInfo->static_fields->HalfWhite)); 21 | else 22 | return ImGui::ColorConvertFloat4ToU32(ImVec4(0, 0, 0, 0)); 23 | } 24 | 25 | void SquareConstraint(ImGuiSizeCallbackData* data) 26 | { 27 | data->DesiredSize = ImVec2(data->DesiredSize.x, data->DesiredSize.y); 28 | } 29 | 30 | void OnClick() { 31 | if (!ImGui::IsKeyPressed(VK_SHIFT) && !ImGui::IsKeyDown(VK_SHIFT) && !ImGui::IsKeyDown(VK_CONTROL) && (ImGui::IsMouseClicked(ImGuiMouseButton_Right) || ImGui::IsMouseDown(ImGuiMouseButton_Right))) { 32 | ImVec2 mouse = ImGui::GetMousePos(); 33 | ImVec2 winpos = ImGui::GetWindowPos(); 34 | ImVec2 winsize = ImGui::GetWindowSize(); 35 | 36 | if (mouse.x < winpos.x 37 | || mouse.x > winpos.x + winsize.x 38 | || mouse.y < winpos.y 39 | || mouse.y > winpos.y + winsize.y) 40 | return; 41 | 42 | const auto& map = maps[(size_t)State.mapType]; 43 | float xOffset = getMapXOffsetSkeld(map.x_offset) + (float)State.RadarExtraWidth; 44 | float yOffset = map.y_offset + (float)State.RadarExtraHeight; 45 | 46 | Vector2 target = { 47 | ((mouse.x - winpos.x) / State.dpiScale - xOffset) / map.scale, 48 | (((mouse.y - winpos.y) / State.dpiScale - yOffset) * -1.F) / map.scale 49 | }; 50 | 51 | static int tpDelay = 0; 52 | 53 | if (ImGui::IsMouseClicked(ImGuiMouseButton_Right)) State.rpcQueue.push(new RpcSnapTo(target)); 54 | else if (ImGui::IsMouseDown(ImGuiMouseButton_Right)) { 55 | if (tpDelay <= 0) { 56 | State.rpcQueue.push(new RpcSnapTo(target)); 57 | tpDelay = int(0.1 * GetFps()); 58 | } 59 | else tpDelay--; 60 | } 61 | } 62 | if (State.TeleportEveryone && !(ImGui::IsKeyDown(VK_CONTROL) || ImGui::IsKeyDown(VK_SHIFT)) && (ImGui::IsKeyPressed(0x12) || ImGui::IsKeyDown(0x12)) && ImGui::IsMouseClicked(ImGuiMouseButton_Right)) { 63 | ImVec2 mouse = ImGui::GetMousePos(); 64 | ImVec2 winpos = ImGui::GetWindowPos(); 65 | ImVec2 winsize = ImGui::GetWindowSize(); 66 | 67 | if (mouse.x < winpos.x 68 | || mouse.x > winpos.x + winsize.x 69 | || mouse.y < winpos.y 70 | || mouse.y > winpos.y + winsize.y) 71 | return; 72 | 73 | const auto& map = maps[(size_t)State.mapType]; 74 | float xOffset = getMapXOffsetSkeld(map.x_offset) + (float)State.RadarExtraWidth; 75 | float yOffset = map.y_offset + (float)State.RadarExtraHeight; 76 | 77 | Vector2 target = { 78 | ((mouse.x - winpos.x) / State.dpiScale - xOffset) / map.scale, 79 | (((mouse.y - winpos.y) / State.dpiScale - yOffset) * -1.F) / map.scale 80 | }; 81 | 82 | for (auto player : GetAllPlayerControl()) { 83 | State.rpcQueue.push(new RpcForceSnapTo(player, target)); 84 | } 85 | } 86 | } 87 | 88 | void Init() { 89 | ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), SquareConstraint); 90 | ImGui::SetNextWindowBgAlpha(0.F); 91 | } 92 | 93 | bool init = false; 94 | void Render() { 95 | if (!init) 96 | Radar::Init(); 97 | 98 | const auto& map = maps[(size_t)State.mapType]; 99 | ImGui::SetNextWindowSize(ImVec2((float)map.mapImage.imageWidth * 0.5F + 10.F + 2.f * State.RadarExtraWidth, (float)map.mapImage.imageHeight * 0.5f + 10.f + 2.f * State.RadarExtraHeight) * State.dpiScale, ImGuiCond_None); 100 | 101 | if (State.LockRadar) 102 | ImGui::Begin("Radar", &State.ShowRadar, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove); 103 | else 104 | ImGui::Begin("Radar", &State.ShowRadar, ImGuiWindowFlags_NoDecoration); 105 | 106 | ImVec2 winpos = ImGui::GetWindowPos(); 107 | 108 | if (State.RadarBorder) { 109 | const ImVec2 points[] = { {winpos.x + 3.f * State.dpiScale, winpos.y + 1.f * State.dpiScale}, {winpos.x - 5.f * State.dpiScale + ImGui::GetWindowWidth(), winpos.y + 1.f * State.dpiScale}, {winpos.x - 5.f * State.dpiScale + ImGui::GetWindowWidth(), winpos.y + ImGui::GetWindowHeight() - 4.f * State.dpiScale}, {winpos.x + 3.f * State.dpiScale, winpos.y + ImGui::GetWindowHeight() - 4.f * State.dpiScale}, {winpos.x + 3.f * State.dpiScale, winpos.y + 1.f * State.dpiScale} }; 110 | for (size_t i = 0; i < std::size(points); i++) { 111 | ImGui::GetCurrentWindow()->DrawList->AddLine(points[i], points[i + 1], State.RgbMenuTheme ? ImGui::GetColorU32(ImVec4(State.RgbColor.x, State.RgbColor.y, State.RgbColor.z, State.SelectedColor.w)) : ImGui::GetColorU32(State.SelectedColor), 2.f); 112 | } 113 | } 114 | 115 | ImVec4 RadarColor = ImVec4(1.f, 1.f, 1.f, 0.75f); 116 | if (State.RgbMenuTheme) 117 | RadarColor = { State.RgbColor.x, State.RgbColor.y, State.RgbColor.z, State.SelectedColor.w }; 118 | else 119 | RadarColor = State.SelectedColor; 120 | 121 | GameOptions options; 122 | 123 | ImGui::Image((void*)map.mapImage.shaderResourceView, 124 | ImVec2((float)map.mapImage.imageWidth * 0.5F, (float)map.mapImage.imageHeight * 0.5F) * State.dpiScale, 125 | ImVec2((float)State.RadarExtraWidth * State.dpiScale, (float)State.RadarExtraHeight * State.dpiScale), 126 | (State.FlipSkeld && State.mapType == Settings::MapType::Ship) ? ImVec2(1.0f, 0.0f) : ImVec2(0.0f, 0.0f), 127 | (State.FlipSkeld && State.mapType == Settings::MapType::Ship) ? ImVec2(0.0f, 1.0f) : ImVec2(1.0f, 1.0f), 128 | RadarColor); 129 | 130 | for (auto player : GetAllPlayerControl()) { 131 | auto playerData = GetPlayerData(player); 132 | 133 | if (!playerData || (!State.ShowRadar_Ghosts && playerData->fields.IsDead)) 134 | continue; 135 | 136 | if (State.RadarDrawIcons) 137 | drawPlayerIcon(player, winpos, GetRadarPlayerColor(playerData)); 138 | else 139 | drawPlayerDot(player, winpos, GetRadarPlayerColor(playerData), GetRadarPlayerColorStatus(playerData)); 140 | } 141 | 142 | if (State.ShowRadar_DeadBodies) { 143 | for (auto deadBody : GetAllDeadBodies()) { 144 | auto playerData = GetPlayerDataById(deadBody->fields.ParentId); 145 | 146 | if (State.RadarDrawIcons) 147 | drawDeadPlayerIcon(deadBody, winpos, GetRadarPlayerColor(playerData)); 148 | else 149 | drawDeadPlayerDot(deadBody, winpos, GetRadarPlayerColor(playerData)); 150 | } 151 | } 152 | 153 | if (State.ShowRadar_RightClickTP) 154 | OnClick(); 155 | 156 | ImGui::End(); 157 | } 158 | } -------------------------------------------------------------------------------- /gui/radar.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Radar 4 | { 5 | void Init(); 6 | void Render(); 7 | } -------------------------------------------------------------------------------- /gui/replay.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "imgui/imgui.h" 3 | #include 4 | #include 5 | #include "game.h" 6 | 7 | namespace Replay 8 | { 9 | extern std::mutex replayEventMutex; 10 | void Init(); 11 | void Reset(bool all = true); 12 | void Render(); 13 | 14 | struct WalkEvent_LineData 15 | { 16 | Game::PlayerId playerId = Game::NoPlayerId; 17 | Game::ColorId colorId = Game::NoColorId; 18 | std::vector pendingPoints; 19 | std::vector pendingTimeStamps; 20 | 21 | std::vector simplifiedPoints; 22 | std::vector simplifiedTimeStamps; 23 | }; 24 | } -------------------------------------------------------------------------------- /gui/tabs/about_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace AboutTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/debug_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "debug_tab.h" 3 | #include "imgui/imgui.h" 4 | #include "state.hpp" 5 | #include "main.h" 6 | #include "game.h" 7 | #include "profiler.h" 8 | #include "logger.h" 9 | #include 10 | #include 11 | #include "gui-helpers.hpp" 12 | 13 | namespace DebugTab { 14 | 15 | void Render() { 16 | ImGui::SameLine(100 * State.dpiScale); 17 | ImGui::BeginChild("###Debug", ImVec2(500, 0) * State.dpiScale, true, ImGuiWindowFlags_NoBackground); 18 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 19 | #ifndef _VERSION 20 | if (AnimatedButton("Unload DLL")) 21 | { 22 | SetEvent(hUnloadEvent); 23 | } 24 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 25 | #endif 26 | ToggleButton("Enable Occlusion Culling", &State.OcclusionCulling); 27 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 28 | 29 | if (AnimatedButton("Force Load Settings")) 30 | { 31 | State.Load(); 32 | } 33 | if (AnimatedButton("Force Save Settings")) 34 | { 35 | State.Save(); 36 | } 37 | if (AnimatedButton("Clear RPC Queues")) 38 | { 39 | State.rpcQueue = std::queue(); 40 | State.lobbyRpcQueue = std::queue(); 41 | } 42 | 43 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 44 | 45 | if (ToggleButton("Log Unity Debug Messages", &State.ShowUnityLogs)) State.Save(); 46 | if (ToggleButton("Log Hook Debug Messages", &State.ShowHookLogs)) State.Save(); 47 | 48 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 49 | 50 | if (ImGui::CollapsingHeader("Replay##debug")) 51 | { 52 | synchronized(Replay::replayEventMutex) { 53 | size_t numWalkPoints = 0; 54 | for (const auto& pair : State.replayWalkPolylineByPlayer) { 55 | numWalkPoints += pair.second.pendingPoints.size() + pair.second.simplifiedPoints.size(); 56 | } 57 | ImGui::Text("Num Walk Points: %d", numWalkPoints); 58 | ImGui::Text("Num Live Replay Events: %d", State.liveReplayEvents.size()); 59 | ImGui::Text("Num Live Console Events: %d", State.liveConsoleEvents.size()); 60 | } 61 | 62 | ImGui::Text("ReplayMatchStart: %s", std::format("{:%OH:%OM:%OS}", State.MatchStart).c_str()); 63 | ImGui::Text("ReplayMatchCurrent: %s", std::format("{:%OH:%OM:%OS}", State.MatchCurrent).c_str()); 64 | ImGui::Text("ReplayMatchLive: %s", std::format("{:%OH:%OM:%OS}", std::chrono::system_clock::now()).c_str()); 65 | ImGui::Text("ReplayIsLive: %s", (State.Replay_IsLive) ? "True" : "False"); 66 | ImGui::Text("ReplayIsPlaying: %s", (State.Replay_IsPlaying) ? "True" : "False"); 67 | 68 | if (AnimatedButton("Re-simplify polylines (check console)")) 69 | { 70 | SYNCHRONIZED(Replay::replayEventMutex); 71 | for (auto& playerPolylinePair : State.replayWalkPolylineByPlayer) 72 | { 73 | std::vector resimplifiedPoints; 74 | std::vector resimplifiedTimeStamps; 75 | Replay::WalkEvent_LineData& plrLineData = playerPolylinePair.second; 76 | size_t numOldSimpPoints = plrLineData.simplifiedPoints.size(); 77 | DoPolylineSimplification(plrLineData.simplifiedPoints, plrLineData.simplifiedTimeStamps, resimplifiedPoints, resimplifiedTimeStamps, 50.f, false); 78 | STREAM_DEBUG("Player[" << playerPolylinePair.first << "]: Re-simplification could reduce " << numOldSimpPoints << " points to " << resimplifiedPoints.size()); 79 | } 80 | } 81 | } 82 | 83 | if (ImGui::CollapsingHeader("Colors##debug")) 84 | { 85 | il2cpp::Array colArr = app::Palette__TypeInfo->static_fields->PlayerColors; 86 | auto colArr_raw = colArr.begin(); 87 | size_t length = colArr.size(); 88 | for (size_t i = 0; i < length; i++) 89 | { 90 | const app::Color32& col = colArr_raw[i]; 91 | const ImVec4& conv_col = AmongUsColorToImVec4(col); 92 | static constexpr std::array COLORS = { "Red", "Blue", "Green", "Pink", "Orange", "Yellow", "Black", "White", "Purple", "Brown", "Cyan", "Lime", "Maroon", "Rose", "Banana", "Gray", "Tan", "Coral", "Fortegreen" }; 93 | ImGui::TextColored(conv_col, "%s [%d]: (%d, %d, %d, %d)", COLORS.at(i), i, col.r, col.g, col.b, col.a); 94 | } 95 | } 96 | 97 | if (ImGui::CollapsingHeader("Profiler##debug")) 98 | { 99 | if (AnimatedButton("Clear Stats")) 100 | { 101 | Profiler::ClearStats(); 102 | } 103 | 104 | std::stringstream statStream; 105 | Profiler::AppendStatStringStream("WalkEventCreation", statStream); 106 | Profiler::AppendStatStringStream("ReplayRender", statStream); 107 | Profiler::AppendStatStringStream("ReplayPolyline", statStream); 108 | Profiler::AppendStatStringStream("PolylineSimplification", statStream); 109 | Profiler::AppendStatStringStream("ReplayPlayerIcons", statStream); 110 | Profiler::AppendStatStringStream("ReplayEventIcons", statStream); 111 | // NOTE: 112 | // can also just do this to dump all stats, but i like doing them individually so i can control the order better: 113 | // Profiler::WriteStatsToStream(statStream); 114 | 115 | ImGui::TextUnformatted(statStream.str().c_str()); 116 | } 117 | 118 | ImGui::Text(std::format("Active Scene: {}", State.CurrentScene).c_str()); 119 | 120 | if (ImGui::CollapsingHeader("Experiments##debug")) { 121 | ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "These features are in development and can break at any time."); 122 | ImGui::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Use these at your own risk."); 123 | if (ToggleButton("Point System (Only for Hosting)", &State.TournamentMode)) State.Save(); 124 | if (ToggleButton("April Fools' Mode", &State.AprilFoolsMode)) State.Save(); 125 | static float timer = 0.0f; 126 | static bool SafeModeNotification = false; 127 | if (ToggleButton("Safe Mode", &State.SafeMode)) { 128 | State.Save(); 129 | SafeModeNotification = true; 130 | timer = static_cast(ImGui::GetTime()); 131 | } 132 | 133 | if (SafeModeNotification) { 134 | float currentTime = static_cast(ImGui::GetTime()); 135 | 136 | if (currentTime - timer < 5.0f) { 137 | ImGui::SameLine(); 138 | if (State.SafeMode) 139 | ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f), "Safe Mode is Enabled!"); 140 | else 141 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Safe Mode is Disabled! (The likelihood of getting banned increases)"); 142 | } 143 | else { 144 | SafeModeNotification = false; 145 | } 146 | } 147 | 148 | ImGui::Text("Keep safe mode on in official servers (NA, Europe, Asia) to prevent anticheat detection!"); 149 | } 150 | 151 | if (ImGui::CollapsingHeader("ImGui Playground##debug")) { 152 | static bool testBool1 = false; 153 | ToggleButton("Test Bool 1", &testBool1); 154 | static bool testBool2 = true; 155 | ToggleButton("Test Bool 2", &testBool2); 156 | if (ToggleButton("Disable Animations", &State.DisableAnimations)) 157 | State.Save(); 158 | if (ImGui::InputFloat("Animation Speed", &State.AnimationSpeed)) 159 | State.Save(); 160 | AnimatedButton("Test Animated Button 1"); 161 | AnimatedButton("Test Animated Button 2"); 162 | } 163 | 164 | ImGui::EndChild(); 165 | } 166 | } -------------------------------------------------------------------------------- /gui/tabs/debug_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DebugTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/doors_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "doors_tab.h" 3 | #include "game.h" 4 | #include "gui-helpers.hpp" 5 | #include "imgui/imgui.h" 6 | #include "state.hpp" 7 | #include "utility.h" 8 | #include "gui-helpers.hpp" 9 | 10 | using namespace std::string_view_literals; 11 | 12 | namespace DoorsTab { 13 | void Render() { 14 | if (IsInGame() && !State.mapDoors.empty()) { 15 | ImGui::SameLine(100 * State.dpiScale); 16 | ImGui::BeginChild("doors#list", ImVec2(200, 0) * State.dpiScale, true, ImGuiWindowFlags_NoBackground); 17 | bool shouldEndListBox = ImGui::ListBoxHeader("###doors#list", ImVec2(200, 150) * State.dpiScale); 18 | for (auto systemType : State.mapDoors) { 19 | if (systemType == SystemTypes__Enum::Decontamination 20 | || systemType == SystemTypes__Enum::Decontamination2 21 | || systemType == SystemTypes__Enum::Decontamination3) { 22 | continue; 23 | } 24 | bool isOpen; 25 | auto openableDoor = GetOpenableDoorByRoom(systemType); 26 | if ("PlainDoor"sv == openableDoor->klass->parent->name 27 | || "PlainDoor"sv == openableDoor->klass->name) { 28 | isOpen = reinterpret_cast(openableDoor)->fields.Open; 29 | } 30 | else if ("MushroomWallDoor"sv == openableDoor->klass->name) { 31 | isOpen = reinterpret_cast(openableDoor)->fields.open; 32 | } 33 | else { 34 | continue; 35 | } 36 | if (!(std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), systemType) == State.pinnedDoors.end())) 37 | { 38 | ImGui::PushStyleColor(ImGuiCol_Text, { 1.f, 0.f, 0.f, 1.f }); 39 | if (ImGui::Selectable(TranslateSystemTypes(systemType), State.selectedDoor == systemType)) 40 | State.selectedDoor = systemType; 41 | ImGui::PopStyleColor(1); 42 | } 43 | else if (!isOpen) 44 | { 45 | ImGui::PushStyleColor(ImGuiCol_Text, State.RgbMenuTheme ? State.RgbColor : State.MenuThemeColor); 46 | if (ImGui::Selectable(TranslateSystemTypes(systemType), State.selectedDoor == systemType)) 47 | State.selectedDoor = systemType; 48 | ImGui::PopStyleColor(1); 49 | } 50 | else 51 | { 52 | if (ImGui::Selectable(TranslateSystemTypes(systemType), State.selectedDoor == systemType)) 53 | State.selectedDoor = systemType; 54 | } 55 | } 56 | if (shouldEndListBox) 57 | ImGui::ListBoxFooter(); 58 | ImGui::EndChild(); 59 | 60 | ImGui::SameLine(); 61 | ImGui::BeginChild("doors#options", ImVec2(300, 0) * State.dpiScale, false, ImGuiWindowFlags_NoBackground); 62 | 63 | if (IsHost() && State.DisableSabotages) { 64 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Sabotages have been disabled."); 65 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Nothing can be sabotaged."); 66 | } 67 | 68 | if (AnimatedButton("Close All Doors")) 69 | { 70 | for (auto door : State.mapDoors) 71 | { 72 | State.rpcQueue.push(new RpcCloseDoorsOfType(door, false)); 73 | } 74 | } 75 | 76 | if (AnimatedButton("Close Room Door")) 77 | { 78 | State.rpcQueue.push(new RpcCloseDoorsOfType(GetSystemTypes(GetTrueAdjustedPosition(*Game::pLocalPlayer)), false)); 79 | } 80 | 81 | if (State.mapType == Settings::MapType::Pb || State.mapType == Settings::MapType::Airship || State.mapType == Settings::MapType::Fungle) { 82 | if (AnimatedButton("Open All Doors")) 83 | { 84 | for (auto door : State.mapDoors) 85 | { 86 | State.rpcQueue.push(new RpcOpenDoorsOfType(door)); 87 | } 88 | } 89 | 90 | if (AnimatedButton("Open Room Door")) 91 | { 92 | State.rpcQueue.push(new RpcOpenDoorsOfType(GetSystemTypes(GetTrueAdjustedPosition(*Game::pLocalPlayer)))); 93 | } 94 | } 95 | 96 | if (AnimatedButton("Pin All Doors")) 97 | { 98 | for (auto door : State.mapDoors) 99 | { 100 | if (std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), door) == State.pinnedDoors.end()) 101 | { 102 | if (door != SystemTypes__Enum::Decontamination && door != SystemTypes__Enum::Decontamination2 && door != SystemTypes__Enum::Decontamination3) 103 | State.rpcQueue.push(new RpcCloseDoorsOfType(door, true)); 104 | } 105 | } 106 | } 107 | if (AnimatedButton("Unpin All Doors")) 108 | { 109 | State.pinnedDoors.clear(); 110 | } 111 | 112 | ImGui::NewLine(); 113 | if (State.selectedDoor != SystemTypes__Enum::Hallway) { 114 | auto plainDoor = GetPlainDoorByRoom(State.selectedDoor); 115 | 116 | if (AnimatedButton("Close Door")) { 117 | State.rpcQueue.push(new RpcCloseDoorsOfType(State.selectedDoor, false)); 118 | } 119 | 120 | if (std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), State.selectedDoor) == State.pinnedDoors.end()) { 121 | if (AnimatedButton("Pin Door")) { 122 | State.rpcQueue.push(new RpcCloseDoorsOfType(State.selectedDoor, true)); 123 | } 124 | } 125 | else { 126 | if (AnimatedButton("Unpin Door")) { 127 | State.pinnedDoors.erase(std::remove(State.pinnedDoors.begin(), State.pinnedDoors.end(), State.selectedDoor), State.pinnedDoors.end()); 128 | } 129 | } 130 | 131 | if ((State.mapType == Settings::MapType::Pb || State.mapType == Settings::MapType::Airship || State.mapType == Settings::MapType::Fungle) && AnimatedButton("Open Door")) 132 | { 133 | State.rpcQueue.push(new RpcOpenDoorsOfType(State.selectedDoor)); 134 | } 135 | } 136 | if (State.mapType == Settings::MapType::Pb || State.mapType == Settings::MapType::Airship || State.mapType == Settings::MapType::Fungle) 137 | { 138 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 139 | if (ToggleButton("Auto Open Doors on Use", &State.AutoOpenDoors)) State.Save(); 140 | 141 | if (ToggleButton("Spam Open/Close Doors", &State.SpamDoors)) State.Save(); 142 | } 143 | ImGui::EndChild(); 144 | } 145 | } 146 | } -------------------------------------------------------------------------------- /gui/tabs/doors_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DoorsTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/esp_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "esp_tab.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | #include "utility.h" 6 | #include "gui-helpers.hpp" 7 | 8 | namespace EspTab { 9 | 10 | void Render() { 11 | bool changed = false; 12 | ImGui::SameLine(100 * State.dpiScale); 13 | ImGui::BeginChild("###ESP", ImVec2(500 * State.dpiScale, 0), true, ImGuiWindowFlags_NoBackground); 14 | changed |= ToggleButton("Enable", &State.ShowEsp); 15 | 16 | changed |= ToggleButton("Show Ghosts", &State.ShowEsp_Ghosts); 17 | //dead bodies for v3.1 18 | changed |= ToggleButton("Hide During Meetings", &State.HideEsp_During_Meetings); 19 | 20 | changed |= ToggleButton("Show Boxes", &State.ShowEsp_Box); 21 | changed |= ToggleButton("Show Tracers", &State.ShowEsp_Tracers); 22 | changed |= ToggleButton("Show Distances", &State.ShowEsp_Distance); 23 | //better esp (from noobuild) coming v3.1 24 | changed |= ToggleButton("Role-based", &State.ShowEsp_RoleBased); 25 | 26 | if (State.ShowEsp_RoleBased) { 27 | ImGui::SameLine(); 28 | changed |= ToggleButton("Crewmates", &State.ShowEsp_Crew); 29 | ImGui::SameLine(); 30 | changed |= ToggleButton("Impostors", &State.ShowEsp_Imp); 31 | } 32 | 33 | ImGui::EndChild(); 34 | if (changed) { 35 | State.Save(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /gui/tabs/esp_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace EspTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/game_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "state.hpp" 4 | 5 | namespace GameTab { 6 | const std::vector KILL_DISTANCE = { "Short", "Medium", "Long", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" }; 7 | const std::vector TASKBARUPDATES = { "Always", "Meetings", "Never", "3", "4", "5", "6" }; 8 | const std::vector COLORS = { "Red", "Blue", "Green", "Pink", "Orange", "Yellow", "Black", "White", "Purple", "Brown", "Cyan", "Lime", "Maroon", "Rose", "Banana", "Gray", "Tan", "Coral" }; 9 | const std::vector HOSTCOLORS = { "Red", "Blue", "Green", "Pink", "Orange", "Yellow", "Black", "White", "Purple", "Brown", "Cyan", "Lime", "Maroon", "Rose", "Banana", "Gray", "Tan", "Coral", "Fortegreen"}; 10 | const std::vector SMAC_PUNISHMENTS = { "Do Nothing", "Warn Self"/*, "Warn All (Chat)", State.SafeMode ? "Attempt to Ban" : "Attempt to Kick"*/}; 11 | const std::vector SMAC_HOST_PUNISHMENTS = { "Do Nothing", "Warn Self"/*, "Warn All (Chat)"*/, "Kick", "Ban"}; 12 | const std::vector SHIPVENTS = { "Admin", "Hallway", "Cafeteria", "Electrical", "Upper Engine", "Security", "Medbay", "Weapons", "Lower Reactor", "Lower Engine", "Shields", "Upper Reactor", "Upper Navigation", "Lower Navigation" }; 13 | const std::vector HQVENTS = { "Balcony", "Cafeteria", "Reactor", "Laboratory", "Office", "Admin", "Greenhouse", "Medbay", "Decontamination", "Locker Room", "Launchpad" }; 14 | const std::vector PBVENTS = { "Security", "Electrical", "O2", "Communications", "Office", "Admin", "Laboratory", "Lava Pool", "Storage", "Right Seismic", "Left Seismic", "Outside Admin" }; 15 | const std::vector AIRSHIPVENTS = { "Vault", "Cockpit", "Viewing Deck", "Engine", "Kitchen", "Upper Main Hall", "Lower Main Hall", "Right Gap Room", "Left Gap Room", "Showers", "Records", "Cargo Bay" }; 16 | const std::vector FUNGLEVENTS = { "Communications", "Kitchen", "Lookout", "Outside Dorm", "Laboratory", "Jungle (Laboratory)", "Jungle (Greenhouse)", "Splash Zone", "Cafeteria" }; 17 | void Render(); 18 | } -------------------------------------------------------------------------------- /gui/tabs/host_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "utility.h" 4 | 5 | namespace HostTab { 6 | const std::vector MAP_NAMES = { "The Skeld", "Mira HQ", "Polus", "ehT dlekS", "Airship", "The Fungle"}; 7 | const std::vector IMPOSTOR_COUNTS = { "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", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106", "107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148", "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161", "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174", "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213", "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226", "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239", "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252", "253", "254", "255" }; 8 | //set it to the maximum player count if you ever want to play a 100 player mod or something like that 9 | const std::vector ROLE_NAMES = { "Random", "Crewmate", "Scientist", "Engineer", "Noisemaker", "Tracker", "Impostor", "Shapeshifter", "Phantom" }; 10 | const std::vector ROLE_NAMES_NORANDOM = { "Random", "Crewmate", "Scientist", "Engineer", "Noisemaker", "Tracker", "Impostor", "Shapeshifter", "Phantom" }; 11 | const std::vector GAMEENDREASON = { "Crewmates (Votes)", "Crewmates (Tasks)", "Impostors (Votes)", "Impostors (Kill)", "Impostors (Sabotage)", "D/C (Imp)", "D/C (Crew)", "Timer (HNS)", "Kill (HNS)" }; 12 | const std::vector HOSTCOLORS = { "Red", "Blue", "Green", "Pink", "Orange", "Yellow", "Black", "White", "Purple", "Brown", "Cyan", "Lime", "Maroon", "Rose", "Banana", "Gray", "Tan", "Coral", "Fortegreen" }; 13 | void Render(); 14 | const ptrdiff_t GetRoleCount(RoleType role); 15 | } -------------------------------------------------------------------------------- /gui/tabs/players_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace PlayersTab { 4 | const std::vector FAKEROLES = { "Crewmate", "Impostor", "Scientist", "Engineer", "Guardian Angel", "Shapeshifter", "Crewmate Ghost", "Impostor Ghost", "Noisemaker", "Phantom", "Tracker" }; 5 | const std::vector GHOSTROLES = { "Guardian Angel", "Crewmate Ghost", "Impostor Ghost" }; 6 | const std::vector COLORS = { "Red", "Blue", "Green", "Pink", "Orange", "Yellow", "Black", "White", "Purple", "Brown", "Cyan", "Lime", "Maroon", "Rose", "Banana", "Gray", "Tan", "Coral", "Fortegreen" }; 7 | const std::vector SHIPVENTS = { "Admin", "Hallway", "Cafeteria", "Electrical", "Upper Engine", "Security", "Medbay", "Weapons", "Lower Reactor", "Lower Engine", "Shields", "Upper Reactor", "Upper Navigation", "Lower Navigation" }; 8 | const std::vector HQVENTS = { "Balcony", "Cafeteria", "Reactor", "Laboratory", "Office", "Admin", "Greenhouse", "Medbay", "Decontamination", "Locker Room", "Launchpad" }; 9 | const std::vector PBVENTS = { "Security", "Electrical", "O2", "Communications", "Office", "Admin", "Laboratory", "Lava Pool", "Storage", "Right Seismic", "Left Seismic", "Outside Admin" }; 10 | const std::vector AIRSHIPVENTS = { "Vault", "Cockpit", "Viewing Deck", "Engine", "Kitchen", "Upper Main Hall", "Lower Main Hall", "Right Gap Room", "Left Gap Room", "Showers", "Records", "Cargo Bay" }; 11 | const std::vector FUNGLEVENTS = { "Communications", "Kitchen", "Lookout", "Outside Dorm", "Laboratory", "Jungle (Laboratory)", "Jungle (Greenhouse)", "Splash Zone", "Cafeteria" }; 12 | void Render(); 13 | } -------------------------------------------------------------------------------- /gui/tabs/radar_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "radar_tab.h" 3 | #include "gui-helpers.hpp" 4 | #include "state.hpp" 5 | #include "utility.h" 6 | 7 | namespace RadarTab { 8 | void Render() { 9 | ImGui::SameLine(100 * State.dpiScale); 10 | ImGui::BeginChild("###Radar", ImVec2(500 * State.dpiScale, 0), true, ImGuiWindowFlags_NoBackground); 11 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 12 | if (ToggleButton("Show Radar", &State.ShowRadar)) { 13 | State.Save(); 14 | } 15 | 16 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 17 | ImGui::Separator(); 18 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 19 | 20 | if (ToggleButton("Show Dead Bodies", &State.ShowRadar_DeadBodies)) { 21 | State.Save(); 22 | } 23 | if (ToggleButton("Show Ghosts", &State.ShowRadar_Ghosts)) { 24 | State.Save(); 25 | } 26 | if (ToggleButton("Right Click to Teleport", &State.ShowRadar_RightClickTP)) { 27 | State.Save(); 28 | } 29 | 30 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 31 | ImGui::Separator(); 32 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 33 | 34 | if (ToggleButton("Hide Radar During Meetings", &State.HideRadar_During_Meetings)) { 35 | State.Save(); 36 | } 37 | if (ToggleButton("Draw Player Icons", &State.RadarDrawIcons)) { 38 | State.Save(); 39 | } 40 | /*if (State.RadarDrawIcons && State.RevealRoles) { 41 | ImGui::SameLine(); 42 | if (ToggleButton("Show Role Color on Visor", &State.RadarVisorRoleColor)) { 43 | State.Save(); 44 | } 45 | }*/ 46 | 47 | if (ToggleButton("Lock Radar Position", &State.LockRadar)) { 48 | State.Save(); 49 | } 50 | if (ToggleButton("Show Border", &State.RadarBorder)) { 51 | State.Save(); 52 | } 53 | if (ImGui::ColorEdit4("Radar Color", 54 | (float*)&State.SelectedColor, 55 | ImGuiColorEditFlags__OptionsDefault 56 | | ImGuiColorEditFlags_NoInputs 57 | | ImGuiColorEditFlags_AlphaBar 58 | | ImGuiColorEditFlags_AlphaPreview)) { 59 | State.Save(); 60 | } 61 | if (ImGui::InputInt("Extra Width", &State.RadarExtraWidth)) { 62 | State.RadarExtraWidth = abs(State.RadarExtraWidth); //prevent negatives 63 | State.Save(); 64 | } 65 | if (ImGui::InputInt("Extra Height", &State.RadarExtraHeight)) { 66 | State.RadarExtraHeight = abs(State.RadarExtraHeight); //prevent negatives 67 | State.Save(); 68 | } 69 | 70 | ImGui::EndChild(); 71 | } 72 | } -------------------------------------------------------------------------------- /gui/tabs/radar_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace RadarTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/replay_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "replay_tab.h" 3 | #include "gui-helpers.hpp" 4 | #include "state.hpp" 5 | #include 6 | 7 | namespace ReplayTab { 8 | void Render() { 9 | ImGui::SameLine(100 * State.dpiScale); 10 | ImGui::BeginChild("###Replay", ImVec2(500 * State.dpiScale, 0), true, ImGuiWindowFlags_NoBackground); 11 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 12 | if (ToggleButton("Show Replay", &State.ShowReplay)) { 13 | State.Save(); 14 | } 15 | if (ToggleButton("Show only last", &State.Replay_ShowOnlyLastSeconds)) 16 | { 17 | State.Save(); 18 | } 19 | ImGui::SameLine(); 20 | if (SliderIntV2("seconds", &State.Replay_LastSecondsValue, 1, 1200, "%d", ImGuiSliderFlags_AlwaysClamp)) 21 | { 22 | State.Save(); 23 | } 24 | 25 | if (ToggleButton("Clear after meeting", &State.Replay_ClearAfterMeeting)) 26 | { 27 | State.Save(); 28 | } 29 | 30 | if (ImGui::ColorEdit4("Replay Map Color", 31 | (float*)&State.SelectedReplayMapColor, 32 | ImGuiColorEditFlags__OptionsDefault 33 | | ImGuiColorEditFlags_NoInputs 34 | | ImGuiColorEditFlags_AlphaBar 35 | | ImGuiColorEditFlags_AlphaPreview)) { 36 | State.Save(); 37 | } 38 | ImGui::EndChild(); 39 | } 40 | } -------------------------------------------------------------------------------- /gui/tabs/replay_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ReplayTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/sabotage_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace SabotageTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/tabs/self_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace SelfTab { 4 | const std::vector TPOPTIONS = { "None", "Radar", "Anywhere" }; 5 | const std::vector FAKEROLES = { "Crewmate", "Impostor", "Scientist", "Engineer", "Guardian Angel", "Shapeshifter", "Crewmate Ghost", "Impostor Ghost", "Noisemaker", "Phantom", "Tracker" }; 6 | const std::vector NAMEGENERATION = { "Word Combo", "Random String", "Cycler Names" }; 7 | const std::vector BODYTYPES = { "Normal", "Horse", "Long" }; 8 | const std::vector FONTS = { "Barlow-Italic", "Barlow-Medium", "Barlow-Bold", "Barlow-SemiBold", "Barlow-SemiBold (Masked)", "Barlow-ExtraBold", "Barlow-BoldItalic", "Barlow-BoldItalic (Masked)", "Barlow-Black", "Barlow-Light", "Barlow-Regular", "Barlow-Regular (Masked)", "Barlow-Regular (Outline)", "Brook", "LiberationSans", "NotoSans", "VCR", "CONSOLA", "digital-7", "OCRAEXT", "DIN_Pro_Bold_700" }; 9 | //const std::vector MATERIALS = { "Barlow-Italic Outline", "Barlow-BoldItalic Outline", "Barlow-SemiBold Outline" }; 10 | void Render(); 11 | } 12 | -------------------------------------------------------------------------------- /gui/tabs/settings_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace SettingsTab { 4 | const std::vector PLATFORMS = { "Epic Games", "Steam", "Mac", "MS Store", "itch.io", "iOS", "Android", "Switch", "Xbox", "Playstation", "Unknown" }; 5 | const std::vector MODS = { "SickoMenu", "AmongUsMenu", "KillNetwork" }; 6 | void Render(); 7 | } -------------------------------------------------------------------------------- /gui/tabs/tasks_tab.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "tasks_tab.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | #include "utility.h" 6 | #include "gui-helpers.hpp" 7 | 8 | namespace TasksTab { 9 | void Render() { 10 | if (IsInGame() && GetPlayerData(*Game::pLocalPlayer)->fields.Tasks != NULL) { 11 | ImGui::SameLine(100 * State.dpiScale); 12 | ImGui::BeginChild("###Tasks", ImVec2(500 * State.dpiScale, 0), true, ImGuiWindowFlags_NoBackground); 13 | ImGui::Dummy(ImVec2(4, 4) * State.dpiScale); 14 | //if (!PlayerIsImpostor(GetPlayerData(*Game::pLocalPlayer))) { 15 | auto tasks = GetNormalPlayerTasks(*Game::pLocalPlayer); 16 | 17 | bool allTasksComplete = false; 18 | uint16_t tasksCompleted = 0; 19 | for (auto task : tasks) { 20 | if (task->fields.taskStep == task->fields.MaxStep) 21 | ++tasksCompleted; 22 | } 23 | 24 | if (tasks.size() != tasksCompleted) { 25 | if (AnimatedButton("Complete All Tasks")) { 26 | CompleteAllTasks(); 27 | } 28 | } 29 | if (!State.SafeMode) { 30 | ImGui::SameLine(); 31 | } 32 | if (!State.SafeMode && AnimatedButton("Complete Everyone's Tasks")) { 33 | for (auto player : GetAllPlayerControl()) { 34 | CompleteAllTasks(player); 35 | } 36 | } 37 | 38 | ImGui::NewLine(); 39 | 40 | for (auto task : tasks) { 41 | if (!NormalPlayerTask_get_IsComplete(task, NULL) && AnimatedButton(("Complete##Button" + std::to_string(task->fields._._Id_k__BackingField)).c_str())) { 42 | State.taskRpcQueue.push(new RpcCompleteTask(task->fields._._Id_k__BackingField)); 43 | } 44 | 45 | if (!NormalPlayerTask_get_IsComplete(task, NULL)) 46 | ImGui::SameLine(); 47 | 48 | auto taskIncompleteCol = State.LightMode ? AmongUsColorToImVec4(app::Palette__TypeInfo->static_fields->Black) : AmongUsColorToImVec4(app::Palette__TypeInfo->static_fields->White); 49 | 50 | ImGui::TextColored(NormalPlayerTask_get_IsComplete(task, NULL) 51 | ? ImVec4(0.0F, 1.0F, 0.0F, 1.0F) 52 | : taskIncompleteCol 53 | , TranslateTaskTypes(task->fields._.TaskType)); 54 | } 55 | 56 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 57 | ImGui::Separator(); 58 | ImGui::Dummy(ImVec2(7, 7) * State.dpiScale); 59 | //} 60 | 61 | GameOptions options; 62 | if (!options.GetBool(app::BoolOptionNames__Enum::VisualTasks) && ToggleButton("Bypass Visual Tasks Being Off", &State.BypassVisualTasks)) 63 | State.Save(); 64 | 65 | if (options.GetGameMode() == GameModes__Enum::Normal && !options.GetBool(app::BoolOptionNames__Enum::VisualTasks)) { 66 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Visual tasks are turned OFF in this lobby."); 67 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Any animations (other than cameras) are client-sided only!"); 68 | } 69 | else if (options.GetGameMode() == GameModes__Enum::HideNSeek) 70 | ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), "Animations other than cameras are client-sided only in Hide n Seek!"); 71 | 72 | if (State.mapType == Settings::MapType::Ship) { 73 | if (!State.BypassVisualTasks && (options.GetGameMode() == GameModes__Enum::Normal && !options.GetBool(app::BoolOptionNames__Enum::VisualTasks)) || options.GetGameMode() == GameModes__Enum::HideNSeek) { 74 | if (AnimatedButton("Play Shields Animation (Client-sided)")) 75 | { 76 | State.rpcQueue.push(new RpcPlayAnimation(1)); 77 | } 78 | } 79 | else { 80 | if (AnimatedButton("Play Shields Animation")) 81 | { 82 | State.rpcQueue.push(new RpcPlayAnimation(1)); 83 | } 84 | } 85 | } 86 | 87 | if (State.mapType == Settings::MapType::Ship) { 88 | if (!State.BypassVisualTasks && (options.GetGameMode() == GameModes__Enum::Normal && !options.GetBool(app::BoolOptionNames__Enum::VisualTasks)) || options.GetGameMode() == GameModes__Enum::HideNSeek) { 89 | if (AnimatedButton("Play Trash Animation (Client-sided)")) 90 | { 91 | State.rpcQueue.push(new RpcPlayAnimation(10)); 92 | } 93 | } 94 | else { 95 | if (AnimatedButton("Play Trash Animation")) 96 | { 97 | State.rpcQueue.push(new RpcPlayAnimation(10)); 98 | } 99 | } 100 | } 101 | 102 | if (State.mapType == Settings::MapType::Ship || State.mapType == Settings::MapType::Pb) { 103 | 104 | if (!State.BypassVisualTasks && (options.GetGameMode() == GameModes__Enum::Normal && !options.GetBool(app::BoolOptionNames__Enum::VisualTasks)) || options.GetGameMode() == GameModes__Enum::HideNSeek) { 105 | if (ToggleButton("Play Weapons Animation (Client-sided)", &State.PlayWeaponsAnimation)) 106 | { 107 | State.Save(); 108 | } 109 | } 110 | else { 111 | if (ToggleButton("Play Weapons Animation", &State.PlayWeaponsAnimation)) 112 | { 113 | State.Save(); 114 | } 115 | } 116 | } 117 | 118 | if (!State.BypassVisualTasks && (options.GetGameMode() == GameModes__Enum::Normal && !options.GetBool(app::BoolOptionNames__Enum::VisualTasks)) || options.GetGameMode() == GameModes__Enum::HideNSeek) { 119 | if (ToggleButton("Play Medbay Scan Animation (Client-sided)", &State.PlayMedbayScan)) 120 | { 121 | if (State.PlayMedbayScan) 122 | { 123 | State.rpcQueue.push(new RpcSetScanner(true)); 124 | } 125 | else 126 | { 127 | State.rpcQueue.push(new RpcSetScanner(false)); 128 | } 129 | } 130 | } 131 | else { 132 | if (ToggleButton("Play Medbay Scan Animation", &State.PlayMedbayScan)) 133 | { 134 | if (State.PlayMedbayScan) 135 | { 136 | State.rpcQueue.push(new RpcSetScanner(true)); 137 | } 138 | else 139 | { 140 | State.rpcQueue.push(new RpcSetScanner(false)); 141 | } 142 | } 143 | } 144 | 145 | if (!(State.mapType == Settings::MapType::Hq || State.mapType == Settings::MapType::Fungle) && ToggleButton("Fake Cameras In Use", &State.FakeCameraUsage)) 146 | { 147 | State.rpcQueue.push(new RpcUpdateSystem(SystemTypes__Enum::Security, (State.FakeCameraUsage ? 1 : 0))); 148 | } 149 | 150 | if (IsInMultiplayerGame() && IsInGame()) { 151 | float taskPercentage = (float)(*Game::pGameData)->fields.CompletedTasks / (float)(*Game::pGameData)->fields.TotalTasks; 152 | ImGui::TextColored(ImVec4(1.0f - taskPercentage, 1.0f, 1.0f - taskPercentage, 1.0f), "%.2f%% Total Tasks Completed", taskPercentage * 100); 153 | } 154 | 155 | ImGui::EndChild(); 156 | } 157 | } 158 | } -------------------------------------------------------------------------------- /gui/tabs/tasks_tab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TasksTab { 4 | void Render(); 5 | } -------------------------------------------------------------------------------- /gui/theme.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "theme.hpp" 3 | #include "state.hpp" 4 | #include 5 | 6 | ImVec4 HI(float v) { 7 | static ImVec4 vec = State.MenuThemeColor; 8 | if (State.RgbMenuTheme) 9 | vec = State.RgbColor; 10 | else 11 | vec = State.GradientMenuTheme ? State.MenuGradientColor : State.MenuThemeColor; 12 | return ImVec4(vec.x, vec.y, vec.z, v * State.MenuThemeColor.w); 13 | } 14 | 15 | ImVec4 MED(float v) { 16 | static ImVec4 vec = State.MenuThemeColor; 17 | if (State.RgbMenuTheme) 18 | vec = State.RgbColor; 19 | else 20 | vec = State.GradientMenuTheme ? State.MenuGradientColor : State.MenuThemeColor; 21 | return ImVec4((float)(vec.x / 1.25), (float)(vec.y / 1.25), (float)(vec.z / 1.25), v * State.MenuThemeColor.w); 22 | } 23 | 24 | ImVec4 LOW(float v) { 25 | static ImVec4 vec = State.MenuThemeColor; 26 | if (State.RgbMenuTheme) 27 | vec = State.RgbColor; 28 | else 29 | vec = State.GradientMenuTheme ? State.MenuGradientColor : State.MenuThemeColor; 30 | return ImVec4((float)(vec.x / 1.5625), (float)(vec.y / 1.5625), (float)(vec.z / 1.5625), v * State.MenuThemeColor.w); 31 | } 32 | 33 | ImVec4 BG(float bg, float v = 1) { 34 | if (!State.MatchBackgroundWithTheme) return ImVec4(bg, bg, bg, v * State.MenuThemeColor.w); 35 | else { 36 | static ImVec4 vec = State.MenuThemeColor; 37 | if (State.RgbMenuTheme) 38 | vec = State.RgbColor; 39 | else 40 | vec = State.GradientMenuTheme ? State.MenuGradientColor : State.MenuThemeColor; 41 | return ImVec4((float)(vec.x / 2), (float)(vec.y / 2), (float)(vec.z / 2), v * State.MenuThemeColor.w); 42 | } 43 | } 44 | 45 | #define IMGUI_TEXT(v) State.LightMode ? ImVec4(0.2f, 0.2f, 0.2f, v * State.MenuThemeColor.w) : ImVec4(1.f, 1.f, 1.f, v * State.MenuThemeColor.w) 46 | 47 | void ApplyTheme() 48 | { 49 | static const ImGuiStyle defaultStyle; 50 | 51 | auto& style = ImGui::GetStyle(); 52 | style = defaultStyle; 53 | style.Colors[ImGuiCol_Text] = IMGUI_TEXT(0.78f); 54 | style.Colors[ImGuiCol_TextDisabled] = IMGUI_TEXT(0.28f); 55 | style.Colors[ImGuiCol_WindowBg] = BG(0.15f); 56 | style.Colors[ImGuiCol_ChildBg] = BG(0.15f); 57 | style.Colors[ImGuiCol_PopupBg] = BG(0.230f, 0.9f); 58 | style.Colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); 59 | style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); 60 | style.Colors[ImGuiCol_FrameBg] = BG(0.230f, 1.00f); 61 | style.Colors[ImGuiCol_FrameBgHovered] = MED(0.78f); 62 | style.Colors[ImGuiCol_FrameBgActive] = MED(1.00f); 63 | style.Colors[ImGuiCol_TitleBg] = BG(0.15f); 64 | style.Colors[ImGuiCol_TitleBgActive] = BG(0.15f); 65 | style.Colors[ImGuiCol_TitleBgCollapsed] = BG(0.15f); 66 | style.Colors[ImGuiCol_Tab] = MED(0.76f); 67 | style.Colors[ImGuiCol_TabHovered] = MED(0.86f); 68 | style.Colors[ImGuiCol_TabActive] = HI(1.00f); 69 | style.Colors[ImGuiCol_MenuBarBg] = BG(0.230f, 0.47f); 70 | style.Colors[ImGuiCol_ScrollbarBg] = BG(0.230f, 1.00f); 71 | style.Colors[ImGuiCol_ScrollbarGrab] = BG(0.13f); 72 | style.Colors[ImGuiCol_ScrollbarGrabHovered] = MED(0.78f); 73 | style.Colors[ImGuiCol_ScrollbarGrabActive] = MED(1.00f); 74 | style.Colors[ImGuiCol_CheckMark] = HI(1.00f); 75 | style.Colors[ImGuiCol_SliderGrab] = MED(0.78f); 76 | style.Colors[ImGuiCol_SliderGrabActive] = MED(1.00f); 77 | style.Colors[ImGuiCol_Button] = BG(0.230f, 1.00f); 78 | style.Colors[ImGuiCol_ButtonHovered] = MED(0.86f); 79 | style.Colors[ImGuiCol_ButtonActive] = MED(1.00f); 80 | style.Colors[ImGuiCol_Header] = MED(0.76f); 81 | style.Colors[ImGuiCol_HeaderHovered] = MED(0.86f); 82 | style.Colors[ImGuiCol_HeaderActive] = HI(1.00f); 83 | style.Colors[ImGuiCol_ResizeGrip] = BG(0.230f, 0.04f); 84 | style.Colors[ImGuiCol_ResizeGripHovered] = MED(0.78f); 85 | style.Colors[ImGuiCol_ResizeGripActive] = MED(1.00f); 86 | style.Colors[ImGuiCol_PlotLines] = IMGUI_TEXT(0.63f); 87 | style.Colors[ImGuiCol_PlotLinesHovered] = MED(1.00f); 88 | style.Colors[ImGuiCol_PlotHistogram] = IMGUI_TEXT(0.63f); 89 | style.Colors[ImGuiCol_PlotHistogramHovered] = MED(1.00f); 90 | style.Colors[ImGuiCol_TextSelectedBg] = MED(0.43f); 91 | style.Colors[ImGuiCol_ModalWindowDarkening] = BG(0.230f, 0.73f); 92 | 93 | if (State.LightMode) { 94 | style.Colors[ImGuiCol_WindowBg] = BG(0.95f); 95 | style.Colors[ImGuiCol_ChildBg] = BG(0.95f); 96 | style.Colors[ImGuiCol_PopupBg] = BG(0.9f, 0.9f); 97 | style.Colors[ImGuiCol_FrameBg] = BG(0.9f, 1.0f); 98 | style.Colors[ImGuiCol_TitleBg] = BG(0.95f); 99 | style.Colors[ImGuiCol_TitleBgActive] = BG(0.95f); 100 | style.Colors[ImGuiCol_TitleBgCollapsed] = BG(0.95f); 101 | style.Colors[ImGuiCol_MenuBarBg] = BG(0.9f, 0.5f); 102 | style.Colors[ImGuiCol_ScrollbarBg] = BG(0.9f, 1.0f); 103 | style.Colors[ImGuiCol_ScrollbarGrab] = BG(0.6f); 104 | style.Colors[ImGuiCol_ScrollbarGrabHovered] = MED(0.8f); 105 | style.Colors[ImGuiCol_Button] = BG(0.85f, 1.0f); 106 | style.Colors[ImGuiCol_ButtonHovered] = MED(0.7f); 107 | style.Colors[ImGuiCol_ButtonActive] = MED(0.9f); 108 | style.Colors[ImGuiCol_ResizeGrip] = BG(0.9f, 0.1f); 109 | style.Colors[ImGuiCol_ResizeGripHovered] = MED(0.8f); 110 | style.Colors[ImGuiCol_ResizeGripActive] = MED(0.9f); 111 | style.Colors[ImGuiCol_ModalWindowDarkening] = BG(0.9f, 0.7f); 112 | } 113 | 114 | style.WindowPadding = ImVec2(6, 4); 115 | style.WindowRounding = 4.0f; 116 | style.FramePadding = ImVec2(5, 2); 117 | style.FrameRounding = 3.0f; 118 | style.ItemSpacing = ImVec2(7, 1); 119 | style.ItemInnerSpacing = ImVec2(1, 1); 120 | style.TouchExtraPadding = ImVec2(0, 0); 121 | style.IndentSpacing = 6.0f; 122 | style.ScrollbarSize = 12.0f; 123 | style.ScrollbarRounding = 16.0f; 124 | style.GrabMinSize = 20.0f; 125 | style.GrabRounding = 2.0f; 126 | 127 | style.WindowTitleAlign.x = 0.50f; 128 | 129 | style.Colors[ImGuiCol_Border] = ImVec4(0.f, 0.f, 0.f, 0.f); 130 | style.FrameBorderSize = 0.0f; 131 | style.WindowBorderSize = 0.0f; 132 | 133 | style.ChildBorderSize = 0.0f; 134 | 135 | // scale by dpi 136 | style.ScaleAllSizes(State.dpiScale); 137 | 138 | static int rgbDelay = 0; 139 | if (rgbDelay <= 0) { 140 | State.RgbNameColor += 0.025f; 141 | constexpr auto tau = 2.f * 3.14159265358979323846f; 142 | while (State.RgbNameColor > tau) State.RgbNameColor -= tau; 143 | const auto calculate = [](float value) {return std::sin(value) * .5f + .5f; }; 144 | auto color_r = calculate(State.RgbNameColor + 0.f); 145 | auto color_g = calculate(State.RgbNameColor + 4.f); 146 | auto color_b = calculate(State.RgbNameColor + 2.f); 147 | State.rgbCode = std::format("<#{:02x}{:02x}{:02x}>", int(color_r * 255), int(color_g * 255), int(color_b * 255)); 148 | 149 | State.RgbColor.x = color_r; 150 | State.RgbColor.y = color_g; 151 | State.RgbColor.z = color_b; 152 | 153 | rgbDelay = int(0.01 * GetFps()); 154 | } 155 | else rgbDelay--; 156 | 157 | static int gradientDelay = 0; 158 | static uint8_t gradientStep = 1; 159 | if (gradientDelay <= 0) { 160 | static bool gradientIncreasing = true; 161 | if (gradientStep == 1) { 162 | gradientStep++; 163 | gradientIncreasing = true; 164 | } 165 | else if (gradientStep == 100) { 166 | gradientStep--; 167 | gradientIncreasing = false; 168 | } 169 | else { 170 | if (gradientIncreasing) gradientStep++; 171 | else gradientStep--; 172 | } 173 | gradientDelay = int(0.02 * GetFps()); 174 | } 175 | else gradientDelay--; 176 | 177 | if (State.GradientMenuTheme) { 178 | float stepR = float((State.MenuGradientColor2.x - State.MenuGradientColor1.x) / 100); 179 | float stepG = float((State.MenuGradientColor2.y - State.MenuGradientColor1.y) / 100); 180 | float stepB = float((State.MenuGradientColor2.z - State.MenuGradientColor1.z) / 100); 181 | State.MenuGradientColor = ImVec4(State.MenuGradientColor1.x + stepR * gradientStep, 182 | State.MenuGradientColor1.y + stepG * gradientStep, 183 | State.MenuGradientColor1.z + stepB * gradientStep, 184 | State.MenuThemeColor.w); 185 | } 186 | } -------------------------------------------------------------------------------- /gui/theme.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void ApplyTheme(); -------------------------------------------------------------------------------- /hooks/AccountManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "logger.h" 4 | #include "state.hpp" 5 | 6 | void dAccountManager_UpdateKidAccountDisplay(AccountManager* __this, MethodInfo* method) { 7 | if (State.ShowHookLogs) LOG_DEBUG("Hook dAccountManager_UpdateKidAccountDisplay executed"); 8 | // grant permissions 9 | if (!State.PanicMode) { 10 | __this->fields.freeChatAllowed = KWSPermissionStatus__Enum::Granted; 11 | __this->fields.customDisplayName = KWSPermissionStatus__Enum::Granted; 12 | __this->fields.friendsListAllowed = KWSPermissionStatus__Enum::Granted; 13 | } 14 | app::AccountManager_UpdateKidAccountDisplay(__this, method); 15 | } 16 | 17 | bool dAccountManager_CanPlayOnline(AccountManager* __this, MethodInfo* method) { 18 | if (State.ShowHookLogs) LOG_DEBUG("Hook dAccountManager_CanPlayOnline executed"); 19 | return true; 20 | } -------------------------------------------------------------------------------- /hooks/AirshipStatus.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | #include "utility.h" 6 | 7 | void dAirshipStatus_OnEnable(AirshipStatus* __this, MethodInfo* method) 8 | { 9 | if (State.ShowHookLogs) LOG_DEBUG("Hook dAirshipStatus_OnEnable executed"); 10 | AirshipStatus_OnEnable(__this, method); 11 | State.mapType = Settings::MapType::Airship; 12 | if (IsHost() && State.TaskSpeedrun && State.GameLoaded) 13 | State.SpeedrunTimer += Time_get_deltaTime(NULL); 14 | try { 15 | State.BlinkPlayersTab = false; 16 | 17 | Replay::Reset(); 18 | 19 | State.MatchStart = std::chrono::system_clock::now(); 20 | State.MatchCurrent = State.MatchStart; 21 | 22 | State.selectedDoor = SystemTypes__Enum::Hallway; 23 | State.mapDoors.clear(); 24 | State.pinnedDoors.clear(); 25 | 26 | il2cpp::Array allDoors = __this->fields._.AllDoors; 27 | 28 | for (auto door : allDoors) { 29 | if (std::find(State.mapDoors.begin(), State.mapDoors.end(), door->fields.Room) == State.mapDoors.end()) 30 | State.mapDoors.push_back(door->fields.Room); 31 | } 32 | 33 | std::sort(State.mapDoors.begin(), State.mapDoors.end()); 34 | 35 | if (!State.PanicMode && State.confuser && State.confuseOnStart) 36 | ControlAppearance(true); 37 | 38 | if (State.AutoFakeRole) { 39 | if (!State.SafeMode) State.rpcQueue.push(new RpcSetRole(*Game::pLocalPlayer, (RoleTypes__Enum)State.FakeRole)); 40 | } 41 | } 42 | catch (...) { 43 | LOG_ERROR("Exception occurred in AirshipStatus_OnEnable (AirshipStatus)"); 44 | } 45 | } 46 | 47 | float dAirshipStatus_CalculateLightRadius(AirshipStatus* __this, NetworkedPlayerInfo* player, MethodInfo* method) { 48 | if (State.ShowHookLogs) LOG_DEBUG("Hook dAirshipStatus_CalculateLightRadius executed"); 49 | if (!State.PanicMode && State.MaxVision) 50 | return 420.F; 51 | return AirshipStatus_CalculateLightRadius(__this, player, method); 52 | } -------------------------------------------------------------------------------- /hooks/Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "esp.hpp" 5 | #include 6 | 7 | static float camHeight = 3.f; 8 | static bool refreshChat = true; 9 | 10 | Vector3 dCamera_ScreenToWorldPoint(Camera* __this, Vector3 position, MethodInfo* method) 11 | { 12 | if (State.ShowHookLogs) LOG_DEBUG("Hook dCamera_ScreenToWorldPoint executed"); 13 | try { 14 | if (!State.PanicMode && (State.GameLoaded || IsInLobby())) 15 | { 16 | //Figured it is better to restore the current camera height than using state 17 | float orthographicSize = Camera_get_orthographicSize(__this, NULL); 18 | Camera_set_orthographicSize(__this, 3.0f, NULL); 19 | Vector3 ret = Camera_ScreenToWorldPoint(__this, position, method); 20 | Camera_set_orthographicSize(__this, orthographicSize, NULL); 21 | return ret; 22 | } 23 | } 24 | catch (...) { 25 | LOG_ERROR("Exception occurred in Camera_ScreenToWorldPoint (Camera)"); //better safe than sorry 26 | } 27 | 28 | return Camera_ScreenToWorldPoint(__this, position, method); 29 | } 30 | 31 | void dFollowerCamera_Update(FollowerCamera* __this, MethodInfo* method) { 32 | if (State.ShowHookLogs) LOG_DEBUG("Hook dFollowerCamera_Update executed"); 33 | try { 34 | if (!State.PanicMode) { 35 | if (auto playerToFollow = State.playerToFollow.validate(); playerToFollow.has_value()) 36 | { 37 | __this->fields.Target = (MonoBehaviour*)playerToFollow.get_PlayerControl(); 38 | } 39 | else if (__this->fields.Target != (MonoBehaviour*)(*Game::pLocalPlayer)) { 40 | __this->fields.Target = (MonoBehaviour*)(*Game::pLocalPlayer); 41 | } 42 | } 43 | else __this->fields.Target = (MonoBehaviour*)(*Game::pLocalPlayer); 44 | } 45 | catch (...) { 46 | LOG_ERROR("Exception occurred in FollowerCamera_Update (Camera)"); 47 | } 48 | FollowerCamera_Update(__this, method); 49 | } -------------------------------------------------------------------------------- /hooks/DirectX.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "resources.h" 3 | #include "directx11.h" 4 | #include 5 | #include 6 | #include 7 | 8 | enum class ICON_TYPES { 9 | VENT_IN, 10 | VENT_OUT, 11 | KILL, 12 | REPORT, 13 | TASK, 14 | PLAYER, 15 | CROSS, 16 | DEAD, 17 | PLAY, 18 | PAUSE, 19 | PLAYERVISOR 20 | }; 21 | 22 | struct MapTexture { 23 | D3D11Image mapImage; 24 | float x_offset; 25 | float y_offset; 26 | float scale; 27 | }; 28 | 29 | struct IconTexture { 30 | D3D11Image iconImage; 31 | float scale; 32 | }; 33 | 34 | extern std::vector maps; 35 | extern std::unordered_map icons; 36 | 37 | extern D3D_PRESENT_FUNCTION oPresent; 38 | HRESULT __stdcall dPresent(IDXGISwapChain* __this, UINT SyncInterval, UINT Flags); 39 | 40 | namespace DirectX { 41 | extern HWND window; 42 | extern HANDLE hRenderSemaphore; 43 | void Shutdown(); 44 | ImVec2 GetWindowSize(); 45 | } -------------------------------------------------------------------------------- /hooks/Dleks.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | 5 | constexpr int32_t AnticheatPenalty = 25; 6 | 7 | void LogIfEnabled(const std::string& message) { 8 | if (State.ShowHookLogs) { 9 | LOG_DEBUG(message.c_str()); 10 | } 11 | } 12 | 13 | bool ShouldDisableHostAnticheat() { 14 | return State.DisableHostAnticheat && State.CurrentScene != "MatchMaking" && State.CurrentScene != "FindAGame" && !State.IsFreePlay; 15 | } 16 | 17 | int32_t dConstants_1_GetBroadcastVersion(MethodInfo* method) { 18 | LogIfEnabled("Hook dConstants_1_GetBroadcastVersion executed"); 19 | int32_t baseVersion = Constants_1_GetBroadcastVersion(method); 20 | return baseVersion + (ShouldDisableHostAnticheat() ? AnticheatPenalty : 0); 21 | } 22 | 23 | bool dConstants_1_IsVersionModded(MethodInfo* method) { 24 | LogIfEnabled("Hook dConstants_1_IsVersionModded executed"); 25 | return ShouldDisableHostAnticheat() || Constants_1_IsVersionModded(method); 26 | } 27 | 28 | /*AsyncOperationHandle_1_UnityEngine_GameObject_ dAssetReference_InstantiateAsync_1(AssetReference* __this, Transform* parent, bool instantiateInWorldSpace, MethodInfo* method) { 29 | LogIfEnabled("Hook dAssetReference_InstantiateAsync_1 executed"); 30 | LOG_DEBUG(std::format("AssetReference_InstantiateAsync executed with scene {}", State.CurrentScene).c_str()); 31 | return AssetReference_InstantiateAsync_1(__this, parent, instantiateInWorldSpace, method); 32 | }*/ 33 | 34 | bool dAprilFoolsMode_ShouldFlipSkeld(MethodInfo* method) { 35 | if (IsHost()) return State.FlipSkeld; 36 | State.FlipSkeld = AprilFoolsMode_ShouldFlipSkeld(method); 37 | return State.FlipSkeld; 38 | } 39 | -------------------------------------------------------------------------------- /hooks/Doors.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "_rpc.h" 5 | 6 | void dPlainDoor_SetDoorway(PlainDoor* __this, bool open, MethodInfo* method) { 7 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlainDoor_SetDoorway executed"); 8 | if (open && (std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), __this->fields._.Room) != State.pinnedDoors.end())) { 9 | ShipStatus_RpcCloseDoorsOfType(*Game::pShipStatus, __this->fields._.Room, NULL); 10 | } 11 | app::PlainDoor_SetDoorway(__this, open, method); 12 | } 13 | 14 | void dMushroomWallDoor_SetDoorway(MushroomWallDoor* __this, bool open, MethodInfo* method) { 15 | if (State.ShowHookLogs) LOG_DEBUG("Hook dMushroomWallDoor_SetDoorway executed"); 16 | if (open && (std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), __this->fields._.Room) != State.pinnedDoors.end())) { 17 | ShipStatus_RpcCloseDoorsOfType(*Game::pShipStatus, __this->fields._.Room, NULL); 18 | } 19 | app::MushroomWallDoor_SetDoorway(__this, open, method); 20 | } 21 | 22 | bool dAutoOpenDoor_DoUpdate(AutoOpenDoor* __this, float dt, MethodInfo* method) { 23 | if (State.ShowHookLogs) LOG_DEBUG("Hook dAutoOpenDoor_DoUpdate executed"); 24 | /*if (__this->fields._.Open && (std::find(State.pinnedDoors.begin(), State.pinnedDoors.end(), __this->fields._._.Room) != State.pinnedDoors.end()) && __this->fields.ClosedTimer < 1.5f && 25 | __this->fields._._.Room != SystemTypes__Enum::Decontamination && __this->fields._._.Room != SystemTypes__Enum::Decontamination2 26 | && __this->fields._._.Room != SystemTypes__Enum::Decontamination3) { 27 | ShipStatus_RpcCloseDoorsOfType(*Game::pShipStatus, __this->fields._._.Room, NULL); 28 | }*/ 29 | return app::AutoOpenDoor_DoUpdate(__this, dt, method); 30 | } -------------------------------------------------------------------------------- /hooks/ExileController.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "utility.h" 4 | #include "logger.h" 5 | #include 6 | 7 | NetworkedPlayerInfo* exiledInfo = NULL; 8 | 9 | void dExileController_ReEnableGameplay(ExileController* __this, MethodInfo* method) { 10 | if (State.ShowHookLogs) LOG_DEBUG("Hook dExileController_ReEnableGameplay executed"); 11 | app::ExileController_ReEnableGameplay(__this, method); 12 | 13 | try {// ESP: Reset Kill Cooldown 14 | for (auto pc : GetAllPlayerControl()) { 15 | if (auto player = PlayerSelection(pc).validate(); 16 | player.has_value() && !player.is_LocalPlayer() && !player.is_Disconnected()) { 17 | if (auto role = player.get_PlayerData()->fields.Role; 18 | role != nullptr && role->fields.CanUseKillButton && !player.get_PlayerData()->fields.IsDead) { 19 | pc->fields.killTimer = (std::max)(GameOptions().GetKillCooldown(), 0.f); 20 | //STREAM_DEBUG("Player " << ToString(pc) << " KillTimer " << pc->fields.killTimer); 21 | } 22 | } 23 | } 24 | if (State.GodMode && ((IsHost() && IsInGame()) || !State.SafeMode)) { 25 | PlayerControl_RpcProtectPlayer(*Game::pLocalPlayer, *Game::pLocalPlayer, GetPlayerOutfit(GetPlayerData(*Game::pLocalPlayer))->fields.ColorId, NULL); 26 | } 27 | } 28 | catch (...) { 29 | LOG_ERROR("Exception occurred in ExileController_ReEnableGameplay (ExileController)"); 30 | } 31 | } 32 | 33 | void dExileController_BeginForGameplay(ExileController* __this, NetworkedPlayerInfo* exiled, bool voteTie, MethodInfo* method) { 34 | if (State.ShowHookLogs) LOG_DEBUG("Hook dExileController_BeginForGameplay executed"); 35 | ExileController_BeginForGameplay(__this, exiled, voteTie, method); 36 | exiledInfo = exiled; 37 | try { 38 | if (IsHost() && State.TournamentMode && !voteTie && exiled != NULL) { 39 | if (PlayerIsImpostor(exiled)) { 40 | UpdatePoints(exiled, -1); //ImpVoteOut 41 | for (auto i : State.voteMonitor) { 42 | if (i.second == exiled->fields.PlayerId && !PlayerIsImpostor(GetPlayerDataById(i.first))) { 43 | UpdatePoints(GetPlayerDataById(i.first), 1); //ImpVoteOutCorrect 44 | LOG_DEBUG(std::format("Added 1 point to {} for voting out impostor correctly", ToString(i.first)).c_str()); 45 | } 46 | } 47 | auto exiledFc = convert_from_string(exiled->fields.FriendCode); 48 | auto pos = std::find(State.tournamentAliveImpostors.begin(), State.tournamentAliveImpostors.end(), exiledFc); 49 | if (pos != State.tournamentAliveImpostors.end()) State.tournamentAliveImpostors.erase(pos); 50 | } 51 | else { 52 | for (auto p : GetAllPlayerData()) { 53 | if (PlayerIsImpostor(p) && !p->fields.IsDead) { 54 | std::string friendCode = convert_from_string(p->fields.FriendCode); 55 | if (State.tournamentKillCaps[friendCode] < 3.f) { 56 | State.tournamentKillCaps[friendCode] += 1.f; 57 | UpdatePoints(p, 1); //CrewVoteOut 58 | LOG_DEBUG(std::format("Added 1 point to {} for voting out crewmate", ToString(p)).c_str()); 59 | } 60 | } 61 | } 62 | for (auto i : State.voteMonitor) { 63 | if (i.second == exiled->fields.PlayerId && !PlayerIsImpostor(GetPlayerDataById(i.first))) { 64 | UpdatePoints(GetPlayerDataById(i.first), -1); //ImpVoteOutIncorrect 65 | LOG_DEBUG(std::format("Deducted 1 point from {} for voting out crewmate", ToString(i.first)).c_str()); 66 | } 67 | } 68 | } 69 | } 70 | } 71 | catch (...) { 72 | LOG_ERROR("Exception occurred in ExileController_Begin (ExileController)"); 73 | } 74 | } -------------------------------------------------------------------------------- /hooks/FungleShipStatus.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | #include "utility.h" 6 | 7 | void dFungleShipStatus_OnEnable(FungleShipStatus* __this, MethodInfo* method) 8 | { 9 | if (State.ShowHookLogs) LOG_DEBUG("Hook dFungleShipStatus_OnEnable executed"); 10 | FungleShipStatus_OnEnable(__this, method); 11 | 12 | try { 13 | State.BlinkPlayersTab = false; 14 | 15 | Replay::Reset(); 16 | 17 | State.MatchStart = std::chrono::system_clock::now(); 18 | State.MatchCurrent = State.MatchStart; 19 | 20 | State.selectedDoor = SystemTypes__Enum::Hallway; 21 | State.mapDoors.clear(); 22 | State.pinnedDoors.clear(); 23 | 24 | il2cpp::Array allDoors = __this->fields._.AllDoors; 25 | 26 | for (auto door : allDoors) { 27 | if (std::find(State.mapDoors.begin(), State.mapDoors.end(), door->fields.Room) == State.mapDoors.end()) 28 | State.mapDoors.push_back(door->fields.Room); 29 | } 30 | 31 | std::sort(State.mapDoors.begin(), State.mapDoors.end()); 32 | 33 | if (!State.PanicMode && State.confuser && State.confuseOnStart) 34 | ControlAppearance(true); 35 | 36 | if (State.AutoFakeRole) { 37 | if (!State.SafeMode) State.rpcQueue.push(new RpcSetRole(*Game::pLocalPlayer, (RoleTypes__Enum)State.FakeRole)); 38 | } 39 | } 40 | catch (...) { 41 | LOG_ERROR("Exception occurred in FungleShipStatus_OnEnable (FungleShipStatus)"); 42 | } 43 | } -------------------------------------------------------------------------------- /hooks/GameOptionsManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | 5 | void dGameOptionsManager_set_CurrentGameOptions(GameOptionsManager* __this, IGameOptions* value, MethodInfo* method) { 6 | if (State.ShowHookLogs) LOG_DEBUG("Hook dGameOptionsManager_set_CurrentGameOptions executed"); 7 | GameOptionsManager_set_CurrentGameOptions(__this, value, method); 8 | try { 9 | GameOptions gameOptions(value); 10 | if (gameOptions.HasOptions()) { 11 | SaveGameOptions(gameOptions); 12 | } 13 | } 14 | catch (...) { 15 | LOG_ERROR("Exception occurred in GameOptionsManager_set_CurrentGameOptions (GameOptionsManager)"); 16 | } 17 | } 18 | 19 | int32_t dLogicOptionsHnS_GetCrewmateLeadTime(LogicOptionsHnS* __this, MethodInfo* method) { 20 | return !State.PanicMode && State.NoSeekerAnim ? 0 : 10; // Anyway it is hardcoded in the game itself to be 10 21 | } -------------------------------------------------------------------------------- /hooks/KeyboardJoystick.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | 5 | void dKeyboardJoystick_Update(KeyboardJoystick* __this, MethodInfo* method) { 6 | if (State.ShowHookLogs) LOG_DEBUG("Hook dKeyboardJoystick_Update executed"); 7 | if ((!State.FreeCam && !State.playerToAttach.has_value()) || State.PanicMode) { 8 | app::KeyboardJoystick_Update(__this, method); 9 | } 10 | else 11 | __this->fields.del = app::Vector2(); //Reset to zero 12 | } 13 | 14 | void dScreenJoystick_FixedUpdate(ScreenJoystick* __this, MethodInfo* method) 15 | { 16 | if (State.ShowHookLogs) LOG_DEBUG("Hook dScreenJoystick_FixedUpdate executed"); 17 | static int countdown; 18 | if ((!State.FreeCam && !State.playerToAttach.has_value()) || State.PanicMode) { 19 | app::ScreenJoystick_FixedUpdate(__this, method); 20 | countdown = 3; //This is necessary for mouseup to zero out the delta movement 21 | } 22 | else if (countdown > 0) { 23 | app::ScreenJoystick_FixedUpdate(__this, method); 24 | countdown--; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /hooks/NoShadowBehaviour.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | 6 | void dNoShadowBehaviour_LateUpdate(NoShadowBehaviour* __this, MethodInfo* method) { 7 | /*22.12.08e if ((State.Wallhack || State.FreeCam || State.EnableZoom) && !State.OcclusionCulling) { 8 | NoShadowBehaviour_SetMaskFunction(__this, 8, NULL); 9 | } 10 | else { 11 | NoShadowBehaviour_LateUpdate(__this, method); 12 | }*/ 13 | return; 14 | } -------------------------------------------------------------------------------- /hooks/PlainDoor.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include 5 | 6 | using namespace std::string_view_literals; 7 | 8 | static bool OpenDoor(OpenableDoor* door) { 9 | if ("PlainDoor"sv == door->klass->name) { 10 | app::PlainDoor_SetDoorway(reinterpret_cast(door), true, {}); 11 | } 12 | else if ("MushroomWallDoor"sv == door->klass->name) { 13 | app::MushroomWallDoor_SetDoorway(reinterpret_cast(door), true, {}); 14 | } 15 | else { 16 | return false; 17 | } 18 | State.rpcQueue.push(new RpcUpdateSystem(SystemTypes__Enum::Doors, door->fields.Id | 64)); 19 | return true; 20 | } 21 | 22 | void dDoorBreakerGame_Start(DoorBreakerGame* __this, MethodInfo* method) { 23 | if (State.ShowHookLogs) LOG_DEBUG("Hook dDoorBreakerGame_Start executed"); 24 | if (!State.PanicMode && State.AutoOpenDoors) { 25 | if (OpenDoor(__this->fields.MyDoor)) { 26 | Minigame_Close((Minigame*)__this, {}); 27 | return; 28 | } 29 | } 30 | DoorBreakerGame_Start(__this, method); 31 | } 32 | 33 | void dDoorCardSwipeGame_Begin(DoorCardSwipeGame* __this, PlayerTask* playerTask, MethodInfo* method) { 34 | if (State.ShowHookLogs) LOG_DEBUG("Hook dDoorCardSwipeGame_Begin executed"); 35 | if (!State.PanicMode && State.AutoOpenDoors) { 36 | if (OpenDoor(__this->fields.MyDoor)) { 37 | Minigame_Close((Minigame*)__this, {}); 38 | return; 39 | } 40 | } 41 | DoorCardSwipeGame_Begin(__this, playerTask, method); 42 | } 43 | 44 | void dMushroomDoorSabotageMinigame_Begin(MushroomDoorSabotageMinigame* __this, PlayerTask* task, MethodInfo* method) { 45 | if (State.ShowHookLogs) LOG_DEBUG("Hook dMushroomDoorSabotageMinigame_Begin executed"); 46 | if (!State.PanicMode) { 47 | if (State.AutoOpenDoors) { 48 | if (OpenDoor(__this->fields.myDoor)) { 49 | Minigame_Close((Minigame*)__this, {}); 50 | return; 51 | } 52 | } 53 | } 54 | MushroomDoorSabotageMinigame_Begin(__this, task, method); 55 | } -------------------------------------------------------------------------------- /hooks/PlayerBanData.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | 6 | /*bool dPlayerBanData_get_IsBanned(PlayerBanData* __this, MethodInfo* method) { 7 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerBanData_get_IsBanned executed"); 8 | return false; 9 | } 10 | 11 | float dPlayerBanData_get_BanPoints(PlayerBanData* __this, MethodInfo* method) { 12 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerBanData_get_BanPoints executed"); 13 | 14 | return 0.F; 15 | }*/ 16 | 17 | int32_t dPlayerBanData_get_BanMinutesLeft(PlayerBanData* __this, MethodInfo* method) { 18 | if (State.ShowHookLogs) LOG_DEBUG("Hook dStatsManager_get_BanMinutesLeft executed"); 19 | __this->fields.banPoints = 0.f; 20 | return (int32_t)0; 21 | } -------------------------------------------------------------------------------- /hooks/PlayerPhysics.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "game.h" 5 | 6 | void dPlayerPhysics_FixedUpdate(PlayerPhysics* __this, MethodInfo* method) 7 | { 8 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerPhysics_FixedUpdate executed"); 9 | /*if (!State.PanicMode && ((*Game::pLocalPlayer) != NULL && __this->fields.myPlayer == *Game::pLocalPlayer && (*Game::pLocalPlayer)->fields.inVent && State.MoveInVentAndShapeshift)) { 10 | (*Game::pLocalPlayer)->fields.inVent = false; 11 | app::PlayerPhysics_FixedUpdate(__this, method); 12 | (*Game::pLocalPlayer)->fields.inVent = true; 13 | } 14 | else { 15 | app::PlayerPhysics_FixedUpdate(__this, method); 16 | }*/ 17 | try { 18 | auto player = __this->fields.myPlayer; 19 | auto playerData = GetPlayerData(player); 20 | auto localData = GetPlayerData(*Game::pLocalPlayer); 21 | if (player == NULL || playerData == NULL || localData == NULL) return; 22 | if (Object_1_IsNull((Object_1*)player->fields.cosmetics)) return; 23 | if (!State.TempPanicMode && !State.PanicMode) { 24 | bool shouldSeePhantom = __this->fields.myPlayer == *Game::pLocalPlayer || PlayerIsImpostor(localData) || localData->fields.IsDead || State.ShowPhantoms; 25 | bool shouldSeeGhost = localData->fields.IsDead || State.ShowGhosts; 26 | auto roleType = playerData->fields.RoleType; 27 | bool isFullyVanished = std::find(State.vanishedPlayers.begin(), State.vanishedPlayers.end(), playerData->fields.PlayerId) != State.vanishedPlayers.end(); 28 | bool isDead = playerData->fields.IsDead; 29 | auto nameText = Component_get_gameObject((Component_1*)player->fields.cosmetics->fields.nameText, NULL); 30 | bool isSeekerBody = player->fields.cosmetics->fields.bodyType == PlayerBodyTypes__Enum::Seeker || player->fields.cosmetics->fields.bodyType == PlayerBodyTypes__Enum::LongSeeker; 31 | if (player->fields.inVent) { 32 | if (!PlayerControl_get_Visible(player, NULL) && State.ShowPlayersInVents && (!isFullyVanished || shouldSeePhantom) && !State.PanicMode) { 33 | PlayerControl_set_Visible(player, true, NULL); 34 | player->fields.invisibilityAlpha = 0.5f; 35 | CosmeticsLayer_SetPhantomRoleAlpha(player->fields.cosmetics, player->fields.invisibilityAlpha, NULL); 36 | if (isSeekerBody) { 37 | SpriteRenderer_set_color(player->fields.cosmetics->fields.skin->fields.layer, Palette__TypeInfo->static_fields->ClearWhite, NULL); 38 | } 39 | } 40 | else if (player->fields.invisibilityAlpha == 0.5f && (!(State.ShowPlayersInVents && (!isFullyVanished || shouldSeePhantom)) || State.PanicMode)) { 41 | PlayerControl_set_Visible(player, false, NULL); 42 | player->fields.invisibilityAlpha = 0.f; 43 | CosmeticsLayer_SetPhantomRoleAlpha(player->fields.cosmetics, player->fields.invisibilityAlpha, NULL); 44 | if (isSeekerBody) { 45 | SpriteRenderer_set_color(player->fields.cosmetics->fields.skin->fields.layer, Palette__TypeInfo->static_fields->ClearWhite, NULL); 46 | } 47 | } 48 | GameObject_SetActive(nameText, player->fields.invisibilityAlpha > 0.f, NULL); 49 | } 50 | else if (!isDead) { 51 | player->fields.invisibilityAlpha = isFullyVanished ? (shouldSeePhantom ? 0.5f : 0.f) : 1.f; 52 | CosmeticsLayer_SetPhantomRoleAlpha(player->fields.cosmetics, player->fields.invisibilityAlpha, NULL); 53 | PlayerControl_set_Visible(player, player->fields.invisibilityAlpha > 0.f, NULL); 54 | if (isSeekerBody) { 55 | SpriteRenderer_set_color(player->fields.cosmetics->fields.skin->fields.layer, Palette__TypeInfo->static_fields->ClearWhite, NULL); 56 | } 57 | GameObject_SetActive(nameText, player->fields.invisibilityAlpha > 0.f, NULL); 58 | } 59 | else if (isDead) { 60 | PlayerControl_set_Visible(player, shouldSeeGhost, NULL); 61 | } 62 | } 63 | app::PlayerPhysics_FixedUpdate(__this, method); 64 | } 65 | catch (...) { 66 | app::PlayerPhysics_FixedUpdate(__this, method); 67 | } 68 | } -------------------------------------------------------------------------------- /hooks/PlayerStorageManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "logger.h" 4 | #include "state.hpp" 5 | 6 | void dPlayerStorageManager_OnReadPlayerPrefsComplete(PlayerStorageManager* __this, void* data, MethodInfo* method) { 7 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerStorageManager_OnReadPlayerPrefsComplete executed"); 8 | app::PlayerStorageManager_OnReadPlayerPrefsComplete(__this, data, method); 9 | if (!State.PanicMode) __this->fields._PlayerPrefs_k__BackingField.IsAdult = 1; 10 | } -------------------------------------------------------------------------------- /hooks/PolusShipStatus.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | #include "utility.h" 6 | #include "replay.hpp" 7 | #include "profiler.h" 8 | 9 | void dPolusShipStatus_OnEnable(PolusShipStatus* __this, MethodInfo* method) 10 | { 11 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPolusShipStatus_OnEnable executed"); 12 | try { 13 | State.BlinkPlayersTab = false; 14 | 15 | Replay::Reset(); 16 | 17 | State.MatchStart = std::chrono::system_clock::now(); 18 | State.MatchCurrent = State.MatchStart; 19 | 20 | State.selectedDoor = SystemTypes__Enum::Hallway; 21 | State.mapDoors.clear(); 22 | State.pinnedDoors.clear(); 23 | 24 | il2cpp::Array allDoors = __this->fields._.AllDoors; 25 | 26 | for (auto door : allDoors) { 27 | if (std::find(State.mapDoors.begin(), State.mapDoors.end(), door->fields.Room) == State.mapDoors.end()) 28 | State.mapDoors.push_back(door->fields.Room); 29 | } 30 | 31 | std::sort(State.mapDoors.begin(), State.mapDoors.end()); 32 | 33 | if (!State.PanicMode && State.confuser && State.confuseOnStart) 34 | ControlAppearance(true); 35 | 36 | if (State.AutoFakeRole) { 37 | if (!State.SafeMode) State.rpcQueue.push(new RpcSetRole(*Game::pLocalPlayer, (RoleTypes__Enum)State.FakeRole)); 38 | } 39 | } 40 | catch (...) { 41 | LOG_ERROR("Exception occurred in PolusShipStatus_OnEnable (PolusShipStatus)"); 42 | } 43 | PolusShipStatus_OnEnable(__this, method); 44 | } -------------------------------------------------------------------------------- /hooks/RoleManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "utility.h" 3 | 4 | void AssignPreChosenRoles(RoleRates& roleRates, std::vector& assignedPlayers); 5 | void AssignRoles(RoleRates& roleRates, int roleChance, RoleTypes__Enum role, il2cpp::List& allPlayers, std::vector& assignedPlayers); 6 | bool ShouldRoleBeAssigned(int roleChance); 7 | bool CanPlayerBeAssignedToRole(app::PlayerControl* player, std::vector& assignedPlayers); 8 | void EvenOutImpostorRoleCounts(RoleRates& roleRates); -------------------------------------------------------------------------------- /hooks/SabotageSystemType.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "utility.h" 4 | #include "logger.h" 5 | #include "state.hpp" 6 | 7 | void dSabotageSystemType_SetInitialSabotageCooldown(SabotageSystemType* __this, MethodInfo* method) { 8 | if (State.ShowHookLogs) LOG_DEBUG("Hook dSabotageSystemType_SetInitialSabotageCooldown executed"); 9 | app::SabotageSystemType_SetInitialSabotageCooldown(__this, method); 10 | 11 | // ESP: Initialize Kill Cooldown 12 | for (auto pc : GetAllPlayerControl()) { 13 | if (auto player = PlayerSelection(pc).validate(); 14 | player.has_value() && !player.is_LocalPlayer() && !player.is_Disconnected()) { 15 | if (auto role = player.get_PlayerData()->fields.Role; 16 | role != nullptr && role->fields.CanUseKillButton && !player.get_PlayerData()->fields.IsDead) { 17 | pc->fields.killTimer = 10.f; 18 | //STREAM_DEBUG("Player " << ToString(pc) << " KillTimer " << pc->fields.killTimer); 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /hooks/SaveManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "game.h" 5 | 6 | // deprecated 7 | bool dSaveManager_GetPurchase(String* itemKey, String* bundleKey, MethodInfo* method) 8 | { 9 | if (State.ShowHookLogs) LOG_DEBUG("Hook dSaveManager_GetPurchase executed"); 10 | return true; 11 | } 12 | 13 | // v2022.10.25s 14 | bool dPlayerPurchasesData_GetPurchase(PlayerPurchasesData* __this, String* itemKey, String* bundleKey, MethodInfo* method) { 15 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerPurchasesData_GetPurchase executed"); 16 | if (State.UnlockCosmetics) { 17 | return true; 18 | } 19 | return PlayerPurchasesData_GetPurchase(__this, itemKey, bundleKey, method); 20 | } -------------------------------------------------------------------------------- /hooks/SceneManager.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | 5 | void dSceneManager_Internal_ActiveSceneChanged(Scene previousActiveScene, Scene newActiveScene, MethodInfo* method) { 6 | //if (State.ShowHookLogs) LOG_DEBUG("Hook dSceneManager_Internal_ActiveSceneChanged executed"); 7 | State.CurrentScene = convert_from_string(app::Scene_GetNameInternal(newActiveScene.m_Handle, NULL)); 8 | LOG_DEBUG(("Scene changed to " + State.CurrentScene).c_str()); 9 | if (State.CurrentScene == "MainMenu") { 10 | State.MainMenuLoaded = true; 11 | State.IsFreePlay = false; 12 | } 13 | app::SceneManager_Internal_ActiveSceneChanged(previousActiveScene, newActiveScene, method); 14 | } -------------------------------------------------------------------------------- /hooks/SignatureScan.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define INRANGE(x, a, b) (x >= a && x <= b) 8 | #define getBits(x) (INRANGE((x&(~0x20)),'A','F') ? ((x&(~0x20)) - 'A' + 0xa) : (INRANGE(x,'0','9') ? x - '0' : 0)) 9 | #define getByte(x) (getBits(x[0]) << 4 | getBits(x[1])) 10 | 11 | template 12 | class SignatureScan 13 | { 14 | SignatureScan() { 15 | pointer = NULL; 16 | moduleHandle = nullptr; 17 | } 18 | uintptr_t pointer; 19 | HMODULE moduleHandle; 20 | int SignatureSize(const char* signature) { 21 | int count = 0, i = 0; 22 | char ch = signature[0]; 23 | while (ch != ' ') { 24 | ch = signature[i]; 25 | if (isspace(ch)) 26 | count++; 27 | i++; 28 | } 29 | return count; 30 | } 31 | uintptr_t FindSignature(uintptr_t pStart, uintptr_t pEnd, const char* signature) { 32 | const char* pattern = signature; 33 | uintptr_t pFirstMatch = 0; 34 | for (uintptr_t i = pStart; i < pEnd; i++) { 35 | if (!*pattern) return pFirstMatch; 36 | if (*(PBYTE)pattern == '\?' || *(BYTE*)i == getByte(pattern)) 37 | { 38 | if (!pFirstMatch) pFirstMatch = i; 39 | if (!pattern[2]) return pFirstMatch; 40 | if (*(PWORD)pattern == '\?\?' || *(PBYTE)pattern != '\?') pattern += 3; 41 | else pattern += 2; 42 | } 43 | else 44 | { 45 | pattern = signature; 46 | pFirstMatch = 0; 47 | } 48 | } 49 | return 0; 50 | } 51 | uintptr_t FindSignatures(const char* signature, size_t index) { 52 | MODULEINFO moduleInfo; 53 | GetModuleInformation(GetCurrentProcess(), moduleHandle, &moduleInfo, sizeof(MODULEINFO)); 54 | uintptr_t pStart = uintptr_t(moduleInfo.lpBaseOfDll); 55 | uintptr_t pEnd = pStart + moduleInfo.SizeOfImage; 56 | 57 | std::vector results; 58 | int signatureSize = SignatureSize(signature); 59 | 60 | while (true) { 61 | uintptr_t result = FindSignature(pStart, pEnd, signature); 62 | if (result != 0) { 63 | results.push_back(result); 64 | pStart = result + signatureSize; 65 | } 66 | else 67 | break; 68 | 69 | if (results.size() > index) 70 | return results[index]; 71 | } 72 | 73 | return 0; 74 | } 75 | public: 76 | SignatureScan(const char* signature, size_t index, HMODULE module) { 77 | moduleHandle = module; 78 | pointer = FindSignatures(signature, index); 79 | } 80 | SignatureScan(const char* signature, HMODULE module) : SignatureScan(signature, 0, module) {} 81 | operator T () { 82 | return (T)pointer; 83 | } 84 | operator uintptr_t () { 85 | return pointer; 86 | } 87 | SignatureScan OffsetPointer(int32_t value) { 88 | SignatureScan result; 89 | if (this->pointer != 0) { 90 | result.pointer = this->pointer; 91 | return result.Offset(value).ResolvePointer(); 92 | } 93 | return result; 94 | } 95 | SignatureScan Offset(int32_t value) { 96 | SignatureScan result; 97 | if (this->pointer != 0) { 98 | result.pointer = this->pointer + value; 99 | } 100 | return result; 101 | } 102 | SignatureScan ResolveCall() { 103 | SignatureScan result; 104 | if (this->pointer != 0) { 105 | int32_t pOffset = *(int32_t*)(this->pointer + 0x01); 106 | result.pointer = this->pointer + pOffset + 0x05; 107 | } 108 | return result; 109 | } 110 | SignatureScan ResolvePointer() { 111 | SignatureScan result; 112 | if (this->pointer != 0) { 113 | result.pointer = *(uint32_t*)(this->pointer); 114 | } 115 | return result; 116 | } 117 | }; -------------------------------------------------------------------------------- /hooks/UnityDebug.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "logger.h" 4 | #include "utility.h" 5 | #include "state.hpp" 6 | 7 | void dDebug_Log(Object* message, MethodInfo* method) { 8 | if (State.ShowUnityLogs) 9 | Log.Debug("UNITY", ToString(message)); 10 | Debug_Log(message, method); 11 | } 12 | 13 | void dDebug_LogError(Object* message, MethodInfo* method) { 14 | if (State.ShowUnityLogs) 15 | Log.Error("UNITY", ToString(message)); 16 | Debug_LogError(message, method); 17 | } 18 | 19 | void dDebug_LogException(Exception* exception, MethodInfo* method) { 20 | if (State.ShowUnityLogs) 21 | Log.Error("UNITY", convert_from_string(exception->fields._message)); 22 | Debug_LogException(exception, method); 23 | } 24 | 25 | void dDebug_LogWarning(Object* message, MethodInfo* method) { 26 | if (State.ShowUnityLogs) 27 | Log.Info("UNITY", ToString(message)); 28 | Debug_LogWarning(message, method); 29 | } -------------------------------------------------------------------------------- /hooks/Vent.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_hooks.h" 3 | #include "state.hpp" 4 | #include "logger.h" 5 | #include 6 | 7 | float dVent_CanUse(Vent* __this, NetworkedPlayerInfo* pc, bool* canUse, bool* couldUse, MethodInfo* method) { 8 | if (State.ShowHookLogs) LOG_DEBUG("Hook dVent_CanUse executed"); 9 | if (!State.PanicMode && (State.UnlockVents || (*Game::pLocalPlayer)->fields.inVent)) { 10 | auto object = NetworkedPlayerInfo_get_Object(pc, nullptr); 11 | if (!object) { 12 | LOG_ERROR(ToString(pc) + " _object is null"); 13 | return app::Vent_CanUse(__this, pc, canUse, couldUse, method); 14 | } 15 | 16 | auto ventTransform = app::Component_get_transform((Component_1*)__this, NULL); 17 | auto ventVector = app::Transform_get_position(ventTransform, NULL); 18 | 19 | auto playerPosition = app::PlayerControl_GetTruePosition(object, NULL); 20 | 21 | float ventDistance = app::Vector2_Distance(playerPosition, { ventVector.x, ventVector.y }, NULL); 22 | if (pc->fields.IsDead) { 23 | *canUse = false; 24 | *couldUse = false; 25 | } 26 | else { 27 | *canUse = (ventDistance < app::Vent_get_UsableDistance(__this, NULL)); 28 | *couldUse = true; 29 | } 30 | return ventDistance; 31 | } 32 | 33 | return app::Vent_CanUse(__this, pc, canUse, couldUse, method); 34 | }; 35 | 36 | void dVent_EnterVent(Vent* __this, PlayerControl* pc, MethodInfo * method) { 37 | if (State.ShowHookLogs) LOG_DEBUG("Hook dVent_EnterVent executed"); 38 | if (!State.PanicMode) { 39 | auto ventVector = app::Transform_get_position(app::Component_get_transform((Component_1*)__this, NULL), NULL); 40 | app::Vector2 ventVector2D = { ventVector.x, ventVector.y }; 41 | synchronized(Replay::replayEventMutex) { 42 | State.liveReplayEvents.emplace_back(std::make_unique(GetEventPlayerControl(pc).value(), ventVector2D, VENT_ACTIONS::VENT_ENTER)); 43 | State.liveConsoleEvents.emplace_back(std::make_unique(GetEventPlayerControl(pc).value(), ventVector2D, VENT_ACTIONS::VENT_ENTER)); 44 | } 45 | if (State.confuser && State.confuseOnVent && pc == *Game::pLocalPlayer) 46 | ControlAppearance(true); 47 | } 48 | Vent_EnterVent(__this, pc, method); 49 | } 50 | 51 | void* dVent_ExitVent(Vent* __this, PlayerControl* pc, MethodInfo* method) { 52 | if (State.ShowHookLogs) LOG_DEBUG("Hook dVent_ExitVent executed"); 53 | if (!State.PanicMode) { 54 | auto ventVector = app::Transform_get_position(app::Component_get_transform((Component_1*)__this, NULL), NULL); 55 | app::Vector2 ventVector2D = { ventVector.x, ventVector.y }; 56 | synchronized(Replay::replayEventMutex) { 57 | State.liveReplayEvents.emplace_back(std::make_unique(GetEventPlayerControl(pc).value(), ventVector2D, VENT_ACTIONS::VENT_EXIT)); 58 | State.liveConsoleEvents.emplace_back(std::make_unique(GetEventPlayerControl(pc).value(), ventVector2D, VENT_ACTIONS::VENT_EXIT)); 59 | } 60 | } 61 | return Vent_ExitVent(__this, pc, method); 62 | } 63 | 64 | bool dVent_TryMoveToVent(Vent* __this, Vent* otherVent, String** error, MethodInfo* method) { 65 | if (State.ShowHookLogs) LOG_DEBUG("Hook dVent_TryMoveToVent executed"); 66 | if (!State.PanicMode && *Game::pLocalPlayer != NULL) { 67 | bool wasVisible = PlayerControl_get_Visible(*Game::pLocalPlayer, NULL) && !(*Game::pLocalPlayer)->fields.walkingToVent && State.ShowPlayersInVents && !GetPlayerData(*Game::pLocalPlayer)->fields.IsDead; 68 | if (wasVisible) { 69 | PlayerControl_set_Visible(*Game::pLocalPlayer, false, NULL); 70 | } 71 | return Vent_TryMoveToVent(__this, otherVent, error, method); 72 | } 73 | else return Vent_TryMoveToVent(__this, otherVent, error, method); 74 | } 75 | 76 | /*void dVentilationSystem_Update(VentilationSystem_Operation__Enum op, int32_t ventId, MethodInfo* method) { 77 | VentilationSystem_Update(op, ventId, method); 78 | if (State.FlipSkeld && IsHost() && op == VentilationSystem_Operation__Enum::Exit && *Game::pLocalPlayer != NULL) 79 | (*Game::pLocalPlayer)->fields.inVent = false; // Fix venting on Dleks 80 | }*/ 81 | 82 | void dPlayerPhysics_RpcExitVent(PlayerPhysics* __this, int32_t id, MethodInfo* method) { 83 | if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerPhysics_RpcExitVent executed"); 84 | PlayerPhysics_RpcExitVent(__this, id, method); 85 | /*if (State.FlipSkeld && IsHost() && *Game::pLocalPlayer != NULL && __this->fields.myPlayer != NULL && __this->fields.myPlayer == *Game::pLocalPlayer) 86 | (*Game::pLocalPlayer)->fields.inVent = false; // Fix venting on Dleks*/ 87 | // Not necessary with v16.0.0 :Cool: 88 | } -------------------------------------------------------------------------------- /hooks/_hooks.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/hooks/_hooks.cpp -------------------------------------------------------------------------------- /includes/crc32.h: -------------------------------------------------------------------------------- 1 | // ////////////////////////////////////////////////////////// 2 | // crc32.h 3 | // Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. 4 | // see http://create.stephan-brumme.com/disclaimer.html 5 | // 6 | 7 | #pragma once 8 | 9 | //#include "hash.h" 10 | #include 11 | 12 | // define fixed size integer types 13 | #ifdef _MSC_VER 14 | // Windows 15 | typedef unsigned __int8 uint8_t; 16 | typedef unsigned __int32 uint32_t; 17 | #else 18 | // GCC 19 | #include 20 | #endif 21 | 22 | 23 | /// compute CRC32 hash, based on Intel's Slicing-by-8 algorithm 24 | /** Usage: 25 | CRC32 crc32; 26 | std::string myHash = crc32("Hello World"); // std::string 27 | std::string myHash2 = crc32("How are you", 11); // arbitrary data, 11 bytes 28 | 29 | // or in a streaming fashion: 30 | 31 | CRC32 crc32; 32 | while (more data available) 33 | crc32.add(pointer to fresh data, number of new bytes); 34 | std::string myHash3 = crc32.getHash(); 35 | 36 | Note: 37 | You can find code for the faster Slicing-by-16 algorithm on my website, too: 38 | http://create.stephan-brumme.com/crc32/ 39 | Its unrolled version is about twice as fast but its look-up table doubled in size as well. 40 | */ 41 | class CRC32 //: public Hash 42 | { 43 | public: 44 | /// hash is 4 bytes long 45 | enum { HashBytes = 4 }; 46 | 47 | /// same as reset() 48 | CRC32(); 49 | 50 | /// compute CRC32 of a memory block 51 | std::string operator()(const void* data, size_t numBytes); 52 | /// compute CRC32 of a string, excluding final zero 53 | std::string operator()(const std::string& text); 54 | 55 | /// add arbitrary number of bytes 56 | void add(const void* data, size_t numBytes); 57 | 58 | /// return latest hash as 8 hex characters 59 | std::string getHash(); 60 | /// return latest hash as bytes 61 | void getHash(unsigned char buffer[HashBytes]); 62 | 63 | /// restart 64 | void reset(); 65 | 66 | private: 67 | /// hash 68 | uint32_t m_hash; 69 | }; 70 | -------------------------------------------------------------------------------- /includes/directx11.cpp: -------------------------------------------------------------------------------- 1 | #include "directx11.h" 2 | 3 | directx11::directx11() 4 | { 5 | WNDCLASSEX windowClass = { 6 | sizeof(WNDCLASSEX), 7 | CS_HREDRAW | CS_VREDRAW, 8 | DefWindowProc, 9 | 0, 10 | 0, 11 | GetModuleHandle(NULL), 12 | NULL, 13 | NULL, 14 | NULL, 15 | NULL, 16 | L"DirectX 11", 17 | NULL, 18 | }; 19 | 20 | RegisterClassEx(&windowClass); 21 | HWND window = CreateWindow(windowClass.lpszClassName, L"DirectX 11 Window", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, NULL, NULL, windowClass.hInstance, NULL); 22 | 23 | D3D_FEATURE_LEVEL featureLevel; 24 | const D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_11_0 }; 25 | 26 | DXGI_MODE_DESC bufferDesc = { 27 | 100, 28 | 100, 29 | {60, 1}, 30 | DXGI_FORMAT_R8G8B8A8_UNORM, 31 | DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED, 32 | DXGI_MODE_SCALING_UNSPECIFIED, 33 | }; 34 | 35 | DXGI_SWAP_CHAIN_DESC swapChainDesc = { 36 | bufferDesc, 37 | {1, 0}, 38 | DXGI_USAGE_RENDER_TARGET_OUTPUT, 39 | 1, 40 | window, 41 | 1, 42 | DXGI_SWAP_EFFECT_DISCARD, 43 | DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH, 44 | }; 45 | 46 | IDXGISwapChain* pSwapChain; 47 | ID3D11Device* pDevice; 48 | ID3D11DeviceContext* pContext; 49 | 50 | HRESULT result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, featureLevels, 2, D3D11_SDK_VERSION, &swapChainDesc, &pSwapChain, &pDevice, &featureLevel, &pContext); 51 | 52 | if (FAILED(result)) { 53 | DestroyWindow(window); 54 | UnregisterClass(windowClass.lpszClassName, windowClass.hInstance); 55 | return; 56 | } 57 | 58 | void** pVMT = *(void***)pSwapChain; 59 | presentFunction = (D3D_PRESENT_FUNCTION)pVMT[8]; 60 | 61 | if (pSwapChain) { 62 | pSwapChain->Release(); 63 | pSwapChain = NULL; 64 | } 65 | 66 | if (pDevice) { 67 | pDevice->Release(); 68 | pDevice = NULL; 69 | } 70 | 71 | if (pContext) { 72 | pContext->Release(); 73 | pContext = NULL; 74 | } 75 | 76 | DestroyWindow(window); 77 | UnregisterClass(windowClass.lpszClassName, windowClass.hInstance); 78 | } -------------------------------------------------------------------------------- /includes/directx11.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | typedef HRESULT(__stdcall* D3D_PRESENT_FUNCTION)(IDXGISwapChain* __this, UINT SyncInterval, UINT Flags); 7 | 8 | class directx11 { 9 | public: 10 | D3D_PRESENT_FUNCTION presentFunction; 11 | directx11(); 12 | }; -------------------------------------------------------------------------------- /includes/imgui/imgui_impl_dx11.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer for DirectX11 2 | // This needs to be used along with a Platform Binding (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: Support for large meshes (64k+ vertices) with 16-bit indices. 7 | 8 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. 9 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp. 10 | // https://github.com/ocornut/imgui 11 | 12 | #pragma once 13 | #include "imgui.h" // IMGUI_IMPL_API 14 | 15 | struct ID3D11Device; 16 | struct ID3D11DeviceContext; 17 | 18 | IMGUI_IMPL_API bool ImGui_ImplDX11_Init(ID3D11Device* device, ID3D11DeviceContext* device_context); 19 | IMGUI_IMPL_API void ImGui_ImplDX11_Shutdown(); 20 | IMGUI_IMPL_API void ImGui_ImplDX11_NewFrame(); 21 | IMGUI_IMPL_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data); 22 | 23 | // Use if you want to reset your rendering device without losing Dear ImGui state. 24 | IMGUI_IMPL_API void ImGui_ImplDX11_InvalidateDeviceObjects(); 25 | IMGUI_IMPL_API bool ImGui_ImplDX11_CreateDeviceObjects(); 26 | -------------------------------------------------------------------------------- /includes/imgui/imgui_impl_win32.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Binding for Windows (standard windows API for 32 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 cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE). 8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | 10 | #pragma once 11 | #include "imgui.h" // IMGUI_IMPL_API 12 | 13 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd); 14 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown(); 15 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame(); 16 | 17 | // Configuration 18 | // - Disable gamepad support or linking with xinput.lib 19 | #define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD 20 | //#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT 21 | 22 | // Win32 message handler your application need to call. 23 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper. 24 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it. 25 | #if 0 26 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 27 | #endif 28 | 29 | // DPI-related helpers (optional) 30 | // - Use to enable DPI awareness without having to create an application manifest. 31 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps. 32 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc. 33 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime, 34 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies. 35 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness(); 36 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd 37 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor 38 | -------------------------------------------------------------------------------- /resources/airship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/airship.png -------------------------------------------------------------------------------- /resources/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/cross.png -------------------------------------------------------------------------------- /resources/dead_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/dead_body.png -------------------------------------------------------------------------------- /resources/fungle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/fungle.png -------------------------------------------------------------------------------- /resources/kill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/kill.png -------------------------------------------------------------------------------- /resources/mira_hq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/mira_hq.png -------------------------------------------------------------------------------- /resources/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/pause.png -------------------------------------------------------------------------------- /resources/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/play.png -------------------------------------------------------------------------------- /resources/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/player.png -------------------------------------------------------------------------------- /resources/player_visor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/player_visor.png -------------------------------------------------------------------------------- /resources/polus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/polus.png -------------------------------------------------------------------------------- /resources/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/report.png -------------------------------------------------------------------------------- /resources/resource_data.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by resource_data.rc 4 | // 5 | #define IDB_PNG1 101 6 | #define IDB_PNG2 102 7 | #define IDB_PNG3 103 8 | #define IDB_PNG4 104 9 | #define IDB_PNG5 105 10 | #define IDB_PNG6 106 11 | #define IDB_PNG7 107 12 | #define IDB_PNG8 108 13 | #define IDB_PNG9 109 14 | #define IDB_PNG10 110 15 | #define IDB_PNG11 111 16 | #define IDB_PNG12 112 17 | #define IDB_PNG13 113 18 | #define IDB_PNG14 114 19 | #define IDB_PNG15 115 20 | #define IDB_PNG16 116 21 | 22 | // Next default values for new objects 23 | // 24 | #ifdef APSTUDIO_INVOKED 25 | #ifndef APSTUDIO_READONLY_SYMBOLS 26 | #define _APS_NEXT_RESOURCE_VALUE 117 27 | #define _APS_NEXT_COMMAND_VALUE 40001 28 | #define _APS_NEXT_CONTROL_VALUE 1001 29 | #define _APS_NEXT_SYMED_VALUE 101 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /resources/resource_data.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource_data.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (United States) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource_data.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // PNG 51 | // 52 | 53 | IDB_PNG1 PNG "skeld.png" 54 | 55 | IDB_PNG2 PNG "mira_hq.png" 56 | 57 | IDB_PNG3 PNG "polus.png" 58 | 59 | IDB_PNG4 PNG "airship.png" 60 | 61 | IDB_PNG5 PNG "vent_in.png" 62 | 63 | IDB_PNG6 PNG "vent_out.png" 64 | 65 | IDB_PNG7 PNG "kill.png" 66 | 67 | IDB_PNG8 PNG "report.png" 68 | 69 | IDB_PNG9 PNG "tick.png" 70 | 71 | IDB_PNG10 PNG "player.png" 72 | 73 | IDB_PNG11 PNG "cross.png" 74 | 75 | IDB_PNG12 PNG "dead_body.png" 76 | 77 | IDB_PNG13 PNG "play.png" 78 | 79 | IDB_PNG14 PNG "pause.png" 80 | 81 | IDB_PNG15 PNG "fungle.png" 82 | 83 | IDB_PNG16 PNG "player_visor.png" 84 | 85 | #endif // English (United States) resources 86 | ///////////////////////////////////////////////////////////////////////////// 87 | 88 | 89 | 90 | #ifndef APSTUDIO_INVOKED 91 | ///////////////////////////////////////////////////////////////////////////// 92 | // 93 | // Generated from the TEXTINCLUDE 3 resource. 94 | // 95 | 96 | 97 | ///////////////////////////////////////////////////////////////////////////// 98 | #endif // not APSTUDIO_INVOKED 99 | 100 | -------------------------------------------------------------------------------- /resources/skeld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/skeld.png -------------------------------------------------------------------------------- /resources/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/tick.png -------------------------------------------------------------------------------- /resources/vent_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/vent_in.png -------------------------------------------------------------------------------- /resources/vent_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/resources/vent_out.png -------------------------------------------------------------------------------- /rpc/CmdCheckMurder.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | 5 | CmdCheckMurder::CmdCheckMurder(const PlayerSelection& target) 6 | { 7 | this->target = target; 8 | } 9 | 10 | void CmdCheckMurder::Process() 11 | { 12 | if (!target.has_value()) return; 13 | PlayerControl_CmdCheckMurder(*Game::pLocalPlayer, target.get_PlayerControl().value_or(nullptr), NULL); 14 | } -------------------------------------------------------------------------------- /rpc/RpcCloseDoorsOfType.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | 6 | using namespace std::string_view_literals; 7 | 8 | RpcCloseDoorsOfType::RpcCloseDoorsOfType(SystemTypes__Enum selectedSystem, bool pinDoor) 9 | { 10 | this->selectedSystem = selectedSystem; 11 | this->pinDoor = pinDoor; 12 | } 13 | 14 | void RpcCloseDoorsOfType::Process() 15 | { 16 | if (selectedSystem == SystemTypes__Enum::Decontamination || selectedSystem == SystemTypes__Enum::Decontamination2 || selectedSystem == SystemTypes__Enum::Decontamination3) 17 | return; 18 | app::ShipStatus_RpcCloseDoorsOfType(*Game::pShipStatus, this->selectedSystem, NULL); 19 | if (this->pinDoor) 20 | State.pinnedDoors.push_back(this->selectedSystem); 21 | } 22 | 23 | RpcOpenDoorsOfType::RpcOpenDoorsOfType(SystemTypes__Enum selectedSystem) 24 | { 25 | this->selectedSystem = selectedSystem; 26 | } 27 | 28 | void RpcOpenDoorsOfType::Process() 29 | { 30 | if (selectedSystem == SystemTypes__Enum::Decontamination || selectedSystem == SystemTypes__Enum::Decontamination2 || selectedSystem == SystemTypes__Enum::Decontamination3) 31 | return; 32 | for (auto door : il2cpp::Array((*Game::pShipStatus)->fields.AllDoors)) 33 | { 34 | if (door->fields.Room == selectedSystem) 35 | { 36 | app::ShipStatus_RpcUpdateSystem(*Game::pShipStatus, SystemTypes__Enum::Doors, (uint8_t)(door->fields.Id | 64), NULL); 37 | if ("PlainDoor"sv == door->klass->name) app::PlainDoor_SetDoorway(reinterpret_cast(door), true, {}); 38 | else if ("MushroomWallDoor"sv == door->klass->name) app::MushroomWallDoor_SetDoorway(reinterpret_cast(door), true, {}); 39 | } 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /rpc/RpcCompleteTask.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | 6 | RpcCompleteTask::RpcCompleteTask(uint32_t taskId) 7 | { 8 | this->taskId = taskId; 9 | } 10 | 11 | void RpcCompleteTask::Process() 12 | { 13 | auto tasks = GetNormalPlayerTasks(*Game::pLocalPlayer); 14 | 15 | for (auto task : tasks) { 16 | if (task->fields._._Id_k__BackingField == taskId && !NormalPlayerTask_get_IsComplete(task, NULL)) { 17 | CompleteTask(task); 18 | } 19 | } 20 | } 21 | 22 | RpcForceCompleteTask::RpcForceCompleteTask(PlayerControl* Player, uint32_t taskId) 23 | { 24 | this->Player = Player; 25 | this->taskId = taskId; 26 | } 27 | 28 | void RpcForceCompleteTask::Process() 29 | { 30 | if (Player == nullptr) return; 31 | 32 | auto tasks = GetNormalPlayerTasks(Player); 33 | 34 | for (auto task : tasks) { 35 | if (task->fields._._Id_k__BackingField == taskId && !NormalPlayerTask_get_IsComplete(task, NULL)) { 36 | PlayerControl_RpcCompleteTask(Player, task->fields._._Id_k__BackingField, NULL); 37 | while (task->fields.taskStep < task->fields.MaxStep) 38 | app::NormalPlayerTask_NextStep(task, NULL); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /rpc/RpcPlayAnimation.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | RpcPlayAnimation::RpcPlayAnimation(uint8_t animId) 6 | { 7 | this->animId = animId; 8 | } 9 | 10 | void RpcPlayAnimation::Process() 11 | { 12 | if (State.BypassVisualTasks) { 13 | PlayerControl_PlayAnimation((*Game::pLocalPlayer), animId, NULL); 14 | auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), (*Game::pLocalPlayer)->fields._.NetId, uint8_t(RpcCalls__Enum::PlayAnimation), SendOption__Enum::None, -1, NULL); 15 | MessageWriter_WriteByte(writer, animId, NULL); 16 | MessageWriter_EndMessage(writer, NULL); 17 | return; 18 | } 19 | PlayerControl_RpcPlayAnimation(*Game::pLocalPlayer, animId, NULL); 20 | } -------------------------------------------------------------------------------- /rpc/RpcPlayerAppearance.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | 5 | RpcSetPet::RpcSetPet(String* petId) 6 | { 7 | this->PetId = petId ? petId : convert_to_string("0"); 8 | } 9 | 10 | void RpcSetPet::Process() 11 | { 12 | PlayerControl_RpcSetPet((*Game::pLocalPlayer), this->PetId, NULL); 13 | } 14 | 15 | RpcForcePet::RpcForcePet(PlayerControl* Player, String* petId) 16 | { 17 | this->Player = Player; 18 | this->PetId = petId ? petId : convert_to_string("0"); 19 | } 20 | 21 | void RpcForcePet::Process() 22 | { 23 | if (!PlayerSelection(Player).has_value()) return; 24 | 25 | PlayerControl_RpcSetPet(Player, this->PetId, NULL); 26 | } 27 | 28 | RpcSetSkin::RpcSetSkin(String* skinId) 29 | { 30 | this->SkinId = skinId ? skinId : convert_to_string("0"); 31 | } 32 | 33 | void RpcSetSkin::Process() 34 | { 35 | PlayerControl_RpcSetSkin((*Game::pLocalPlayer), this->SkinId, NULL); 36 | } 37 | 38 | RpcForceSkin::RpcForceSkin(PlayerControl* Player, String* skinId) 39 | { 40 | this->Player = Player; 41 | this->SkinId = skinId ? skinId : convert_to_string("0"); 42 | } 43 | 44 | void RpcForceSkin::Process() 45 | { 46 | if (!PlayerSelection(Player).has_value()) return; 47 | 48 | PlayerControl_RpcSetSkin(Player, this->SkinId, NULL); 49 | } 50 | 51 | RpcSetHat::RpcSetHat(String* hatId) 52 | { 53 | this->HatId = hatId ? hatId : convert_to_string("0"); 54 | } 55 | 56 | void RpcSetHat::Process() 57 | { 58 | PlayerControl_RpcSetHat((*Game::pLocalPlayer), this->HatId, NULL); 59 | } 60 | 61 | RpcForceHat::RpcForceHat(PlayerControl* Player, String* hatId) 62 | { 63 | this->Player = Player; 64 | this->HatId = hatId ? hatId : convert_to_string("0"); 65 | } 66 | 67 | void RpcForceHat::Process() 68 | { 69 | if (!PlayerSelection(Player).has_value()) return; 70 | 71 | PlayerControl_RpcSetHat(Player, this->HatId, NULL); 72 | } 73 | 74 | RpcSetVisor::RpcSetVisor(String* visorId) 75 | { 76 | this->VisorId = visorId ? visorId : convert_to_string("0"); 77 | } 78 | 79 | void RpcSetVisor::Process() 80 | { 81 | PlayerControl_RpcSetVisor((*Game::pLocalPlayer), this->VisorId, NULL); 82 | } 83 | 84 | RpcForceVisor::RpcForceVisor(PlayerControl* Player, String* visorId) 85 | { 86 | this->Player = Player; 87 | this->VisorId = visorId ? visorId : convert_to_string("0"); 88 | } 89 | 90 | void RpcForceVisor::Process() 91 | { 92 | if (!PlayerSelection(Player).has_value()) return; 93 | 94 | PlayerControl_RpcSetVisor(Player, this->VisorId, NULL); 95 | } 96 | 97 | RpcSetNamePlate::RpcSetNamePlate(String* namePlateId) 98 | { 99 | this->NamePlateId = namePlateId ? namePlateId : convert_to_string("0"); 100 | } 101 | 102 | void RpcSetNamePlate::Process() 103 | { 104 | PlayerControl_RpcSetNamePlate((*Game::pLocalPlayer), this->NamePlateId, NULL); 105 | } 106 | 107 | RpcForceNamePlate::RpcForceNamePlate(PlayerControl* Player, String* namePlateId) 108 | { 109 | this->Player = Player; 110 | this->NamePlateId = namePlateId ? namePlateId : convert_to_string("0"); 111 | } 112 | 113 | void RpcForceNamePlate::Process() 114 | { 115 | if (!PlayerSelection(Player).has_value()) return; 116 | 117 | PlayerControl_RpcSetNamePlate(Player, this->NamePlateId, NULL); 118 | } -------------------------------------------------------------------------------- /rpc/RpcReportBody.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | #include "utility.h" 6 | 7 | RpcReportBody::RpcReportBody(const PlayerSelection& target) 8 | { 9 | this->reportedPlayer = target; 10 | } 11 | 12 | void RpcReportBody::Process() 13 | { 14 | if (Object_1_IsNull((Object_1*)*Game::pShipStatus)) return; 15 | if (IsHost() && !State.PanicMode && (State.DisableMeetings || (State.BattleRoyale || State.TaskSpeedrun))) return; 16 | PlayerControl_CmdReportDeadBody(*Game::pLocalPlayer, reportedPlayer.get_PlayerData().value_or(nullptr), nullptr); 17 | } 18 | 19 | RpcForceReportBody::RpcForceReportBody(PlayerControl* Player, const PlayerSelection& target) 20 | { 21 | this->Player = Player; 22 | this->reportedPlayer = target; 23 | } 24 | 25 | void RpcForceReportBody::Process() 26 | { 27 | if (Object_1_IsNull((Object_1*)*Game::pShipStatus)) return; 28 | if (Player == nullptr) return; 29 | if (IsHost() && !State.PanicMode && (State.DisableMeetings || (State.BattleRoyale || State.TaskSpeedrun))) return; 30 | PlayerControl_CmdReportDeadBody(Player, reportedPlayer.get_PlayerData().value_or(nullptr), nullptr); 31 | } 32 | 33 | RpcForceMeeting::RpcForceMeeting(PlayerControl* Player, const PlayerSelection& target) 34 | { 35 | this->Player = Player; 36 | this->reportedPlayer = target; 37 | } 38 | 39 | void RpcForceMeeting::Process() 40 | { 41 | if (Object_1_IsNull((Object_1*)*Game::pShipStatus)) return; 42 | if (Player == nullptr) return; 43 | if (IsHost() && !State.PanicMode && (State.DisableMeetings || (State.BattleRoyale || State.TaskSpeedrun))) return; 44 | PlayerControl_RpcStartMeeting(Player, reportedPlayer.get_PlayerData().value_or(nullptr), nullptr); 45 | } 46 | 47 | RpcSpamMeeting::RpcSpamMeeting(PlayerControl* Player, PlayerControl* target, bool inMeeting) 48 | { 49 | this->Player = Player; 50 | this->target = target; 51 | this->inMeeting = inMeeting; 52 | } 53 | 54 | void RpcSpamMeeting::Process() 55 | { 56 | if (Object_1_IsNull((Object_1*)*Game::pShipStatus)) return; 57 | if (!PlayerSelection(Player).has_value() || !PlayerSelection(target).has_value()) return; 58 | if (IsHost() && !State.PanicMode && (State.DisableMeetings || (State.BattleRoyale || State.TaskSpeedrun))) return; 59 | if (!inMeeting) PlayerControl_CmdReportDeadBody(Player, GetPlayerData(target), nullptr); 60 | for (int i = 0; i < 200; ++i) { 61 | if (!PlayerSelection(Player).has_value() || !PlayerSelection(target).has_value()) break; 62 | auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), GetPlayerData(target)->fields._.NetId, 63 | uint8_t(RpcCalls__Enum::ReportDeadBody), SendOption__Enum::None, GetPlayerData(target)->fields._.OwnerId, NULL); 64 | MessageWriter_WriteByte(writer, 255, NULL); 65 | InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL); 66 | } 67 | } 68 | 69 | RpcSpamChatNote::RpcSpamChatNote(PlayerControl* exploitedPlayer) 70 | { 71 | this->exploitedPlayer = exploitedPlayer; 72 | } 73 | 74 | void RpcSpamChatNote::Process() 75 | { 76 | if (!PlayerSelection(exploitedPlayer).has_value()) return; 77 | 78 | for (size_t i = 0; i <= 50; ++i) { 79 | PlayerControl_RpcSendChatNote(*Game::pLocalPlayer, exploitedPlayer->fields.PlayerId, (ChatNoteTypes__Enum)1, NULL); 80 | } 81 | } -------------------------------------------------------------------------------- /rpc/RpcSetColor.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | 5 | RpcSetColor::RpcSetColor(uint8_t bodyColor, bool force) 6 | { 7 | this->bodyColor = bodyColor; 8 | this->forceColor = force; 9 | } 10 | 11 | void RpcSetColor::Process() 12 | { 13 | if (forceColor) 14 | PlayerControl_RpcSetColor(*Game::pLocalPlayer, bodyColor, NULL); 15 | else 16 | PlayerControl_CmdCheckColor(*Game::pLocalPlayer, bodyColor, NULL); 17 | } 18 | 19 | RpcForceColor::RpcForceColor(PlayerControl* player, uint8_t bodyColor) 20 | { 21 | this->Player = player; 22 | this->bodyColor = bodyColor; 23 | } 24 | 25 | void RpcForceColor::Process() 26 | { 27 | if (!PlayerSelection(Player).has_value()) return; 28 | 29 | for (auto p : GetAllPlayerControl()) { 30 | auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), Player->fields._.NetId, 31 | uint8_t(RpcCalls__Enum::SetColor), SendOption__Enum::None, p->fields._.OwnerId, NULL); 32 | MessageWriter_WriteByte(writer, uint8_t(bodyColor), NULL); 33 | InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL); 34 | } 35 | 36 | PlayerControl_RpcSetColor(Player, bodyColor, NULL); 37 | } -------------------------------------------------------------------------------- /rpc/RpcSetName.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | 5 | RpcSetName::RpcSetName(std::string_view name) 6 | { 7 | this->name = name; 8 | } 9 | 10 | void RpcSetName::Process() 11 | { 12 | PlayerControl_CmdCheckName(*Game::pLocalPlayer, convert_to_string(name), NULL); 13 | } 14 | 15 | RpcForceName::RpcForceName(PlayerControl* player, std::string_view name) 16 | { 17 | this->Player = player; 18 | this->name = name; 19 | } 20 | 21 | void RpcForceName::Process() 22 | { 23 | if (Player == nullptr) return; 24 | 25 | PlayerControl_CmdCheckName(Player, convert_to_string(name), NULL); 26 | } -------------------------------------------------------------------------------- /rpc/RpcSetRole.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "utility.h" 5 | 6 | RpcSetRole::RpcSetRole(PlayerControl* player, RoleTypes__Enum role) 7 | { 8 | this->Player = player; 9 | this->Role = role; 10 | } 11 | 12 | void RpcSetRole::Process() 13 | { 14 | if (Player == nullptr) return; 15 | 16 | //bool isDeadRole = Role == RoleTypes__Enum::CrewmateGhost || Role == RoleTypes__Enum::GuardianAngel || Role == RoleTypes__Enum::ImpostorGhost; 17 | 18 | PlayerControl_RpcSetRole(Player, Role, true, NULL); 19 | } 20 | 21 | SetRole::SetRole(RoleTypes__Enum role) 22 | { 23 | this->Role = role; 24 | } 25 | 26 | void SetRole::Process() 27 | { 28 | PlayerControl_CoSetRole(*Game::pLocalPlayer, Role, false, NULL); 29 | RoleManager_SetRole(Game::RoleManager.GetInstance(), *Game::pLocalPlayer, Role, NULL); 30 | } -------------------------------------------------------------------------------- /rpc/RpcSetScanner.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | RpcSetScanner::RpcSetScanner(bool playAnimation) 6 | { 7 | this->playAnimation = playAnimation; 8 | } 9 | 10 | void RpcSetScanner::Process() 11 | { 12 | if (State.BypassVisualTasks) { 13 | PlayerControl_SetScanner(*Game::pLocalPlayer, playAnimation, (*Game::pLocalPlayer)->fields.scannerCount + 1); 14 | auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), (*Game::pLocalPlayer)->fields._.NetId, 15 | uint8_t(RpcCalls__Enum::SetScanner), SendOption__Enum::None, -1, NULL); 16 | MessageWriter_WriteBoolean(writer, playAnimation, NULL); 17 | MessageWriter_WriteByte(writer, (*Game::pLocalPlayer)->fields.scannerCount + 1, NULL); 18 | MessageWriter_EndMessage(writer, NULL); 19 | return; 20 | } 21 | 22 | PlayerControl_RpcSetScanner(*Game::pLocalPlayer, playAnimation, NULL); 23 | } 24 | 25 | RpcForceScanner::RpcForceScanner(PlayerControl* Player, bool playAnimation) 26 | { 27 | this->Player = Player; 28 | this->playAnimation = playAnimation; 29 | } 30 | 31 | void RpcForceScanner::Process() 32 | { 33 | if (Player == nullptr) return; 34 | 35 | //PlayerControl_RpcSetScanner(Player, playAnimation, NULL); 36 | 37 | for (auto p : GetAllPlayerControl()) { 38 | MessageWriter* writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), Player->fields._.NetId, 39 | uint8_t(RpcCalls__Enum::SetScanner), SendOption__Enum::None, p->fields._.OwnerId, NULL); 40 | MessageWriter_WriteBoolean(writer, playAnimation, NULL); 41 | MessageWriter_WriteByte(writer, Player->fields.scannerCount + 1, NULL); 42 | InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL); 43 | } 44 | } -------------------------------------------------------------------------------- /rpc/RpcSnapTo.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | 5 | RpcSnapTo::RpcSnapTo(Vector2 targetVector) 6 | { 7 | this->targetVector = targetVector; 8 | } 9 | 10 | void RpcSnapTo::Process() 11 | { 12 | CustomNetworkTransform_RpcSnapTo((*Game::pLocalPlayer)->fields.NetTransform, targetVector, NULL); 13 | } 14 | 15 | RpcForceSnapTo::RpcForceSnapTo(PlayerControl* Player, Vector2 targetVector) 16 | { 17 | this->Player = Player; 18 | this->targetVector = targetVector; 19 | } 20 | 21 | void RpcForceSnapTo::Process() 22 | { 23 | if (!PlayerSelection(Player).has_value()) return; 24 | 25 | CustomNetworkTransform_SnapTo(Player->fields.NetTransform, targetVector, Player->fields.NetTransform->fields.lastSequenceId + 100, NULL); 26 | for (auto p : GetAllPlayerControl()) { 27 | if (p == *Game::pLocalPlayer) continue; 28 | auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), Player->fields.NetTransform->fields._.NetId, 29 | uint8_t(RpcCalls__Enum::SnapTo), SendOption__Enum::None, p->fields._.OwnerId, NULL); 30 | NetHelpers_WriteVector2(targetVector, writer, NULL); 31 | MessageWriter_WriteUShort(writer, Player->fields.NetTransform->fields.lastSequenceId + 100, NULL); 32 | InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL); 33 | } 34 | Player->fields.NetTransform->fields.lastSequenceId += 100; 35 | 36 | CustomNetworkTransform_RpcSnapTo((Player)->fields.NetTransform, targetVector, NULL); 37 | } -------------------------------------------------------------------------------- /rpc/RpcUpdateSystem.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | #include "utility.h" 6 | 7 | RpcUpdateSystem::RpcUpdateSystem(SystemTypes__Enum selectedSystem, SystemTypes__Enum amount) 8 | { 9 | this->selectedSystem = selectedSystem; 10 | this->amount = (uint32_t)amount; 11 | } 12 | 13 | RpcUpdateSystem::RpcUpdateSystem(SystemTypes__Enum selectedSystem, uint32_t amount) 14 | { 15 | this->selectedSystem = selectedSystem; 16 | this->amount = amount; 17 | } 18 | 19 | void RpcUpdateSystem::Process() 20 | { 21 | if (IsHost() && !State.PanicMode && (State.DisableSabotages || (State.BattleRoyale || State.TaskSpeedrun))) return; 22 | ShipStatus_RpcUpdateSystem(*Game::pShipStatus, this->selectedSystem, this->amount, NULL); 23 | } -------------------------------------------------------------------------------- /rpc/RpcUsePlatform.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "_rpc.h" 3 | #include "game.h" 4 | #include "state.hpp" 5 | #include "logger.h" 6 | #include "utility.h" 7 | 8 | RpcUsePlatform::RpcUsePlatform() 9 | { 10 | 11 | } 12 | 13 | void RpcUsePlatform::Process() 14 | { 15 | if (State.mapType == Settings::MapType::Airship/* && IsHost()*/) 16 | { 17 | auto shipStatus = (AirshipStatus*)*(Game::pShipStatus); 18 | auto movingPlatform = shipStatus->fields.GapPlatform; 19 | if (movingPlatform->fields.Target == nullptr) //If the platform is in use, this would cause unknown behaviour. 20 | MovingPlatformBehaviour_SetSide(movingPlatform, !movingPlatform->fields.IsLeft, NULL); 21 | 22 | STREAM_DEBUG("Moving Platform warped to " << (movingPlatform->fields.IsLeft ? "Left" : "Right")); 23 | } 24 | } -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g0aty/SickoMenu/2db5f2c3f3f466775d8216fe1b95e93f16a59c1c/screenshot.png -------------------------------------------------------------------------------- /used_types.txt: -------------------------------------------------------------------------------- 1 | Object 2 | RuntimeTypeHandle 3 | Type 4 | String 5 | Object_1 6 | Component_1 7 | Behaviour 8 | Camera 9 | Vector3 10 | Camera__Array 11 | Exception 12 | Renderer 13 | Matrix4x4 14 | Color32 15 | Color 16 | Vector2 17 | Vector4 18 | Transform 19 | GameObject 20 | Object_1__Array 21 | SpriteRenderer 22 | Color32__Array 23 | Scene 24 | Collider2D 25 | MessageReader 26 | Byte__Array 27 | SendOption__Enum 28 | MessageWriter 29 | MonoBehaviour 30 | Extents 31 | # ------------ TMP Dependencies ------------ # 32 | UIBehaviour__Fields 33 | Graphic__Fields 34 | MaskableGraphic__Fields 35 | MaterialReference 36 | TMP_TextProcessingStack_1_MaterialReference_ 37 | VertexGradient 38 | TMP_TextProcessingStack_1_System_Single_ 39 | TMP_TextProcessingStack_1_FontWeight_ 40 | TMP_FontStyleStack 41 | TMP_TextProcessingStack_1_HorizontalAlignmentOptions_ 42 | TMP_LineInfo 43 | TMP_TextProcessingStack_1_System_Int32_ 44 | TMP_TextProcessingStack_1_UnityEngine_Color32_ 45 | TMP_Offset 46 | HighlightState 47 | TMP_TextProcessingStack_1_HighlightState_ 48 | TMP_TextProcessingStack_1_TMP_ColorGradient_ 49 | WordWrapState 50 | TMP_TextProcessingStack_1_WordWrapState_ 51 | TMP_Text_SpecialCharacter 52 | TextBoxTMP 53 | TextBoxTMP__Fields 54 | # ------------ End TMP Dependencies ------------ # 55 | TMP_Text 56 | TextMeshPro 57 | PlayerOutfitType__Enum 58 | AccountTab 59 | EOSManager 60 | FullAccount 61 | SpawnFlags__Enum 62 | InnerNetObject 63 | GameOverReason__Enum 64 | GameManager 65 | PlainDoor__Array 66 | PlayerVoteArea 67 | PlayerVoteArea__Array 68 | SystemTypes__Enum 69 | PlainShipRoom 70 | PlainShipRoom__Array 71 | ShipStatus_MapType__Enum 72 | ShipStatus 73 | StringNames__Enum 74 | SwitchSystem 75 | ISystemType 76 | Dictionary_2_TKey_TValue_Entry_SystemTypes_ISystemType_ 77 | Dictionary_2_TKey_TValue_Entry_SystemTypes_ISystemType___Array 78 | Dictionary_2_TKey_TValue_KeyCollection_SystemTypes_ISystemType_ 79 | Dictionary_2_TKey_TValue_ValueCollection_SystemTypes_ISystemType_ 80 | Dictionary_2_SystemTypes_ISystemType_ 81 | AirshipStatus 82 | NetworkedPlayerInfo_PlayerOutfit 83 | Int32__Array 84 | Dictionary_2_TKey_TValue_Entry_PlayerOutfitType_NetworkedPlayerInfo_PlayerOutfit_ 85 | Dictionary_2_TKey_TValue_Entry_PlayerOutfitType_NetworkedPlayerInfo_PlayerOutfit___Array 86 | Dictionary_2_PlayerOutfitType_NetworkedPlayerInfo_PlayerOutfit_ 87 | RoleTypes__Enum 88 | RoleTeamTypes__Enum 89 | QuickChatModes__Enum 90 | RoleBehaviour 91 | NetworkedPLayerInfo 92 | MovingPlatformBehaviour 93 | TransitionType__Enum 94 | Minigame_CloseState__Enum 95 | Minigame 96 | DoorCardSwipeGame_TaskStages__Enum 97 | DoorCardSwipeGame 98 | TaskTypes__Enum 99 | PlayerTask 100 | PlayerTask__Array 101 | List_1_PlayerTask_ 102 | VersionShower 103 | FollowerCamera 104 | GameData 105 | PoolableBehavior__Fields 106 | ChatBubble 107 | ChatController 108 | PlayerPhysics 109 | PlayerControl 110 | PlayerControl__Array 111 | List_1_PlayerControl_ 112 | DestroyableSingleton_1_HudManager___Fields 113 | HudManager 114 | KeyboardJoystick 115 | ScreenJoystick 116 | MeetingHud_VoteStates__Enum 117 | MeetingHud 118 | CustomNetworkTransform 119 | MainMenuManager 120 | DisconnectReasons__Enum 121 | MatchMakerModes__Enum 122 | GameModes__Enum 123 | InnerNetClient_GameStates__Enum 124 | InnerNetClient 125 | DiscoveryState__Enum 126 | AmongUsClient 127 | ClientData 128 | ClientData__Array 129 | List_1_InnerNet_ClientData_ 130 | VoteBanSystem 131 | GameStartManager 132 | LobbyBehaviour 133 | NoShadowBehaviour 134 | PingTracker 135 | PolusShipStatus 136 | DoorBreakerGame 137 | SabotageTask 138 | ElectricTask 139 | DeadBody 140 | DeadBody__Array 141 | PetData__Array 142 | DestroyableSingleton_1_HatManager___Fields 143 | HatManager 144 | ScriptableObject 145 | LimitedTime 146 | LimitedTimeStartEnd 147 | CosmeticData 148 | NamePlateData 149 | FollowerCamera__Fields 150 | AmongUsClient__Fields 151 | PetBehaviour 152 | PetData 153 | List_1_PetData_ 154 | IEnumerator_1_PetData_ 155 | List_1_HatBehaviour_ 156 | SkinData 157 | SkinData__Array 158 | List_1_SkinData_ 159 | TaskBarMode__Enum 160 | GameOptionsData 161 | List_1_NetworkedPlayerInfo_ 162 | RoleOptionsData 163 | RoleTypes__Enum__Array 164 | List_1_RoleTypes_ 165 | BinaryReader 166 | SomeKindaDoor__Fields 167 | PlainDoor 168 | AutoOpenDoor 169 | Vent 170 | NormalPlayerTask_TimerState__Enum 171 | NormalPlayerTask 172 | Palette 173 | ControlTypes__Enum 174 | SaveManager 175 | DestroyableSingleton_1_RoleManager_ 176 | EngineerRole 177 | RoleManager 178 | HatData 179 | HatData__Array 180 | List_1_HatData_ 181 | StatsManager_Stats 182 | SkinLayer 183 | VoteSpreader__Fields 184 | RoleEffectAnimation_EffectType__Enum 185 | RoleEffectAnimation__Fields 186 | PlayerControl__Fields 187 | PlayerMaterial_Properties 188 | CosmeticsLayer__Fields 189 | DestroyableSingleton_1_AccountManager___Fields 190 | AccountManager__Fields 191 | KWSPermissionStatus__Enum 192 | EOSManager_AccountLoginStatus__Enum 193 | DestroyableSingleton_1_PlayerStorageManager___Fields 194 | PlayerStorageManager_CloudPlayerPrefs 195 | PlayerStorageManager__Fields 196 | <<<<<<< HEAD 197 | UpdateState__Enum 198 | ======= 199 | UpdateState__Enum 200 | AbstractChatInputField__Fields 201 | FreeChatInputField__Fields 202 | FreeChatInputField 203 | >>>>>>> e5f1c6f3dbd1732fa54ae7e021bbea9492767f81 204 | -------------------------------------------------------------------------------- /user/DestroyableSingleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "logger.h" 3 | 4 | template 5 | class DestroyableSingleton : public il2cpp::generic_class { 6 | public: 7 | DestroyableSingleton() = default; 8 | 9 | DestroyableSingleton(std::string_view instanceSignature) 10 | : _instanceSignature(instanceSignature) { 11 | } 12 | 13 | bool IsInstanceExists() { 14 | if (!is_inited() && !_init()) 15 | return false; 16 | return ((bool(*)(const void*))(_get_InstanceExists->methodPointer))(_get_InstanceExists); 17 | } 18 | 19 | T GetInstance() { 20 | if (!is_inited() && !_init()) 21 | return T{}; 22 | return ((T(*)(const void*))(_get_Instance->methodPointer))(_get_Instance); 23 | } 24 | 25 | protected: 26 | std::string _instanceSignature; 27 | const MethodInfo* _get_Instance = nullptr; 28 | const MethodInfo* _get_InstanceExists = nullptr; 29 | 30 | bool _init() { 31 | if (init("Assembly-CSharp, DestroyableSingleton", 32 | { _instanceSignature })) { 33 | _get_Instance = il2cpp_class_get_method_from_name(_klass, "get_Instance", 0); 34 | LOG_ASSERT(_get_Instance); 35 | _get_InstanceExists = il2cpp_class_get_method_from_name(_klass, "get_InstanceExists", 0); 36 | LOG_ASSERT(_get_InstanceExists); 37 | return true; 38 | } 39 | else { 40 | LOG_ERROR("init failed"); 41 | } 42 | return false; 43 | } 44 | }; -------------------------------------------------------------------------------- /user/achievements.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "DestroyableSingleton.h" 3 | #include "utility.h" 4 | #include "achievements.hpp" 5 | #include "logger.h" 6 | 7 | namespace Achievements { 8 | 9 | _Ret_maybenull_ AchievementManager_1* GetAchievementManager() { 10 | static DestroyableSingleton accountManager{ "Assembly-CSharp, AccountManager" }; 11 | if (!accountManager.IsInstanceExists() 12 | || accountManager.GetInstance()->fields.prevLoggedInStatus == EOSManager_AccountLoginStatus__Enum::Offline) 13 | return nullptr; 14 | 15 | static DestroyableSingleton manager{ "Assembly-CSharp, AchievementManager" }; 16 | return manager.GetInstance(); 17 | } 18 | 19 | bool IsSupported() { 20 | return GetAchievementManager() != nullptr; 21 | } 22 | 23 | void UnlockAll() { 24 | auto manager = GetAchievementManager(); 25 | if (!manager) return; 26 | 27 | ScopedThreadAttacher managedThreadAttached; 28 | /*il2cpp::Dictionary achievementGameModeKey = manager->klass->static_fields->AchievementGameModeKey; 29 | for (auto pair : achievementGameModeKey) { 30 | il2cpp::List list = pair.value; 31 | if (!list.contains(app::GameModes__Enum::Normal)) { 32 | list.add(app::GameModes__Enum::Normal); 33 | } 34 | if (!list.contains(app::GameModes__Enum::HideNSeek)) { 35 | list.add(app::GameModes__Enum::HideNSeek); 36 | } 37 | app::AchievementManager_1_UnlockAchievement(manager, pair.key, nullptr); 38 | }*/ 39 | } 40 | } -------------------------------------------------------------------------------- /user/achievements.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | namespace Achievements { 3 | bool IsSupported(); 4 | void UnlockAll(); 5 | } -------------------------------------------------------------------------------- /user/game.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "game.h" 3 | #include "SignatureScan.hpp" 4 | 5 | namespace Game { 6 | AmongUsClient** pAmongUsClient = nullptr; 7 | GameData** pGameData = nullptr; 8 | List_1_PlayerControl_** pAllPlayerControls = nullptr; 9 | PlayerControl** pLocalPlayer = nullptr; 10 | ShipStatus** pShipStatus = nullptr; 11 | LobbyBehaviour** pLobbyBehaviour = nullptr; 12 | DestroyableSingleton RoleManager { "Assembly-CSharp, RoleManager" }; 13 | DestroyableSingleton HudManager { "Assembly-CSharp, HudManager" }; 14 | DestroyableSingleton AccountManager { "Assembly-CSharp, AccountManager" }; 15 | 16 | //STEAMUSERSTATS_SETACHIEVEMENT* SteamUserStats_SetAchievement = nullptr; 17 | //STEAMUSERSTATS_STORESTATS* SteamUserStats_StoreStats = nullptr; 18 | 19 | void scanGameFunctions() 20 | { 21 | //SteamUserStats_SetAchievement = SignatureScan("E8 ? ? ? ? 6A 00 E8 ? ? ? ? 83 C4 0C 5D C3 A1 ? ? ? ? F6 80 ? ? ? ? ? 74 0F 83 78 74 00 75 09 50 E8 ? ? ? ? 83 C4 04 6A 00 FF 35 ? ? ? ? E8 ? ? ? ? 83 C4 08 5D C3 CC", GetModuleHandleA("GameAssembly.dll")).ResolveCall(); 22 | //SteamUserStats_StoreStats = SignatureScan("E8 ? ? ? ? 83 C4 0C 5D C3 A1 ? ? ? ? F6 80 ? ? ? ? ? 74 0F 83 78 74 00 75 09 50 E8 ? ? ? ? 83 C4 04 6A 00 FF 35 ? ? ? ? E8 ? ? ? ? 83 C4 08 5D C3 CC", GetModuleHandleA("GameAssembly.dll")).ResolveCall(); 23 | } 24 | } -------------------------------------------------------------------------------- /user/game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DestroyableSingleton.h" 3 | 4 | using namespace app; 5 | 6 | namespace Game { 7 | constexpr size_t MAX_PLAYERS = 511; //we don't want other modders/hackers to crash our game 8 | 9 | using PlayerId = uint8_t; 10 | using ClientId = int32_t; 11 | using ColorId = int32_t; 12 | using SkinId = int32_t; 13 | 14 | using Voter = PlayerId; 15 | using VotedFor = PlayerId; 16 | 17 | constexpr ColorId NoColorId = -1; 18 | constexpr SkinId NoSkinId = -1; 19 | constexpr PlayerId NoPlayerId = -1; 20 | constexpr ClientId NoClientId = -1; 21 | constexpr ClientId HostInherit = -2; 22 | constexpr ClientId CurrentClient = -3; 23 | 24 | constexpr VotedFor HasNotVoted = 255, MissedVote = 254, SkippedVote = 253, DeadVote = 252; 25 | 26 | extern AmongUsClient** pAmongUsClient; 27 | extern GameData** pGameData; 28 | extern List_1_PlayerControl_** pAllPlayerControls; 29 | extern PlayerControl** pLocalPlayer; 30 | extern ShipStatus** pShipStatus; 31 | extern LobbyBehaviour** pLobbyBehaviour; 32 | 33 | extern DestroyableSingleton RoleManager; 34 | extern DestroyableSingleton HudManager; 35 | extern DestroyableSingleton AccountManager; 36 | 37 | //typedef bool STEAMUSERSTATS_SETACHIEVEMENT(String* pchName); 38 | //typedef bool STEAMUSERSTATS_STORESTATS(); 39 | 40 | //extern STEAMUSERSTATS_SETACHIEVEMENT* SteamUserStats_SetAchievement; 41 | //extern STEAMUSERSTATS_STORESTATS* SteamUserStats_StoreStats; 42 | 43 | extern void scanGameFunctions(); 44 | } -------------------------------------------------------------------------------- /user/keybinds.cpp: -------------------------------------------------------------------------------- 1 | #include "keybinds.h" 2 | #include 3 | #include 4 | 5 | static const std::map KeyMap = { 6 | {0x02, "MOUSE 2"}, 7 | {0x04, "MOUSE 3"}, 8 | {0x05, "MOUSE 4"}, 9 | {0x06, "MOUSE 5"}, 10 | {0x08, "BACKSPACE"}, 11 | {0x09, "TAB"}, 12 | {0x0C, "CLEAR"}, 13 | {0x0D, "RETURN"}, 14 | {0x10, "SHIFT"}, 15 | {0x11, "CTRL"}, 16 | {0x12, "ALT"}, 17 | {0x13, "PAUSE"}, 18 | {0x14, "CAPS LOCK"}, 19 | {0x1B, "ESC"}, 20 | {0x20, "SPACE"}, 21 | {0x21, "PG UP"}, 22 | {0x22, "PG DN"}, 23 | {0x23, "END"}, 24 | {0x24, "HOME"}, 25 | {0x2D, "INS"}, 26 | {0x2E, "DEL"}, 27 | {0x2C, "PRNTSCR"}, 28 | {0x30, "0"}, 29 | {0x31, "1"}, 30 | {0x32, "2"}, 31 | {0x33, "3"}, 32 | {0x34, "4"}, 33 | {0x35, "5"}, 34 | {0x36, "6"}, 35 | {0x37, "7"}, 36 | {0x38, "8"}, 37 | {0x39, "9"}, 38 | {0x41, "A"}, 39 | {0x42, "B"}, 40 | {0x43, "C"}, 41 | {0x44, "D"}, 42 | {0x45, "E"}, 43 | {0x46, "F"}, 44 | {0x47, "G"}, 45 | {0x48, "H"}, 46 | {0x49, "I"}, 47 | {0x4A, "J"}, 48 | {0x4B, "K"}, 49 | {0x4C, "L"}, 50 | {0x4D, "M"}, 51 | {0x4E, "N"}, 52 | {0x4F, "O"}, 53 | {0x50, "P"}, 54 | {0x51, "Q"}, 55 | {0x52, "R"}, 56 | {0x53, "S"}, 57 | {0x54, "T"}, 58 | {0x55, "U"}, 59 | {0x56, "V"}, 60 | {0x57, "W"}, 61 | {0x58, "X"}, 62 | {0x59, "Y"}, 63 | {0x5A, "Z"}, 64 | {0x5B, "WINDOWS"}, 65 | {0x5C, "WINDOWS"}, 66 | {0x60, "NUM 0"}, 67 | {0x61, "NUM 1"}, 68 | {0x62, "NUM 2"}, 69 | {0x63, "NUM 3"}, 70 | {0x64, "NUM 4"}, 71 | {0x65, "NUM 5"}, 72 | {0x66, "NUM 6"}, 73 | {0x67, "NUM 7"}, 74 | {0x68, "NUM 8"}, 75 | {0x69, "NUM 9"}, 76 | {0x6A, "MULTIPLY"}, 77 | {0x6B, "ADD"}, 78 | {0x6C, "SEPARATOR"}, 79 | {0x6D, "SUBTRACT"}, 80 | {0x6E, "DECIMAL"}, 81 | {0x6F, "DIVIDE"}, 82 | {0x70, "F1"}, 83 | {0x71, "F2"}, 84 | {0x72, "F3"}, 85 | {0x73, "F4"}, 86 | {0x74, "F5"}, 87 | {0x75, "F6"}, 88 | {0x76, "F7"}, 89 | {0x77, "F8"}, 90 | {0x78, "F9"}, 91 | {0x79, "F10"}, 92 | {0x7A, "F11"}, 93 | {0x7B, "F12"}, 94 | {0xA0, "L SHIFT"}, 95 | {0xA1, "R SHIFT"}, 96 | {0xA2, "L CTRL"}, 97 | {0xA3, "R CTRL"}, 98 | }; 99 | 100 | static std::bitset<256> PrevKeyState; 101 | static std::bitset<256> KeyState; 102 | 103 | void KeyBinds::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam) 104 | { 105 | PrevKeyState = KeyState; 106 | switch (uMsg) { 107 | case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: 108 | case WM_RBUTTONDOWN: case WM_RBUTTONDBLCLK: 109 | case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK: 110 | case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK: 111 | { 112 | uint8_t mouseButton = 0; 113 | 114 | if (uMsg == WM_LBUTTONDOWN || uMsg == WM_LBUTTONDBLCLK) { mouseButton = 0x01; } 115 | if (uMsg == WM_RBUTTONDOWN || uMsg == WM_RBUTTONDBLCLK) { mouseButton = 0x02; } 116 | if (uMsg == WM_MBUTTONDOWN || uMsg == WM_MBUTTONDBLCLK) { mouseButton = 0x04; } 117 | if (uMsg == WM_XBUTTONDOWN || uMsg == WM_XBUTTONDBLCLK) { mouseButton = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 0x05 : 0x06; } 118 | KeyState[mouseButton] = true; 119 | return; 120 | } 121 | case WM_LBUTTONUP: 122 | case WM_RBUTTONUP: 123 | case WM_MBUTTONUP: 124 | case WM_XBUTTONUP: 125 | { 126 | uint8_t mouseButton = 0; 127 | 128 | if (uMsg == WM_LBUTTONUP) { mouseButton = 0x01; } 129 | if (uMsg == WM_RBUTTONUP) { mouseButton = 0x02; } 130 | if (uMsg == WM_MBUTTONUP) { mouseButton = 0x04; } 131 | if (uMsg == WM_XBUTTONUP) { mouseButton = (GET_XBUTTON_WPARAM(wParam) == XBUTTON1) ? 0x05 : 0x06; } 132 | KeyState[mouseButton] = false; 133 | return; 134 | } 135 | case WM_KEYDOWN: 136 | case WM_SYSKEYDOWN: 137 | { 138 | if (wParam < 256) 139 | KeyState[wParam] = true; 140 | return; 141 | } 142 | case WM_KEYUP: 143 | case WM_SYSKEYUP: 144 | { 145 | if (wParam < 256) 146 | KeyState[wParam] = false; 147 | return; 148 | } 149 | case WM_KILLFOCUS: 150 | KeyState.reset(); 151 | break; 152 | } 153 | } 154 | 155 | const char* KeyBinds::ToString(uint8_t key) 156 | { 157 | auto iter = KeyMap.find(key); 158 | if (iter != KeyMap.end()) 159 | return iter->second; 160 | 161 | return "NONE"; 162 | } 163 | 164 | std::vector KeyBinds::GetValidKeys() 165 | { 166 | std::vector validKeys = std::vector(); 167 | 168 | for (auto const& [key, value] : KeyMap) 169 | validKeys.push_back(key); 170 | 171 | return validKeys; 172 | } 173 | 174 | bool KeyBinds::IsKeyDown(uint8_t key) 175 | { 176 | return KeyState[key]; 177 | } 178 | 179 | bool KeyBinds::IsKeyPressed(uint8_t key) 180 | { 181 | return (!PrevKeyState[key] && KeyState[key]); 182 | } 183 | 184 | bool KeyBinds::IsKeyReleased(uint8_t key) 185 | { 186 | return (PrevKeyState[key] && !KeyState[key]); 187 | } 188 | 189 | void KeyBinds::to_json(nlohmann::ordered_json& j, KeyBinds::Config value) 190 | { 191 | j = nlohmann::ordered_json{ 192 | {"Toggle_Menu", value.Toggle_Menu}, 193 | {"Toggle_Radar", value.Toggle_Radar}, 194 | {"Toggle_Console", value.Toggle_Console}, 195 | {"Repair_Sabotage", value.Repair_Sabotage}, 196 | {"Toggle_Noclip", value.Toggle_Noclip}, 197 | {"Toggle_Autokill", value.Toggle_Autokill}, 198 | {"Close_All_Doors", value.Close_All_Doors}, 199 | {"Toggle_Zoom", value.Toggle_Zoom}, 200 | {"Toggle_Freecam", value.Toggle_Freecam}, 201 | {"Close_Current_Room_Door", value.Close_Current_Room_Door}, 202 | {"Toggle_Replay", value.Toggle_Replay}, 203 | {"Toggle_ChatAlwaysActive", value.Toggle_ChatAlwaysActive}, 204 | {"Toggle_ReadGhostMessages", value.Toggle_ReadGhostMessages}, 205 | {"Toggle_Hud", value.Toggle_Hud}, 206 | {"Reset_Appearance", value.Reset_Appearance}, 207 | {"Randomize_Appearance", value.Randomize_Appearance}, 208 | {"Complete_Tasks", value.Complete_Tasks}, 209 | {"Toggle_Sicko", value.Toggle_Sicko}, 210 | }; 211 | } 212 | 213 | void KeyBinds::from_json(const nlohmann::ordered_json& j, KeyBinds::Config& value) 214 | { 215 | j.at("Toggle_Menu").get_to(value.Toggle_Menu); 216 | j.at("Toggle_Radar").get_to(value.Toggle_Radar); 217 | j.at("Toggle_Console").get_to(value.Toggle_Console); 218 | j.at("Repair_Sabotage").get_to(value.Repair_Sabotage); 219 | j.at("Toggle_Noclip").get_to(value.Toggle_Noclip); 220 | j.at("Toggle_Autokill").get_to(value.Toggle_Autokill); 221 | j.at("Close_All_Doors").get_to(value.Close_All_Doors); 222 | j.at("Toggle_Zoom").get_to(value.Toggle_Zoom); 223 | j.at("Toggle_Freecam").get_to(value.Toggle_Freecam); 224 | j.at("Close_Current_Room_Door").get_to(value.Close_Current_Room_Door); 225 | j.at("Toggle_Replay").get_to(value.Toggle_Replay); 226 | j.at("Toggle_ChatAlwaysActive").get_to(value.Toggle_ChatAlwaysActive); 227 | j.at("Toggle_ReadGhostMessages").get_to(value.Toggle_ReadGhostMessages); 228 | j.at("Toggle_Hud").get_to(value.Toggle_Hud); 229 | j.at("Reset_Appearance").get_to(value.Reset_Appearance); 230 | j.at("Randomize_Appearance").get_to(value.Randomize_Appearance); 231 | j.at("Complete_Tasks").get_to(value.Complete_Tasks); 232 | j.at("Toggle_Sicko").get_to(value.Toggle_Sicko); 233 | } 234 | -------------------------------------------------------------------------------- /user/keybinds.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define WIN32_LEAN_AND_MEAN 3 | #include 4 | #include 5 | #include "json.hpp" 6 | 7 | namespace KeyBinds { 8 | struct Config { 9 | uint8_t Toggle_Menu; 10 | uint8_t Toggle_Radar; 11 | uint8_t Toggle_Console; 12 | uint8_t Repair_Sabotage; 13 | uint8_t Toggle_Noclip; 14 | uint8_t Toggle_Autokill; 15 | uint8_t Close_All_Doors; 16 | uint8_t Toggle_Zoom; 17 | uint8_t Toggle_Freecam; 18 | uint8_t Close_Current_Room_Door; 19 | uint8_t Toggle_Replay; 20 | uint8_t Toggle_ChatAlwaysActive; 21 | uint8_t Toggle_ReadGhostMessages; 22 | uint8_t Toggle_Hud; 23 | uint8_t Reset_Appearance; 24 | uint8_t Randomize_Appearance; 25 | uint8_t Complete_Tasks; 26 | uint8_t Toggle_Sicko; 27 | }; 28 | 29 | void WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam); 30 | const char* ToString(uint8_t key); 31 | std::vector GetValidKeys(); 32 | bool IsKeyDown(uint8_t key); 33 | bool IsKeyPressed(uint8_t key); 34 | bool IsKeyReleased(uint8_t key); 35 | 36 | void to_json(nlohmann::ordered_json& j, KeyBinds::Config value); 37 | void from_json(const nlohmann::ordered_json& j, KeyBinds::Config& value); 38 | } 39 | -------------------------------------------------------------------------------- /user/logger.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "logger.h" 3 | #include 4 | #include 5 | #include "utility.h" 6 | 7 | SickoLogger Log; 8 | 9 | void SickoLogger::Create() 10 | { 11 | const auto path = getModulePath(NULL); 12 | const auto logPath = path.parent_path() / "sicko-log.txt"; 13 | const auto prevLogPath = path.parent_path() / "sicko-prev-log.txt"; 14 | 15 | std::error_code errCode; 16 | std::filesystem::remove(prevLogPath, errCode); 17 | std::filesystem::rename(logPath, prevLogPath, errCode); 18 | std::filesystem::remove(logPath, errCode); 19 | 20 | this->filePath = logPath; 21 | } 22 | 23 | void SickoLogger::Write(std::string_view verbosity, std::string_view source, std::string_view message) 24 | { 25 | std::stringstream ss; 26 | // FIXME: std::chrono::current_zone requires Windows 10 version 1903/19H1 or later. 27 | // ss << std::format("[{:%EX}]", std::chrono::zoned_time(std::chrono::current_zone(), std::chrono::system_clock::now())); 28 | /*auto now = std::chrono::system_clock::now(); 29 | std::time_t t = std::chrono::system_clock::to_time_t(now); 30 | std::tm tm = {}; 31 | localtime_s(&tm, &t); // Safe version of localtime 32 | ss << std::put_time(&tm, "[%H:%M:%S]"); // Replace UTC time with local time*/ // Causes lag on lower-end devices 33 | ss << std::format("[{:%EX}]", std::chrono::system_clock::now()); 34 | ss << "[" << verbosity << " - " << source << "] " << message << std::endl; 35 | std::cout << ss.str(); 36 | 37 | std::ofstream file(this->filePath, std::ios_base::app); 38 | file << ss.str(); 39 | file.close(); 40 | } 41 | 42 | void SickoLogger::Debug(std::string_view source, std::string_view message) 43 | { 44 | Write("DEBUG", source, message); 45 | } 46 | 47 | void SickoLogger::Error(std::string_view source, std::string_view message) 48 | { 49 | Write("ERROR", source, message); 50 | } 51 | 52 | void SickoLogger::Info(std::string_view source, std::string_view message) 53 | { 54 | Write("INFO", source, message); 55 | } 56 | 57 | void SickoLogger::Debug(std::string_view message) 58 | { 59 | Debug("SICKO", message); 60 | } 61 | 62 | void SickoLogger::Error(std::string_view message) 63 | { 64 | Error("SICKO", message); 65 | } 66 | 67 | void SickoLogger::Info(std::string_view message) 68 | { 69 | Info("SICKO", message); 70 | } -------------------------------------------------------------------------------- /user/logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class SickoLogger { 9 | public: 10 | void Create(); 11 | void Write(std::string_view verbosity, std::string_view source, std::string_view message); 12 | 13 | void Debug(std::string_view source, std::string_view message); 14 | void Error(std::string_view source, std::string_view message); 15 | void Info(std::string_view source, std::string_view message); 16 | void Debug(std::string_view message); 17 | void Error(std::string_view message); 18 | void Info(std::string_view message); 19 | private: 20 | std::filesystem::path filePath; 21 | std::string currentVerbosity; 22 | }; 23 | #define _log_source (std::string() + "SICKO - " + __func__) 24 | 25 | #define LOG_INFO(x) Log.Info(_log_source, x) 26 | #define LOG_DEBUG(x) Log.Debug(_log_source, x) 27 | #define LOG_ERROR(x) Log.Error(_log_source, x) 28 | 29 | #define STREAM_DEBUG(x) \ 30 | do { \ 31 | std::ostringstream ss; \ 32 | ss << x; \ 33 | LOG_DEBUG(ss.str()); \ 34 | } while (0) 35 | 36 | #define STREAM_ERROR(x) \ 37 | do { \ 38 | std::ostringstream ss; \ 39 | ss << x; \ 40 | LOG_ERROR(ss.str()); \ 41 | } while (0) 42 | 43 | #define LOG_ASSERT(EXPR) \ 44 | if (!(EXPR)) { \ 45 | STREAM_ERROR("(" << #EXPR << ") Assert failed."); \ 46 | assert(EXPR); \ 47 | exit(1); \ 48 | } 49 | 50 | extern SickoLogger Log; -------------------------------------------------------------------------------- /user/main.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "main.h" 3 | #include "il2cpp-init.h" 4 | #include 5 | #include "crc32.h" 6 | #include 7 | #include 8 | #include "game.h" 9 | #include "_hooks.h" 10 | #include "logger.h" 11 | #include "state.hpp" 12 | #include "version.h" 13 | #include 14 | #include 15 | //#include "gitparams.h" 16 | 17 | // test autoRelease main ver increment 18 | 19 | HMODULE hModule; 20 | HANDLE hUnloadEvent; 21 | 22 | std::string GetCRC32(std::filesystem::path filePath) { 23 | CRC32 crc32; 24 | char buffer[4096] = { 0 }; 25 | 26 | std::ifstream fin(filePath, std::ifstream::binary); 27 | 28 | while (!fin.eof()) { 29 | fin.read(&buffer[0], 4096); 30 | auto readSize = fin.gcount(); 31 | crc32.add(&buffer[0], (size_t)readSize); 32 | } 33 | //LOG_DEBUG("CRC32 of \"" + filePath.string() + "\" is " + crc32.getHash()); 34 | return crc32.getHash(); 35 | } 36 | 37 | bool GameVersionCheck() { 38 | auto modulePath = getModulePath(NULL); 39 | auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; 40 | auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; 41 | 42 | /*if (!IsWindows10OrGreater()) { 43 | Log.Error("Version of windows not supported exiting!"); 44 | MessageBox(NULL, L"This version of Windows is not supported!", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); 45 | return false; 46 | }*/ 47 | 48 | if (!std::filesystem::exists(gameAssembly)) { 49 | Log.Error("GameAssembly.dll was not found"); 50 | MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); 51 | return false; 52 | } 53 | 54 | std::string gameAssemblyCRC = GetCRC32(gameAssembly); //We won't use this, but it will log it 55 | 56 | return true; 57 | } 58 | 59 | #define ToString(s) stringify(s) 60 | #define stringify(s) #s 61 | 62 | #define GAME_STATIC_POINTER(f,c,m) \ 63 | do \ 64 | { \ 65 | assert(cctor_finished(c##__TypeInfo->_0.klass)); \ 66 | f = &(c##__TypeInfo->static_fields->m); \ 67 | std::ostringstream ss; \ 68 | ss << std::internal << std::setfill('0') << std::hex << std::setw(8) \ 69 | << stringify(f) << " is 0x" << f << " -> 0x" << *f; \ 70 | LOG_DEBUG(ss.str()); \ 71 | } while (0); 72 | 73 | void Run(LPVOID lpParam) { 74 | #if _DEBUG 75 | new_console(); 76 | #endif 77 | Log.Create(); 78 | if (!GameVersionCheck()) { 79 | fclose(stdout); 80 | FreeConsole(); 81 | FreeLibraryAndExitThread((HMODULE)lpParam, 0); 82 | return; 83 | } 84 | hModule = (HMODULE)lpParam; 85 | State.lol = getModulePath(hModule).filename().string(); 86 | init_il2cpp(); 87 | State.Load(); 88 | ScopedThreadAttacher managedThreadAttached; 89 | { 90 | std::ostringstream ss; 91 | ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; // Log SickoMenu info 92 | /*ss << "\tBuild: " << _CONFIGURATION_NAME << std::endl; 93 | ss << "\tCommit: " << GetGitCommit() << " - " << GetGitBranch() << std::endl; // Log git info*/ 94 | ss << "\tVersion: " << State.SickoVersion << std::endl; 95 | ss << "\tAmong Us Version: " << getGameVersion() << std::endl; // Log among us info 96 | LOG_INFO(ss.str()); 97 | #if _DEBUG 98 | SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); 99 | #endif 100 | } 101 | #if _DEBUG 102 | hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); 103 | 104 | #define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") 105 | #include "il2cpp-classes.h" 106 | #undef DO_APP_CLASS 107 | 108 | #define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) 109 | #include "il2cpp-functions.h" 110 | #undef DO_APP_FUNC 111 | auto domain = il2cpp_domain_get(); 112 | auto assembly = il2cpp_domain_assembly_open(domain, "Assembly-CSharp"); 113 | auto klass = il2cpp_class_from_name(assembly->image, "", "MovingPlatformBehaviour"); 114 | output_class_methods(klass); 115 | #endif 116 | GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); 117 | GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); 118 | GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); 119 | GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); 120 | GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); 121 | GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); 122 | LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); 123 | State.userName = GetPlayerName(); 124 | 125 | Game::scanGameFunctions(); 126 | DetourInitilization(); 127 | #if _DEBUG 128 | managedThreadAttached.detach(); 129 | DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); 130 | if (dwWaitResult != WAIT_OBJECT_0) { 131 | STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); 132 | return; 133 | } 134 | 135 | DetourUninitialization(); 136 | fclose(stdout); 137 | FreeConsole(); 138 | CloseHandle(hUnloadEvent); 139 | FreeLibraryAndExitThread(hModule, 0); 140 | #endif 141 | } 142 | -------------------------------------------------------------------------------- /user/main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern HMODULE hModule; 4 | extern HANDLE hUnloadEvent; 5 | 6 | void Run(LPVOID lpParam); -------------------------------------------------------------------------------- /user/profiler.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "profiler.h" 3 | #include "logger.h" 4 | 5 | std::map Profiler::StatMap; 6 | LARGE_INTEGER Profiler::QPCFrequency; 7 | bool Profiler::HasInitialized = false; 8 | 9 | void Profiler::InitProfiling() 10 | { 11 | #if _DEBUG 12 | QueryPerformanceFrequency(&QPCFrequency); 13 | StatMap = std::map(); 14 | HasInitialized = true; 15 | LOG_DEBUG("Initialized profiler"); 16 | #endif 17 | } 18 | 19 | void Profiler::BeginSample(const char* Stat_Name) 20 | { 21 | #if _DEBUG 22 | std::map::iterator it = StatMap.find(Stat_Name); 23 | StatObject* stat = nullptr; 24 | if (it == StatMap.end()) 25 | { 26 | STREAM_DEBUG("Creating new stat object for '" << Stat_Name << "'"); 27 | std::pair::iterator, bool> result = StatMap.insert(std::map::value_type(Stat_Name, StatObject())); 28 | if (result.second) 29 | stat = &result.first->second; 30 | } 31 | else 32 | { 33 | stat = &it->second; 34 | } 35 | if (stat != nullptr) 36 | QueryPerformanceCounter(&stat->QPCStart); 37 | #endif 38 | } 39 | 40 | void Profiler::EndSample(const char* Stat_Name) 41 | { 42 | #if _DEBUG 43 | std::map::iterator it = StatMap.find(Stat_Name); 44 | if (it != StatMap.end()) 45 | { 46 | StatObject* stat = &it->second; 47 | 48 | QueryPerformanceCounter(&stat->QPCEnd); 49 | 50 | stat->TotalSamples++; 51 | stat->ElapsedMicroseconds = (((stat->QPCEnd.QuadPart - stat->QPCStart.QuadPart) * 1000000ll) / Profiler::QPCFrequency.QuadPart); 52 | stat->CumulativeTotal += stat->ElapsedMicroseconds; 53 | stat->AverageSample_Microseconds = stat->CumulativeTotal / stat->TotalSamples; 54 | if (stat->ElapsedMicroseconds > stat->LongestSample_Microseconds) stat->LongestSample_Microseconds = stat->ElapsedMicroseconds; 55 | //printf("Ended sample for stat '%s', took %llu ticks\n", Stat_Name, &stat->QPCEnd.QuadPart); 56 | } 57 | else 58 | { 59 | STREAM_DEBUG("Could not find stat '" << Stat_Name << "'"); 60 | } 61 | #endif 62 | } 63 | 64 | void Profiler::GetStat(const char* Stat_Name, __int64& AverageSample_Microseconds, __int64& LongestSample_Microseconds, __int64& TotalSamples) 65 | { 66 | #if _DEBUG 67 | // NOTE: 68 | // if it doesn't exist, the [] operator should create it and return the newly created instance 69 | // so this shouldn't give any errors 70 | StatObject* stat = &StatMap[Stat_Name]; 71 | AverageSample_Microseconds = stat->AverageSample_Microseconds; 72 | LongestSample_Microseconds = stat->LongestSample_Microseconds; 73 | TotalSamples = stat->TotalSamples; 74 | #endif 75 | } 76 | 77 | const char* Profiler::GetFormattedStatString(const char* Stat_Name) 78 | { 79 | #if _DEBUG 80 | StatObject* stat = &StatMap[Stat_Name]; 81 | std::stringstream profilingSS; 82 | profilingSS << stat->AverageSample_Microseconds << " us (" << (stat->AverageSample_Microseconds / 1000ll) << " ms)" 83 | << "[longest: " << stat->LongestSample_Microseconds << " us][" << stat->TotalSamples << "]"; 84 | 85 | return profilingSS.str().c_str(); 86 | #else 87 | return "ERROR"; 88 | #endif 89 | } 90 | 91 | const wchar_t* Profiler::GetFormattedStatStringWide(const char* Stat_Name) 92 | { 93 | #if _DEBUG 94 | StatObject* stat = &StatMap[Stat_Name]; 95 | std::wstringstream profilingWSS; 96 | profilingWSS << stat->AverageSample_Microseconds << L" us (" << (stat->AverageSample_Microseconds / 1000ll) << L" ms)" 97 | << L"[longest: " << stat->LongestSample_Microseconds << L" us][" << stat->TotalSamples << L"]"; 98 | 99 | return profilingWSS.str().c_str(); 100 | #else 101 | return L"ERROR"; 102 | #endif 103 | } 104 | 105 | void Profiler::AppendStatStringStream(const char* Stat_Name, std::stringstream& ss) 106 | { 107 | #if _DEBUG 108 | StatObject* stat = &StatMap[Stat_Name]; 109 | ss << Stat_Name << ": " << stat->AverageSample_Microseconds << " us (" << (stat->AverageSample_Microseconds / 1000ll) << " ms)" 110 | << "[longest: " << stat->LongestSample_Microseconds << " us][" << stat->TotalSamples << "]\n"; 111 | #endif 112 | } 113 | 114 | void Profiler::AppendStatStringStreamWide(const char* Stat_Name, std::wstringstream& wss) 115 | { 116 | #if _DEBUG 117 | StatObject* stat = &StatMap[Stat_Name]; 118 | wss << Stat_Name << L": " << stat->AverageSample_Microseconds << L" us (" << (stat->AverageSample_Microseconds / 1000ll) << L" ms)" 119 | << L"[longest: " << stat->LongestSample_Microseconds << L" us][" << stat->TotalSamples << L"]\n"; 120 | #endif 121 | } 122 | 123 | void Profiler::WriteStatsToStream(std::stringstream& ss) 124 | { 125 | #if _DEBUG 126 | //printf("Writing stats to stream\n"); 127 | std::map::iterator it; 128 | for (it = StatMap.begin(); it != StatMap.end(); ++it) 129 | { 130 | StatObject* stat = &it->second; 131 | ss << it->first.c_str() << ": " << stat->AverageSample_Microseconds << " us (" << (stat->AverageSample_Microseconds / 1000ll) << " ms)" 132 | << "[longest: " << stat->LongestSample_Microseconds << " us][" << stat->TotalSamples << "]\n"; 133 | //printf("----Appended stat '%s' (%lld - %lld - %lld - %lld)\n", it->first, stat->AverageSample_Microseconds, (stat->AverageSample_Microseconds / 1000ll), stat->LongestSample_Microseconds, stat->TotalSamples); 134 | } 135 | //printf("Done writing stats to stream\n"); 136 | #endif 137 | } 138 | 139 | void Profiler::WriteStatsToStreamWide(std::wstringstream& wss) 140 | { 141 | #if _DEBUG 142 | //printf("Writing stats to stream\n"); 143 | std::map::iterator it; 144 | for (it = StatMap.begin(); it != StatMap.end(); ++it) 145 | { 146 | StatObject* stat = &it->second; 147 | wss << it->first.c_str() << L": " << stat->AverageSample_Microseconds << L" us (" << (stat->AverageSample_Microseconds / 1000ll) << L" ms)" 148 | << L"[longest: " << stat->LongestSample_Microseconds << L" us][" << stat->TotalSamples << L"]\n"; 149 | //printf("----Appended stat '%s' (%lld - %lld - %lld - %lld)\n", it->first, stat->AverageSample_Microseconds, (stat->AverageSample_Microseconds / 1000ll), stat->LongestSample_Microseconds, stat->TotalSamples); 150 | } 151 | //printf("Done writing stats to stream\n"); 152 | #endif 153 | } 154 | 155 | void Profiler::ClearStat(const char* Stat_Name) 156 | { 157 | #if _DEBUG 158 | auto it = StatMap.find(Stat_Name); 159 | if (it != StatMap.end()) 160 | { 161 | StatObject* stat = &it->second; 162 | stat->TotalSamples = 0; 163 | stat->CumulativeTotal = 0; 164 | stat->AverageSample_Microseconds = 0; 165 | stat->LongestSample_Microseconds = 0; 166 | stat->QPCStart.QuadPart = 0; 167 | stat->QPCEnd.QuadPart = 0; 168 | stat->ElapsedMicroseconds = 0; 169 | } 170 | #endif 171 | } 172 | 173 | void Profiler::ClearStats() 174 | { 175 | #if _DEBUG 176 | std::map::iterator it; 177 | for (it = StatMap.begin(); it != StatMap.end(); ++it) 178 | { 179 | StatObject* stat = &it->second; 180 | stat->TotalSamples = 0; 181 | stat->CumulativeTotal = 0; 182 | stat->AverageSample_Microseconds = 0; 183 | stat->LongestSample_Microseconds = 0; 184 | stat->QPCStart.QuadPart = 0; 185 | stat->QPCEnd.QuadPart = 0; 186 | stat->ElapsedMicroseconds = 0; 187 | } 188 | #endif 189 | } -------------------------------------------------------------------------------- /user/profiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class Profiler 8 | { 9 | public: 10 | static void InitProfiling(); 11 | static void BeginSample(const char* Stat_Name); 12 | static void EndSample(const char* Stat_Name); 13 | static void GetStat(const char* Stat_Name, __int64& AverageSample_Microseconds, __int64& LongestSample_Microseconds, __int64& TotalSamples); 14 | static const char* GetFormattedStatString(const char* Stat_Name); 15 | static const wchar_t* GetFormattedStatStringWide(const char* Stat_Name); 16 | static void AppendStatStringStream(const char* Stat_Name, std::stringstream& ss); 17 | static void AppendStatStringStreamWide(const char* Stat_Name, std::wstringstream& wss); 18 | static void WriteStatsToStream(std::stringstream& ss); 19 | static void WriteStatsToStreamWide(std::wstringstream& wss); 20 | static void ClearStat(const char* Stat_Name); 21 | static void ClearStats(); 22 | 23 | static bool HasInitialized; 24 | 25 | private: 26 | struct StatObject 27 | { 28 | __int64 AverageSample_Microseconds = 0; 29 | __int64 LongestSample_Microseconds = 0; 30 | __int64 TotalSamples = 0; 31 | // 32 | LARGE_INTEGER QPCStart, QPCEnd; 33 | __int64 CumulativeTotal = 0; 34 | __int64 ElapsedMicroseconds = 0; 35 | }; 36 | Profiler() {}; 37 | static LARGE_INTEGER QPCFrequency; 38 | static std::map StatMap; 39 | }; -------------------------------------------------------------------------------- /user/resources.cpp: -------------------------------------------------------------------------------- 1 | #include "pch-il2cpp.h" 2 | #include "resources.h" 3 | #include "main.h" 4 | #define STB_IMAGE_IMPLEMENTATION 5 | #include "stb_image.h" 6 | 7 | Resource::Resource(int32_t id) 8 | { 9 | hResInfo = FindResource(hModule, MAKEINTRESOURCE(id), L"PNG"); 10 | if (hResInfo) { 11 | hResData = LoadResource(hModule, hResInfo); 12 | if (hResData) { 13 | pointerToResource = LockResource(hResData); 14 | sizeOfResource = SizeofResource(hModule, hResInfo); 15 | } 16 | } 17 | } 18 | 19 | D3D11Image::D3D11Image(Resource resource, ID3D11Device* pDevice) 20 | { 21 | if (resource.pointerToResource) { 22 | auto image_data = stbi_load_from_memory((stbi_uc*)resource.pointerToResource, resource.sizeOfResource, &imageWidth, &imageHeight, NULL, 4); 23 | if (image_data == NULL) 24 | return; 25 | 26 | D3D11_TEXTURE2D_DESC desc; 27 | ZeroMemory(&desc, sizeof(desc)); 28 | desc.Width = imageWidth; 29 | desc.Height = imageHeight; 30 | desc.MipLevels = 1; 31 | desc.ArraySize = 1; 32 | desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; 33 | desc.SampleDesc.Count = 1; 34 | desc.Usage = D3D11_USAGE_DEFAULT; 35 | desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; 36 | desc.CPUAccessFlags = 0; 37 | 38 | ID3D11Texture2D* pTexture = NULL; 39 | D3D11_SUBRESOURCE_DATA subResource; 40 | subResource.pSysMem = image_data; 41 | subResource.SysMemPitch = desc.Width * 4; 42 | subResource.SysMemSlicePitch = 0; 43 | pDevice->CreateTexture2D(&desc, &subResource, &pTexture); 44 | 45 | D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc; 46 | ZeroMemory(&srvDesc, sizeof(srvDesc)); 47 | srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; 48 | srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; 49 | srvDesc.Texture2D.MipLevels = desc.MipLevels; 50 | srvDesc.Texture2D.MostDetailedMip = 0; 51 | pDevice->CreateShaderResourceView(pTexture, &srvDesc, &shaderResourceView); 52 | pTexture->Release(); 53 | 54 | stbi_image_free(image_data); 55 | } 56 | } -------------------------------------------------------------------------------- /user/resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct Resource { 5 | HRSRC hResInfo; 6 | HGLOBAL hResData; 7 | LPVOID pointerToResource; 8 | DWORD sizeOfResource; 9 | 10 | Resource(int32_t id); 11 | }; 12 | 13 | struct D3D11Image { 14 | ID3D11ShaderResourceView* shaderResourceView; 15 | int32_t imageWidth; 16 | int32_t imageHeight; 17 | 18 | D3D11Image(Resource resource, ID3D11Device* pDevice); 19 | }; --------------------------------------------------------------------------------