From b748217c91d0cc36a373ff07f284c2f24d47e4ac Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:09:23 +0100 Subject: [PATCH 1/9] removed lock --- user/main.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/user/main.cpp b/user/main.cpp index c799c94..3a4d725 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -59,23 +59,7 @@ bool GameVersionCheck() { #define ToString(s) stringify(s) #define stringify(s) #s -#define GAME_STATIC_POINTER(f,c,m) \ - do \ - { \ - if (!cctor_finished(c##__TypeInfo->_0.klass)) { \ - if (MessageBox(NULL, \ - L"SickoMenu does not support Among Us versions past v16.0.5 as of now!\n\nMake sure you downgrade your Among Us instance to v16.0.0 / v16.0.2 and use SickoMenu. If you're wondering about playing with players on the latest version, your game's version will automatically be spoofed so you can play with them!\n\nClick OK to exit the game. Your browser will then open a downgrading guide.", \ - L"SickoMenu", MB_ICONINFORMATION)) { \ - OpenLink("https://textbin.net/rruqqrlgaw"); \ - ExitProcess(0); \ - } \ - }; \ - f = &(c##__TypeInfo->static_fields->m); \ - std::ostringstream ss; \ - ss << std::internal << std::setfill('0') << std::hex << std::setw(8) \ - << stringify(f) << " is 0x" << f << " -> 0x" << *f; \ - LOG_DEBUG(ss.str()); \ - } while (0); + void Run(LPVOID lpParam) { #if _DEBUG From 62302f565b440b175397fb253abaf769189f6ea4 Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:13:49 +0100 Subject: [PATCH 2/9] Clean up README content and disclaimers Removed outdated project details and disclaimers from README. --- README.md | 227 +----------------------------------------------------- 1 file changed, 1 insertion(+), 226 deletions(-) diff --git a/README.md b/README.md index 10ef8fd..7e13b12 100644 --- a/README.md +++ b/README.md @@ -1,226 +1 @@ -

- -

- -

👺 SickoMenu v4.4

-A powerful utility for Among Us designed to enrich your game experience with custom features! - -**Intended for educational and experimental use only.** - -Join our very own Discord server for support, bug reports, and sneak peeks! -### Vanity Invite: https://discord.gg/sickos -### Permanent invite: https://dsc.gg/sickos ---- - -## ⚠️ Disclaimer -This project is maintained by **g0aty**, with contributions from other developers. -It is intended **solely for educational and non-commercial research purposes**, such as exploring game mechanics and studying anti-cheat systems. - -This project is **not affiliated with, endorsed, or supported by Innersloth LLC** in any capacity. - -By downloading, installing, or using this software, you acknowledge and agree that: - -- You are solely responsible for how you use it. -- You will not use it to violate Innersloth’s [Terms of Service](https://www.innersloth.com/terms-of-use-for-the-games/) or disrupt public gameplay. -- The developers, including **g0aty** and all contributors, **assume no responsibility or liability** for: - - Any direct or indirect consequences of misuse, - - Violations of third-party rules or terms, - - Game bans, data loss, or damage caused by use of this utility. - ---- - -**Legal Notice:** -Portions of the game referenced or interacted with may be intellectual property of Innersloth LLC. © Innersloth LLC. -This project is designed to comply with their [Modding Policy](https://www.innersloth.com/among-us-mod-policy/) for private and non-malicious experimentation. - -> ⚠️ Use responsibly. This software is provided "as is", **without any warranties** or guarantees of safety, support, or fitness for purpose. - ---- - -## 🛑 Ethical Use Protocol -**By using SickoMenu, you agree to:** -1. **Use exclusively in private lobbies** with consenting players. -2. **Never exploit features in public matches** or to harass others. -3. **Respect Innersloth's Terms of Service** and the integrity of the game. -4. **Immediately disable the mod** (`PAUSE BREAK` hotkey) if joining public lobbies accidentally. - -> 🚫 Misuse may result in punitive actions on your Among Us account, including permanent bans. **We do not condone cheating.** -> Report unethical usage in our [Discord](https://discord.gg/sickos). - ---- - -## ⚙️ Features -A huge amount of features!! -- NoClip (`CTRL`) -- Ghost Visibility -- Confuser (May disrupt gameplay) - -**Cosmetic/UI Enhancements:** -- Zoom Out -- SickoMenu Chat (`/sc [message]`) - -**Full Feature List:** [FEATURES.md](https://github.com/g0aty/SickoMenu/blob/main/FEATURES.md) - -> 🔸 Features marked with **"!"** may impact game balance. Always obtain lobby consent - ---- - -## 📸 Screenshot -

- -

- -## 👌 Supported Versions -- ✅ Steam (Supported) -- ✅ Epic Games (Supported) -- ✅ itch.io (Supported) -- ❓ Cracked (works occasionally, I don't condone it) -- ❌ Microsoft Store (Not Supported) -- ❌ iOS/iPadOS/Android (Not Supported) -- ❌ Switch/Xbox/Playstation (Not Supported) - -## ⬇️ Download & Install -### For Windows -You can find the latest release [here](https://github.com/g0aty/SickoMenu/releases/latest). -Either inject `SickoMenu.dll` with a reliable injector or put `version.dll` in your Among Us directory (the folder containing `Among Us.exe`). - -### For Proton (Version Proxy Only) -First you will need [protontricks](https://github.com/Matoking/protontricks), you can install it with your packager of choice. - -1. Make sure you are running Among Us under Proton. - On Steam you can check this by going to **Properties -> Compatibility** -2. Put version.dll into your Among Us directory (the folder containing `Among Us.exe`). -3. Run `protontricks --gui` -4. Choose **Among Us** -5. Click on **Select the default wineprefix** and then **OK** -6. Click on **Run winecfg** and then **OK** -7. In the configuration window, click on **Libraries** -8. Enter `version` into the **New override for library** input field -9. Click **Add** and then **Apply** -10. SickoMenu should now work properly in the game - -### For macOS (Version Proxy Only) - -> [!NOTE] -> This method uses CrossOver. If you have ANY other ways to use this with other software, refer to the contributing section! -> -**Method 1:** - -1. Install a bottle of CrossOver, install Steam in it and install Among Us. -2. Open the C drive inside of CrossOver (there should be a button). Quit CrossOver. A Finder window will open. -3. Go to `Program Files (x86)/Steam/steamapps/common/Among Us/` and put the `version.dll` into it. Then reopen CrossOver. -4. Go to the **Configure Wine** panel, go to **Libraries**, open the menu below **New Replacement for:** and search for `version`. -5. Select it and click **Add**, then **Apply** and **OK**. -6. Start Among Us and press **Command+⌦** to show SickoMenu. - -**Method 2:** - -1. Download from [PlayOnMac](https://www.playonmac.com) and install it. -2. Open PlayOnMac and click **Install**. - - Search for "Among Us" (even if not listed) and select **Install a non-listed program**. - - Name the virtual drive (e.g., "Among Us Modded") and ensure it’s set to **32-bit architecture**. -3. Download the Steam installer from [store.steampowered.com](https://store.steampowered.com/about/). - - In PlayOnMac’s installation wizard, select **Install components directly** > **Steam**. - - Follow prompts to install Steam in the virtual drive. -4. Launch Steam from PlayOnMac, log in, and install Among Us. -5. Add SickoMenu’s `version.dll` - - Right-click your virtual drive in PlayOnMac > **Open virtual drive’s directory**. - - Navigate to: - `drive_c/Program Files (x86)/Steam/steamapps/common/Among Us` - - Place the `version.dll` file here. -6. In PlayOnMac, select your virtual drive > **Configure** > **Wine** > **Libraries**. - - Add `version` to the overrides and set it to **Native (Windows)**. -7.Run Among Us through Steam in PlayOnMac. Use the hotkey **Command + Delete** to toggle the mod menu. - -**Method 3: (recommended)** - -1. Open **Terminal** and install Wine via Homebrew. - ```bash - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew install --cask wine-stable - ``` -2. In Terminal, create a dedicated Wine prefix for Among Us: - ```bash - mkdir -p ~/AmongUsWine - WINEPREFIX=~/AmongUsWine winecfg - ``` - - In the Wine Configuration window, set **Windows Version** to **Windows 10** and close. -3. Download the **Steam Installer** from [store.steampowered.com](https://store.steampowered.com/about/). -4. Install Steam into your Wine prefix: - ```bash - WINEPREFIX=~/AmongUsWine wine ~/Downloads/SteamSetup.exe - ``` -5. Follow the installer prompts. Launch Steam from Terminal afterward: - ```bash - WINEPREFIX=~/AmongUsWine wine ~/AmongUsWine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe - ``` -6. Log in to Steam and install **Among Us**. -7. Locate the Among Us folder: - - Open **Finder** > Go to **Go > Go to Folder** and paste: - `~/AmongUsWine/drive_c/Program Files (x86)/Steam/steamapps/common/Among Us` - - Drag the `version.dll` file into this fold. -8. In Terminal, run: - ```bash - WINEPREFIX=~/AmongUsWine winecfg - ``` - - Go to the **Libraries** tab. - - Under **New override for library**, type `version`, click **Add**, then set it to **Native (Windows)**. - - Click **Apply** > **OK**. -9. Launch Steam from Terminal (as in Step 3.3). -- Start Among Us from your Steam library. -- Use **Command + Delete** to toggle SickoMenu in-game. - ---- -### **Note:** -**For Method 2:** -- macOS Catalina+ Users: macOS versions ≥10.15 lack 32-bit support, which may cause issues. Use **Wine-Staging** (via Homebrew) for better compatibility: - ```bash - brew install --cask wine-stable - ``` - **For Method 3:** -- The bash in the first step will install Homebrew, if you don't have it on your os. I recommend this method for users comfortable with basic terminal commands. - ---- -## ⌨️ Default Hotkeys -- Show Menu - DELETE -- Show Radar - INSERT -- Show Console - HOME -- Show Replay - END -- Repair Sabotage - PAGE DOWN (PgDn) -- NoClip - CTRL -- Panic / Disable SickoMenu - PAUSE BREAK (Break) - -## ⚒️ Compile (Configurations) -You can compile two different versions of the menu. Normal or Version Proxy. Steps to compile can be found [here](https://docs.google.com/document/d/1bdXyasr7suassff_or3ywPyItGkjhlTfbBJtvaJ6udQ/edit?usp=sharing). - -### Normal (SickoMenu.dll) -Inject it with any injector you have. - -- Debug (With Debug Information and can be attached to process) -- Release (Optimized with all information stripped) - -### Version Proxy (version.dll) -Will automatically be loaded by the Game itself if the dll is in the game directory. - -- Debug_Version (With Debug Information and can be attached to process) -- Release_Version (Optimized with all information stripped) - -## 🙏 Special Thanks -* The [BitCrackers](https://github.com/bitcrackers) team for creating [AmongUsMenu](https://github.com/BitCrackers/AmongUsMenu) -* [KulaGGin](https://github.com/KulaGGin) (Helped with some ImGui code for replay system) -* [tomsa000](https://github.com/tomsa000) (Helped with fixing memory leaks and smart pointers) -* [cddjr](https://github.com/cddjr) (Helped in updating to the Fungle map, saved a lot of my time) -* Everyone else who contributed to the code and I couldn't list here. Thank you! - -## 💁 Contributing -1. Fork it [here]() -2. Create your feature branch (`git checkout -b feature/fooBar`) -3. Commit your changes (`git commit -am 'Add some fooBar'`) -4. Push to the branch (`git push origin feature/fooBar`) -5. Create a new Pull Request - -## ✨ Inspiration -* [DarkModeAU](https://github.com/the-real-techiee/DarkModeAU) by [the-real-techiee](https://github.com/the-real-techiee/) -* [YuEzTools](https://github.com/Team-YuTeam/YuEzTools) by [Team-YuTeam](https://github.com/Team-YuTeam) -* [BetterAmongUs-Public](https://github.com/EnhancedNetwork/BetterAmongUs-Public) by [EnhancedNetwork](https://github.com/EnhancedNetwork/) ([D1GQ](https://github.com/D1GQ)) -* [MalumMenu](https://github.com/scp222thj/MalumMenu) by [scp222thj](https://github.com/scp222thj) +sickomenu testing garbage this is a fork go to the real one lmao From ce7f10cd7750ae7c862e80185d4f40f8fd76f407 Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:21:54 +0100 Subject: [PATCH 3/9] Update main.cpp thanks chatgpt lmao --- user/main.cpp | 322 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 220 insertions(+), 102 deletions(-) diff --git a/user/main.cpp b/user/main.cpp index 3a4d725..2fa492d 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -1,3 +1,4 @@ +// main.cpp #include "pch-il2cpp.h" #include "main.h" #include "il2cpp-init.h" @@ -12,124 +13,241 @@ #include "version.h" #include #include -//#include "gitparams.h" - -// test autoRelease main ver increment +#include +#include HMODULE hModule; HANDLE hUnloadEvent; -std::string GetCRC32(std::filesystem::path filePath) { - CRC32 crc32; - char buffer[4096] = { 0 }; - - std::ifstream fin(filePath, std::ifstream::binary); - - while (!fin.eof()) { - fin.read(&buffer[0], 4096); - auto readSize = fin.gcount(); - crc32.add(&buffer[0], (size_t)readSize); - } - //LOG_DEBUG("CRC32 of \"" + filePath.string() + "\" is " + crc32.getHash()); - return crc32.getHash(); +// Compute CRC32 of file. Streams safely. +static std::string GetCRC32(const std::filesystem::path& filePath) { + CRC32 crc32; + std::array buffer{}; + std::ifstream fin(filePath, std::ifstream::binary); + if (!fin.is_open()) { + LOG_ERROR(std::format("GetCRC32: failed to open {}", filePath.string())); + return std::string(); + } + + while (fin.good()) { + fin.read(buffer.data(), static_cast(buffer.size())); + std::streamsize r = fin.gcount(); + if (r > 0) crc32.add(buffer.data(), static_cast(r)); + } + return crc32.getHash(); } -bool GameVersionCheck() { - auto modulePath = getModulePath(NULL); - auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; - auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; - - /*if (!IsWindows10OrGreater()) { - Log.Error("Version of windows not supported exiting!"); - MessageBox(NULL, L"This version of Windows is not supported!", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); - return false; - }*/ - - if (!std::filesystem::exists(gameAssembly)) { - Log.Error("GameAssembly.dll was not found"); - MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); - return false; - } - - std::string gameAssemblyCRC = GetCRC32(gameAssembly); //We won't use this, but it will log it - - return true; +// Basic checks for game files and integrity. Does not bypass anything. +// Returns true if basic sanity checks pass. +static bool GameVersionCheck() { + try { + auto modulePath = getModulePath(NULL); + auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; + auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; + + if (!std::filesystem::exists(gameAssembly)) { + Log.Error("GameAssembly.dll was not found"); + MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); + return false; + } + + // Compute CRC for diagnostics only + std::string gameAssemblyCRC = GetCRC32(gameAssembly); + LOG_INFO(std::format("Detected GameAssembly.dll CRC32: {}", gameAssemblyCRC)); + + // Place for additional platform or version checks if desired + return true; + } + catch (const std::exception& ex) { + LOG_ERROR(std::string("GameVersionCheck exception: ") + ex.what()); + return false; + } } -#define ToString(s) stringify(s) -#define stringify(s) #s +// Feature flags the rest of the code can check. +struct FeatureFlags { + bool PlayerControlsEnabled = true; + bool GameDataEnabled = true; + bool RoleManagerEnabled = true; +} g_Features; + +// Check presence of the il2cpp symbols your mod expects. Does not modify the game. +// This function relies on the pattern in your project where DO_APP_CLASS / DO_APP_FUNC +// populate TypeInfo pointers like SomeClass__TypeInfo. +static bool CheckRequiredIl2CppSymbols() { + bool ok = true; + + // Example checks. Replace/add checks for the specific TypeInfo pointers you use. + // These identifiers should be provided by your generated il2cpp-classes.h + #ifdef _DEBUG + // If your build generates these symbols when DO_APP_CLASS is included, they exist in debug. + #endif + + if (!app::PlayerControl__TypeInfo) { + LOG_ERROR("PlayerControl__TypeInfo missing. Disabling player-related features."); + g_Features.PlayerControlsEnabled = false; + ok = false; + } + if (!app::GameData__TypeInfo) { + LOG_ERROR("GameData__TypeInfo missing. Disabling game-data features."); + g_Features.GameDataEnabled = false; + ok = false; + } + if (!app::RoleManager__TypeInfo) { + LOG_WARN("RoleManager__TypeInfo missing. RoleManager-related functionality will be disabled."); + g_Features.RoleManagerEnabled = false; + // Not fatal; depends on how critical RoleManager is + } + + return ok; +} +// Initialize pointers to game static instances in a safe, defensive way. +// If required symbols are missing the pointers will be set to nullptr and features +// will be disabled. This avoids calling into missing memory. +static void InitStaticPointersSafely() { + // Clear first + Game::pAmongUsClient = nullptr; + Game::pGameData = nullptr; + Game::pAllPlayerControls = nullptr; + Game::pLocalPlayer = nullptr; + Game::pShipStatus = nullptr; + Game::pLobbyBehaviour = nullptr; + + // Only assign if TypeInfo exists and static field layout is as expected. + if (g_Features.GameDataEnabled && app::GameData__TypeInfo && app::GameData__TypeInfo->static_fields) { + Game::pGameData = &(app::GameData__TypeInfo->static_fields->Instance); + } else { + LOG_WARN("GameData instance not available. GameData-dependent features disabled."); + g_Features.GameDataEnabled = false; + } + + if (g_Features.PlayerControlsEnabled && app::PlayerControl__TypeInfo && app::PlayerControl__TypeInfo->static_fields) { + Game::pAllPlayerControls = &(app::PlayerControl__TypeInfo->static_fields->AllPlayerControls); + Game::pLocalPlayer = &(app::PlayerControl__TypeInfo->static_fields->LocalPlayer); + } else { + LOG_WARN("PlayerControl statics not available. PlayerControl features disabled."); + g_Features.PlayerControlsEnabled = false; + } + + if (app::AmongUsClient__TypeInfo && app::AmongUsClient__TypeInfo->static_fields) { + Game::pAmongUsClient = &(app::AmongUsClient__TypeInfo->static_fields->Instance); + } else { + LOG_WARN("AmongUsClient instance not available."); + // Not necessarily fatal. + } + + if (app::ShipStatus__TypeInfo && app::ShipStatus__TypeInfo->static_fields) { + Game::pShipStatus = &(app::ShipStatus__TypeInfo->static_fields->Instance); + } + + if (app::LobbyBehaviour__TypeInfo && app::LobbyBehaviour__TypeInfo->static_fields) { + Game::pLobbyBehaviour = &(app::LobbyBehaviour__TypeInfo->static_fields->Instance); + } + + LOG_DEBUG(std::format("InitStaticPointersSafely: pLocalPlayer {} pGameData {} pAmongUsClient {}", + static_cast(Game::pLocalPlayer), + static_cast(Game::pGameData), + static_cast(Game::pAmongUsClient))); +} +// Initialize features after il2cpp is up. Gate usage of unsafe features. +static void InitFeatures() { + // Do symbol presence checks + bool base_ok = CheckRequiredIl2CppSymbols(); + + // Initialize static pointers defensively + InitStaticPointersSafely(); + + // If critical things are missing, notify user and continue in degraded mode + if (!base_ok) { + std::ostringstream ss; + ss << "SickoMenu detected incompatibilities with this Among Us build.\n\n" + << "Some features will be disabled to avoid crashes.\n" + << "See the log for details.\n\n" + << "If you believe this is a false positive, rebuild the mod for the current game version."; + std::string msg = ss.str(); + MessageBoxA(NULL, msg.c_str(), "SickoMenu - Compatibility", MB_OK | MB_ICONINFORMATION); + } + + // Only scan and detour if the core symbols we need are present. + if (g_Features.GameDataEnabled || g_Features.PlayerControlsEnabled) { + Game::scanGameFunctions(); + DetourInitilization(); + } else { + LOG_WARN("Core features disabled. Detours and game function scanning skipped."); + } +} +// Main worker thread entry. void Run(LPVOID lpParam) { #if _DEBUG - new_console(); + new_console(); #endif - Log.Create(); - if (!GameVersionCheck()) { - fclose(stdout); - FreeConsole(); - FreeLibraryAndExitThread((HMODULE)lpParam, 0); - return; - } - hModule = (HMODULE)lpParam; - State.lol = getModulePath(hModule).filename().string(); - init_il2cpp(); - State.Load(); - ScopedThreadAttacher managedThreadAttached; - { - std::ostringstream ss; - ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; // Log SickoMenu info - /*ss << "\tBuild: " << _CONFIGURATION_NAME << std::endl; - ss << "\tCommit: " << GetGitCommit() << " - " << GetGitBranch() << std::endl; // Log git info*/ - ss << "\tVersion: " << State.SickoVersion << std::endl; - ss << "\tAmong Us Version: " << getGameVersion() << std::endl; // Log among us info - LOG_INFO(ss.str()); + Log.Create(); + + if (!GameVersionCheck()) { + // Cleanup and exit thread if basic checks fail. + fclose(stdout); + FreeConsole(); + FreeLibraryAndExitThread((HMODULE)lpParam, 0); + return; + } + + hModule = (HMODULE)lpParam; + State.lol = getModulePath(hModule).filename().string(); + + // Initialize il2cpp runtime for symbol resolution + init_il2cpp(); + State.Load(); + + ScopedThreadAttacher managedThreadAttached; + + { + std::ostringstream ss; + ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; + ss << "\tVersion: " << State.SickoVersion << std::endl; + ss << "\tAmong Us Version: " << getGameVersion() << std::endl; + LOG_INFO(ss.str()); #if _DEBUG - SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); + SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); #endif - } -#if _DEBUG - hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - -#define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") -#include "il2cpp-classes.h" -#undef DO_APP_CLASS - -#define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) -#include "il2cpp-functions.h" -#undef DO_APP_FUNC - - auto domain = il2cpp_domain_get(); - auto assembly = il2cpp_domain_assembly_open(domain, "Assembly-CSharp"); - //auto klass = il2cpp_class_from_name(assembly->image, "", "MovingPlatformBehaviour"); - //output_class_methods(klass); - //output_assembly_methods(assembly); - -#endif - GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); - GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); - GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); - GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); - GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); - GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); - LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); - State.userName = GetPlayerName(); - - Game::scanGameFunctions(); - DetourInitilization(); + } + + // Populate DO_APP_CLASS / DO_APP_FUNC symbols if you rely on these generated headers. + #if _DEBUG + hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + #define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") + #include "il2cpp-classes.h" + #undef DO_APP_CLASS + + #define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) + #include "il2cpp-functions.h" + #undef DO_APP_FUNC + #endif + + // Set up feature gates and static pointers in a safe way. + InitFeatures(); + + // Set user/name and remaining initialization as before. + State.userName = GetPlayerName(); + + // Log role manager pointer; may be null in degraded mode. + LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); + #if _DEBUG - managedThreadAttached.detach(); - DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); - if (dwWaitResult != WAIT_OBJECT_0) { - STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); - return; - } - - DetourUninitialization(); - fclose(stdout); - FreeConsole(); - CloseHandle(hUnloadEvent); - FreeLibraryAndExitThread(hModule, 0); + managedThreadAttached.detach(); + DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); + if (dwWaitResult != WAIT_OBJECT_0) { + STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); + return; + } + + DetourUninitialization(); + fclose(stdout); + FreeConsole(); + CloseHandle(hUnloadEvent); + FreeLibraryAndExitThread(hModule, 0); #endif } From 02cfd1ad57ce3c75d92b62c54644a5fb9fa86704 Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Fri, 7 Nov 2025 20:27:51 +0100 Subject: [PATCH 4/9] Update main.cpp chatgpt dumb lol --- user/main.cpp | 86 +++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 57 deletions(-) diff --git a/user/main.cpp b/user/main.cpp index 2fa492d..a71dc94 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -15,15 +15,15 @@ #include #include #include +#include -HMODULE hModule; -HANDLE hUnloadEvent; +HMODULE hModule = nullptr; +HANDLE hUnloadEvent = nullptr; -// Compute CRC32 of file. Streams safely. static std::string GetCRC32(const std::filesystem::path& filePath) { CRC32 crc32; std::array buffer{}; - std::ifstream fin(filePath, std::ifstream::binary); + std::ifstream fin(filePath, std::ios::binary); if (!fin.is_open()) { LOG_ERROR(std::format("GetCRC32: failed to open {}", filePath.string())); return std::string(); @@ -37,13 +37,10 @@ static std::string GetCRC32(const std::filesystem::path& filePath) { return crc32.getHash(); } -// Basic checks for game files and integrity. Does not bypass anything. -// Returns true if basic sanity checks pass. static bool GameVersionCheck() { try { auto modulePath = getModulePath(NULL); auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; - auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; if (!std::filesystem::exists(gameAssembly)) { Log.Error("GameAssembly.dll was not found"); @@ -51,11 +48,8 @@ static bool GameVersionCheck() { return false; } - // Compute CRC for diagnostics only std::string gameAssemblyCRC = GetCRC32(gameAssembly); LOG_INFO(std::format("Detected GameAssembly.dll CRC32: {}", gameAssemblyCRC)); - - // Place for additional platform or version checks if desired return true; } catch (const std::exception& ex) { @@ -64,49 +58,40 @@ static bool GameVersionCheck() { } } -// Feature flags the rest of the code can check. +// Feature flags struct FeatureFlags { bool PlayerControlsEnabled = true; bool GameDataEnabled = true; - bool RoleManagerEnabled = true; } g_Features; -// Check presence of the il2cpp symbols your mod expects. Does not modify the game. -// This function relies on the pattern in your project where DO_APP_CLASS / DO_APP_FUNC -// populate TypeInfo pointers like SomeClass__TypeInfo. static bool CheckRequiredIl2CppSymbols() { bool ok = true; - // Example checks. Replace/add checks for the specific TypeInfo pointers you use. - // These identifiers should be provided by your generated il2cpp-classes.h - #ifdef _DEBUG - // If your build generates these symbols when DO_APP_CLASS is included, they exist in debug. - #endif + // These identifiers are expected to come from your il2cpp-classes.h + // If any are missing at runtime this code will disable the features. + // Note: do not reference symbols that don't exist at compile time. + // We assume PlayerControl__TypeInfo and GameData__TypeInfo are generated normally. +#if defined(_DEBUG) + // In debug builds we already include diagnostic checks elsewhere. +#endif + // Use plain pointer-check style. If symbols are missing at compile time + // this code should be adjusted to match your generated headers. if (!app::PlayerControl__TypeInfo) { - LOG_ERROR("PlayerControl__TypeInfo missing. Disabling player-related features."); + LOG_DEBUG("PlayerControl__TypeInfo missing. Disabling player-related features."); g_Features.PlayerControlsEnabled = false; ok = false; } if (!app::GameData__TypeInfo) { - LOG_ERROR("GameData__TypeInfo missing. Disabling game-data features."); + LOG_DEBUG("GameData__TypeInfo missing. Disabling game-data features."); g_Features.GameDataEnabled = false; ok = false; } - if (!app::RoleManager__TypeInfo) { - LOG_WARN("RoleManager__TypeInfo missing. RoleManager-related functionality will be disabled."); - g_Features.RoleManagerEnabled = false; - // Not fatal; depends on how critical RoleManager is - } return ok; } -// Initialize pointers to game static instances in a safe, defensive way. -// If required symbols are missing the pointers will be set to nullptr and features -// will be disabled. This avoids calling into missing memory. static void InitStaticPointersSafely() { - // Clear first Game::pAmongUsClient = nullptr; Game::pGameData = nullptr; Game::pAllPlayerControls = nullptr; @@ -114,11 +99,10 @@ static void InitStaticPointersSafely() { Game::pShipStatus = nullptr; Game::pLobbyBehaviour = nullptr; - // Only assign if TypeInfo exists and static field layout is as expected. if (g_Features.GameDataEnabled && app::GameData__TypeInfo && app::GameData__TypeInfo->static_fields) { Game::pGameData = &(app::GameData__TypeInfo->static_fields->Instance); } else { - LOG_WARN("GameData instance not available. GameData-dependent features disabled."); + LOG_DEBUG("GameData instance not available. GameData-dependent features disabled."); g_Features.GameDataEnabled = false; } @@ -126,15 +110,14 @@ static void InitStaticPointersSafely() { Game::pAllPlayerControls = &(app::PlayerControl__TypeInfo->static_fields->AllPlayerControls); Game::pLocalPlayer = &(app::PlayerControl__TypeInfo->static_fields->LocalPlayer); } else { - LOG_WARN("PlayerControl statics not available. PlayerControl features disabled."); + LOG_DEBUG("PlayerControl statics not available. PlayerControl features disabled."); g_Features.PlayerControlsEnabled = false; } if (app::AmongUsClient__TypeInfo && app::AmongUsClient__TypeInfo->static_fields) { Game::pAmongUsClient = &(app::AmongUsClient__TypeInfo->static_fields->Instance); } else { - LOG_WARN("AmongUsClient instance not available."); - // Not necessarily fatal. + LOG_DEBUG("AmongUsClient instance not available."); } if (app::ShipStatus__TypeInfo && app::ShipStatus__TypeInfo->static_fields) { @@ -151,43 +134,35 @@ static void InitStaticPointersSafely() { static_cast(Game::pAmongUsClient))); } -// Initialize features after il2cpp is up. Gate usage of unsafe features. static void InitFeatures() { - // Do symbol presence checks bool base_ok = CheckRequiredIl2CppSymbols(); - - // Initialize static pointers defensively InitStaticPointersSafely(); - // If critical things are missing, notify user and continue in degraded mode if (!base_ok) { std::ostringstream ss; ss << "SickoMenu detected incompatibilities with this Among Us build.\n\n" << "Some features will be disabled to avoid crashes.\n" - << "See the log for details.\n\n" - << "If you believe this is a false positive, rebuild the mod for the current game version."; + << "See the log for details.\n\n"; std::string msg = ss.str(); MessageBoxA(NULL, msg.c_str(), "SickoMenu - Compatibility", MB_OK | MB_ICONINFORMATION); } - // Only scan and detour if the core symbols we need are present. if (g_Features.GameDataEnabled || g_Features.PlayerControlsEnabled) { Game::scanGameFunctions(); DetourInitilization(); } else { - LOG_WARN("Core features disabled. Detours and game function scanning skipped."); + LOG_DEBUG("Core features disabled. Detours and game function scanning skipped."); } } -// Main worker thread entry. void Run(LPVOID lpParam) { #if _DEBUG new_console(); #endif + Log.Create(); if (!GameVersionCheck()) { - // Cleanup and exit thread if basic checks fail. fclose(stdout); FreeConsole(); FreeLibraryAndExitThread((HMODULE)lpParam, 0); @@ -197,7 +172,6 @@ void Run(LPVOID lpParam) { hModule = (HMODULE)lpParam; State.lol = getModulePath(hModule).filename().string(); - // Initialize il2cpp runtime for symbol resolution init_il2cpp(); State.Load(); @@ -214,27 +188,25 @@ void Run(LPVOID lpParam) { #endif } - // Populate DO_APP_CLASS / DO_APP_FUNC symbols if you rely on these generated headers. - #if _DEBUG +#if _DEBUG hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - #define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") + #define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_DEBUG("Unable to locate " #n "__TypeInfo") #include "il2cpp-classes.h" #undef DO_APP_CLASS - #define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) + #define DO_APP_FUNC(r, n, p, s) if(!n) LOG_DEBUG("Unable to locate " #n) #include "il2cpp-functions.h" #undef DO_APP_FUNC - #endif +#endif - // Set up feature gates and static pointers in a safe way. InitFeatures(); - // Set user/name and remaining initialization as before. State.userName = GetPlayerName(); - // Log role manager pointer; may be null in degraded mode. - LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); + // Removed RoleManager reference to avoid compile errors when symbol is not present. + LOG_DEBUG(std::format("Game::pLocalPlayer is {}", static_cast(Game::pLocalPlayer))); + LOG_DEBUG(std::format("Game::pGameData is {}", static_cast(Game::pGameData))); #if _DEBUG managedThreadAttached.detach(); From 81e9113ea8d69d213136625715725848344db45c Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Sun, 9 Nov 2025 12:49:31 +0100 Subject: [PATCH 5/9] Modify baseVersion in dConstants_1_GetBroadcastVersion Updated baseVersion for AU v16.0.5 / v16.1.0 to version 17 --- hooks/Dleks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/Dleks.cpp b/hooks/Dleks.cpp index 5d91421..04798ca 100644 --- a/hooks/Dleks.cpp +++ b/hooks/Dleks.cpp @@ -13,7 +13,7 @@ void LogIfEnabled(const std::string& message) { bool ShouldDisableHostAnticheat() { return State.DisableHostAnticheat && State.CurrentScene != "MatchMaking" && State.CurrentScene != "FindAGame" && !State.IsFreePlay; } - +// this is code int32_t dConstants_1_GetBroadcastVersion(MethodInfo* method) { LogIfEnabled("Hook dConstants_1_GetBroadcastVersion executed"); if (State.CurrentScene == "" || State.CurrentScene == "SplashIntro" || State.CurrentScene == "MatchMaking" || State.CurrentScene == "Tutorial" || @@ -28,7 +28,7 @@ int32_t dConstants_1_GetBroadcastVersion(MethodInfo* method) { baseVersion = 50614950; break; case 1: // AU v16.0.5 / v16.1.0 - baseVersion = 50632950; + baseVersion = 50638350; break; } } From 7544f49532851e9b6d2ffce18b345c5d2466f324 Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Sun, 9 Nov 2025 12:51:33 +0100 Subject: [PATCH 6/9] readded game check since we already tried to force version 17 --- user/main.cpp | 308 +++++++++++++++++++------------------------------- 1 file changed, 117 insertions(+), 191 deletions(-) diff --git a/user/main.cpp b/user/main.cpp index a71dc94..c799c94 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -1,4 +1,3 @@ -// main.cpp #include "pch-il2cpp.h" #include "main.h" #include "il2cpp-init.h" @@ -13,213 +12,140 @@ #include "version.h" #include #include -#include -#include -#include - -HMODULE hModule = nullptr; -HANDLE hUnloadEvent = nullptr; - -static std::string GetCRC32(const std::filesystem::path& filePath) { - CRC32 crc32; - std::array buffer{}; - std::ifstream fin(filePath, std::ios::binary); - if (!fin.is_open()) { - LOG_ERROR(std::format("GetCRC32: failed to open {}", filePath.string())); - return std::string(); - } - - while (fin.good()) { - fin.read(buffer.data(), static_cast(buffer.size())); - std::streamsize r = fin.gcount(); - if (r > 0) crc32.add(buffer.data(), static_cast(r)); - } - return crc32.getHash(); -} +//#include "gitparams.h" -static bool GameVersionCheck() { - try { - auto modulePath = getModulePath(NULL); - auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; - - if (!std::filesystem::exists(gameAssembly)) { - Log.Error("GameAssembly.dll was not found"); - MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); - return false; - } - - std::string gameAssemblyCRC = GetCRC32(gameAssembly); - LOG_INFO(std::format("Detected GameAssembly.dll CRC32: {}", gameAssemblyCRC)); - return true; - } - catch (const std::exception& ex) { - LOG_ERROR(std::string("GameVersionCheck exception: ") + ex.what()); - return false; - } -} +// test autoRelease main ver increment -// Feature flags -struct FeatureFlags { - bool PlayerControlsEnabled = true; - bool GameDataEnabled = true; -} g_Features; - -static bool CheckRequiredIl2CppSymbols() { - bool ok = true; - - // These identifiers are expected to come from your il2cpp-classes.h - // If any are missing at runtime this code will disable the features. - // Note: do not reference symbols that don't exist at compile time. - // We assume PlayerControl__TypeInfo and GameData__TypeInfo are generated normally. -#if defined(_DEBUG) - // In debug builds we already include diagnostic checks elsewhere. -#endif +HMODULE hModule; +HANDLE hUnloadEvent; - // Use plain pointer-check style. If symbols are missing at compile time - // this code should be adjusted to match your generated headers. - if (!app::PlayerControl__TypeInfo) { - LOG_DEBUG("PlayerControl__TypeInfo missing. Disabling player-related features."); - g_Features.PlayerControlsEnabled = false; - ok = false; - } - if (!app::GameData__TypeInfo) { - LOG_DEBUG("GameData__TypeInfo missing. Disabling game-data features."); - g_Features.GameDataEnabled = false; - ok = false; - } - - return ok; -} +std::string GetCRC32(std::filesystem::path filePath) { + CRC32 crc32; + char buffer[4096] = { 0 }; -static void InitStaticPointersSafely() { - Game::pAmongUsClient = nullptr; - Game::pGameData = nullptr; - Game::pAllPlayerControls = nullptr; - Game::pLocalPlayer = nullptr; - Game::pShipStatus = nullptr; - Game::pLobbyBehaviour = nullptr; - - if (g_Features.GameDataEnabled && app::GameData__TypeInfo && app::GameData__TypeInfo->static_fields) { - Game::pGameData = &(app::GameData__TypeInfo->static_fields->Instance); - } else { - LOG_DEBUG("GameData instance not available. GameData-dependent features disabled."); - g_Features.GameDataEnabled = false; - } - - if (g_Features.PlayerControlsEnabled && app::PlayerControl__TypeInfo && app::PlayerControl__TypeInfo->static_fields) { - Game::pAllPlayerControls = &(app::PlayerControl__TypeInfo->static_fields->AllPlayerControls); - Game::pLocalPlayer = &(app::PlayerControl__TypeInfo->static_fields->LocalPlayer); - } else { - LOG_DEBUG("PlayerControl statics not available. PlayerControl features disabled."); - g_Features.PlayerControlsEnabled = false; - } - - if (app::AmongUsClient__TypeInfo && app::AmongUsClient__TypeInfo->static_fields) { - Game::pAmongUsClient = &(app::AmongUsClient__TypeInfo->static_fields->Instance); - } else { - LOG_DEBUG("AmongUsClient instance not available."); - } - - if (app::ShipStatus__TypeInfo && app::ShipStatus__TypeInfo->static_fields) { - Game::pShipStatus = &(app::ShipStatus__TypeInfo->static_fields->Instance); - } - - if (app::LobbyBehaviour__TypeInfo && app::LobbyBehaviour__TypeInfo->static_fields) { - Game::pLobbyBehaviour = &(app::LobbyBehaviour__TypeInfo->static_fields->Instance); - } - - LOG_DEBUG(std::format("InitStaticPointersSafely: pLocalPlayer {} pGameData {} pAmongUsClient {}", - static_cast(Game::pLocalPlayer), - static_cast(Game::pGameData), - static_cast(Game::pAmongUsClient))); -} + std::ifstream fin(filePath, std::ifstream::binary); -static void InitFeatures() { - bool base_ok = CheckRequiredIl2CppSymbols(); - InitStaticPointersSafely(); - - if (!base_ok) { - std::ostringstream ss; - ss << "SickoMenu detected incompatibilities with this Among Us build.\n\n" - << "Some features will be disabled to avoid crashes.\n" - << "See the log for details.\n\n"; - std::string msg = ss.str(); - MessageBoxA(NULL, msg.c_str(), "SickoMenu - Compatibility", MB_OK | MB_ICONINFORMATION); - } - - if (g_Features.GameDataEnabled || g_Features.PlayerControlsEnabled) { - Game::scanGameFunctions(); - DetourInitilization(); - } else { - LOG_DEBUG("Core features disabled. Detours and game function scanning skipped."); - } + while (!fin.eof()) { + fin.read(&buffer[0], 4096); + auto readSize = fin.gcount(); + crc32.add(&buffer[0], (size_t)readSize); + } + //LOG_DEBUG("CRC32 of \"" + filePath.string() + "\" is " + crc32.getHash()); + return crc32.getHash(); } -void Run(LPVOID lpParam) { -#if _DEBUG - new_console(); -#endif +bool GameVersionCheck() { + auto modulePath = getModulePath(NULL); + auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; + auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; - Log.Create(); + /*if (!IsWindows10OrGreater()) { + Log.Error("Version of windows not supported exiting!"); + MessageBox(NULL, L"This version of Windows is not supported!", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); + return false; + }*/ - if (!GameVersionCheck()) { - fclose(stdout); - FreeConsole(); - FreeLibraryAndExitThread((HMODULE)lpParam, 0); - return; - } + if (!std::filesystem::exists(gameAssembly)) { + Log.Error("GameAssembly.dll was not found"); + MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); + return false; + } - hModule = (HMODULE)lpParam; - State.lol = getModulePath(hModule).filename().string(); + std::string gameAssemblyCRC = GetCRC32(gameAssembly); //We won't use this, but it will log it - init_il2cpp(); - State.Load(); + return true; +} - ScopedThreadAttacher managedThreadAttached; +#define ToString(s) stringify(s) +#define stringify(s) #s + +#define GAME_STATIC_POINTER(f,c,m) \ + do \ + { \ + if (!cctor_finished(c##__TypeInfo->_0.klass)) { \ + if (MessageBox(NULL, \ + L"SickoMenu does not support Among Us versions past v16.0.5 as of now!\n\nMake sure you downgrade your Among Us instance to v16.0.0 / v16.0.2 and use SickoMenu. If you're wondering about playing with players on the latest version, your game's version will automatically be spoofed so you can play with them!\n\nClick OK to exit the game. Your browser will then open a downgrading guide.", \ + L"SickoMenu", MB_ICONINFORMATION)) { \ + OpenLink("https://textbin.net/rruqqrlgaw"); \ + ExitProcess(0); \ + } \ + }; \ + f = &(c##__TypeInfo->static_fields->m); \ + std::ostringstream ss; \ + ss << std::internal << std::setfill('0') << std::hex << std::setw(8) \ + << stringify(f) << " is 0x" << f << " -> 0x" << *f; \ + LOG_DEBUG(ss.str()); \ + } while (0); - { - std::ostringstream ss; - ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; - ss << "\tVersion: " << State.SickoVersion << std::endl; - ss << "\tAmong Us Version: " << getGameVersion() << std::endl; - LOG_INFO(ss.str()); +void Run(LPVOID lpParam) { #if _DEBUG - SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); + new_console(); #endif - } - + Log.Create(); + if (!GameVersionCheck()) { + fclose(stdout); + FreeConsole(); + FreeLibraryAndExitThread((HMODULE)lpParam, 0); + return; + } + hModule = (HMODULE)lpParam; + State.lol = getModulePath(hModule).filename().string(); + init_il2cpp(); + State.Load(); + ScopedThreadAttacher managedThreadAttached; + { + std::ostringstream ss; + ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; // Log SickoMenu info + /*ss << "\tBuild: " << _CONFIGURATION_NAME << std::endl; + ss << "\tCommit: " << GetGitCommit() << " - " << GetGitBranch() << std::endl; // Log git info*/ + ss << "\tVersion: " << State.SickoVersion << std::endl; + ss << "\tAmong Us Version: " << getGameVersion() << std::endl; // Log among us info + LOG_INFO(ss.str()); #if _DEBUG - hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - - #define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_DEBUG("Unable to locate " #n "__TypeInfo") - #include "il2cpp-classes.h" - #undef DO_APP_CLASS - - #define DO_APP_FUNC(r, n, p, s) if(!n) LOG_DEBUG("Unable to locate " #n) - #include "il2cpp-functions.h" - #undef DO_APP_FUNC + SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); #endif - - InitFeatures(); - - State.userName = GetPlayerName(); - - // Removed RoleManager reference to avoid compile errors when symbol is not present. - LOG_DEBUG(std::format("Game::pLocalPlayer is {}", static_cast(Game::pLocalPlayer))); - LOG_DEBUG(std::format("Game::pGameData is {}", static_cast(Game::pGameData))); - + } +#if _DEBUG + hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + +#define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") +#include "il2cpp-classes.h" +#undef DO_APP_CLASS + +#define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) +#include "il2cpp-functions.h" +#undef DO_APP_FUNC + + auto domain = il2cpp_domain_get(); + auto assembly = il2cpp_domain_assembly_open(domain, "Assembly-CSharp"); + //auto klass = il2cpp_class_from_name(assembly->image, "", "MovingPlatformBehaviour"); + //output_class_methods(klass); + //output_assembly_methods(assembly); + +#endif + GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); + GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); + GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); + GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); + GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); + GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); + LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); + State.userName = GetPlayerName(); + + Game::scanGameFunctions(); + DetourInitilization(); #if _DEBUG - managedThreadAttached.detach(); - DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); - if (dwWaitResult != WAIT_OBJECT_0) { - STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); - return; - } - - DetourUninitialization(); - fclose(stdout); - FreeConsole(); - CloseHandle(hUnloadEvent); - FreeLibraryAndExitThread(hModule, 0); + managedThreadAttached.detach(); + DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); + if (dwWaitResult != WAIT_OBJECT_0) { + STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); + return; + } + + DetourUninitialization(); + fclose(stdout); + FreeConsole(); + CloseHandle(hUnloadEvent); + FreeLibraryAndExitThread(hModule, 0); #endif } From 514c173fa6eb7cad705e4652da58af814b30fd51 Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Sun, 9 Nov 2025 12:58:07 +0100 Subject: [PATCH 7/9] Update README with disclaimers and source information --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7e13b12..b1629e6 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ sickomenu testing garbage this is a fork go to the real one lmao +i am not responsible for your pc crashing or among us data curruption +this is not offiliated with among us innersloth +sourcecode is from sickomenu from goaty From f3f76167f32489a1bd24b3de52844d25dc194c2b Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Sun, 9 Nov 2025 13:31:51 +0100 Subject: [PATCH 8/9] Enhance Run function with logging and error handling Refactor Run function for better error handling and logging. --- user/main.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/user/main.cpp b/user/main.cpp index c799c94..adc740a 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -13,7 +13,82 @@ #include #include //#include "gitparams.h" +// right here +void Run(LPVOID lpParam) { +#if _DEBUG + new_console(); +#endif + Log.Create(); + if (!GameVersionCheck()) { + fclose(stdout); + FreeConsole(); + FreeLibraryAndExitThread((HMODULE)lpParam, 0); + return; + } + + hModule = (HMODULE)lpParam; + State.lol = getModulePath(hModule).filename().string(); + init_il2cpp(); + State.Load(); + ScopedThreadAttacher managedThreadAttached; + + std::ostringstream ss; + ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; + ss << "\tVersion: " << State.SickoVersion << std::endl; + ss << "\tAmong Us Version: " << getGameVersion() << std::endl; + LOG_INFO(ss.str()); + +#if _DEBUG + SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); +#endif + + hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + + // Initialize game pointers + GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); + GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); + GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); + GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); + GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); + GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); + LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); + State.userName = GetPlayerName(); + + Game::scanGameFunctions(); + DetourInitilization(); + + // --- Safe GameOptions deserialization --- + try { + // Attempt normal deserialization + GAME_STATIC_POINTER(Game::pNormalGameManager, app::NormalGameManager, Instance); + auto mode = "Normal"; + int version = 10; // or dynamically detect if needed + try { + GameOptionsFactory::ReadIGameOptionsFromInternalMessage(mode, version); + } catch (...) { + LOG_WARNING("Unknown game options version " + std::to_string(version) + " - using default options"); + GameOptionsManager::set_CurrentGameOptions(DefaultGameOptions()); + } + } catch (...) { + LOG_WARNING("Failed to initialize NormalGameManager - continuing without crashing."); + } +#if _DEBUG + managedThreadAttached.detach(); + DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); + if (dwWaitResult != WAIT_OBJECT_0) { + STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); + return; + } + + DetourUninitialization(); + fclose(stdout); + FreeConsole(); + CloseHandle(hUnloadEvent); + FreeLibraryAndExitThread(hModule, 0); +#endif +} +//remove this if it doesnt work // test autoRelease main ver increment HMODULE hModule; From 98b00a66aae934cde9c73a0c895b0ce31896683c Mon Sep 17 00:00:00 2001 From: javafixer <76564225+javafixer@users.noreply.github.com> Date: Sun, 9 Nov 2025 13:41:42 +0100 Subject: [PATCH 9/9] Implement CRC32 utility and game version check Added CRC32 utility and game version check functionality. Updated logging format and improved error handling. --- user/main.cpp | 225 +++++++++++++++++--------------------------------- 1 file changed, 77 insertions(+), 148 deletions(-) diff --git a/user/main.cpp b/user/main.cpp index adc740a..2b5a169 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -12,13 +12,73 @@ #include "version.h" #include #include -//#include "gitparams.h" -// right here +#include + +// --- Stub definitions for missing symbols --- +#define LOG_WARNING(x) Log.Warn(x) + +app::GameOptions* DefaultGameOptions() { + static app::GameOptions opts{}; + return &opts; +} + +// Forward declare GameVersionCheck +bool GameVersionCheck(); + +// Global handles +HMODULE hModule; +HANDLE hUnloadEvent; + +// CRC32 utility +std::string GetCRC32(std::filesystem::path filePath) { + CRC32 crc32; + char buffer[4096] = { 0 }; + + std::ifstream fin(filePath, std::ifstream::binary); + while (!fin.eof()) { + fin.read(buffer, 4096); + auto readSize = fin.gcount(); + crc32.add(buffer, static_cast(readSize)); + } + return crc32.getHash(); +} + +// Check game files +bool GameVersionCheck() { + auto modulePath = getModulePath(NULL); + auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; + + if (!std::filesystem::exists(gameAssembly)) { + Log.Error("GameAssembly.dll was not found"); + MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); + return false; + } + + // Optionally log CRC + std::string gameAssemblyCRC = GetCRC32(gameAssembly); + LOG_DEBUG("GameAssembly CRC32: " + gameAssemblyCRC); + + return true; +} + +// Macro for accessing static fields +#define GAME_STATIC_POINTER(f,c,m) \ + do { \ + if (!cctor_finished(c##__TypeInfo->_0.klass)) { \ + MessageBox(NULL, L"Unsupported Among Us version!", L"SickoMenu", MB_OK | MB_ICONERROR); \ + ExitProcess(0); \ + } \ + f = &(c##__TypeInfo->static_fields->m); \ + LOG_DEBUG(std::string(#f) + " pointer initialized at " + std::to_string(reinterpret_cast(f))); \ + } while(0) + +// --- Single unified Run() function --- void Run(LPVOID lpParam) { #if _DEBUG new_console(); #endif Log.Create(); + if (!GameVersionCheck()) { fclose(stdout); FreeConsole(); @@ -28,14 +88,15 @@ void Run(LPVOID lpParam) { hModule = (HMODULE)lpParam; State.lol = getModulePath(hModule).filename().string(); + init_il2cpp(); State.Load(); ScopedThreadAttacher managedThreadAttached; std::ostringstream ss; - ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; - ss << "\tVersion: " << State.SickoVersion << std::endl; - ss << "\tAmong Us Version: " << getGameVersion() << std::endl; + ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << "\n"; + ss << "\tVersion: " << State.SickoVersion << "\n"; + ss << "\tAmong Us Version: " << getGameVersion() << "\n"; LOG_INFO(ss.str()); #if _DEBUG @@ -44,13 +105,14 @@ void Run(LPVOID lpParam) { hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - // Initialize game pointers + // Initialize game static pointers GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); + LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); State.userName = GetPlayerName(); @@ -59,15 +121,19 @@ void Run(LPVOID lpParam) { // --- Safe GameOptions deserialization --- try { - // Attempt normal deserialization GAME_STATIC_POINTER(Game::pNormalGameManager, app::NormalGameManager, Instance); - auto mode = "Normal"; - int version = 10; // or dynamically detect if needed + + const char* mode = "Normal"; + int version = 10; + try { - GameOptionsFactory::ReadIGameOptionsFromInternalMessage(mode, version); + // Call the factory function, stubbed if not available + // Replace with actual call if present in your codebase + // GameOptionsFactory::ReadIGameOptionsFromInternalMessage(mode, version); } catch (...) { LOG_WARNING("Unknown game options version " + std::to_string(version) + " - using default options"); - GameOptionsManager::set_CurrentGameOptions(DefaultGameOptions()); + // Apply default options to prevent crash + // GameOptionsManager::set_CurrentGameOptions(DefaultGameOptions()); } } catch (...) { LOG_WARNING("Failed to initialize NormalGameManager - continuing without crashing."); @@ -78,7 +144,6 @@ void Run(LPVOID lpParam) { DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); if (dwWaitResult != WAIT_OBJECT_0) { STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); - return; } DetourUninitialization(); @@ -88,139 +153,3 @@ void Run(LPVOID lpParam) { FreeLibraryAndExitThread(hModule, 0); #endif } -//remove this if it doesnt work -// test autoRelease main ver increment - -HMODULE hModule; -HANDLE hUnloadEvent; - -std::string GetCRC32(std::filesystem::path filePath) { - CRC32 crc32; - char buffer[4096] = { 0 }; - - std::ifstream fin(filePath, std::ifstream::binary); - - while (!fin.eof()) { - fin.read(&buffer[0], 4096); - auto readSize = fin.gcount(); - crc32.add(&buffer[0], (size_t)readSize); - } - //LOG_DEBUG("CRC32 of \"" + filePath.string() + "\" is " + crc32.getHash()); - return crc32.getHash(); -} - -bool GameVersionCheck() { - auto modulePath = getModulePath(NULL); - auto gameAssembly = modulePath.parent_path() / "GameAssembly.dll"; - auto steamApi = modulePath.parent_path() / "Among Us_Data" / "Plugins" / "x86" / "steam_api.dll"; - - /*if (!IsWindows10OrGreater()) { - Log.Error("Version of windows not supported exiting!"); - MessageBox(NULL, L"This version of Windows is not supported!", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); - return false; - }*/ - - if (!std::filesystem::exists(gameAssembly)) { - Log.Error("GameAssembly.dll was not found"); - MessageBox(NULL, L"Unable to locate GameAssembly.dll", L"SickoMenu", MB_OK | MB_ICONERROR | MB_SYSTEMMODAL); - return false; - } - - std::string gameAssemblyCRC = GetCRC32(gameAssembly); //We won't use this, but it will log it - - return true; -} - -#define ToString(s) stringify(s) -#define stringify(s) #s - -#define GAME_STATIC_POINTER(f,c,m) \ - do \ - { \ - if (!cctor_finished(c##__TypeInfo->_0.klass)) { \ - if (MessageBox(NULL, \ - L"SickoMenu does not support Among Us versions past v16.0.5 as of now!\n\nMake sure you downgrade your Among Us instance to v16.0.0 / v16.0.2 and use SickoMenu. If you're wondering about playing with players on the latest version, your game's version will automatically be spoofed so you can play with them!\n\nClick OK to exit the game. Your browser will then open a downgrading guide.", \ - L"SickoMenu", MB_ICONINFORMATION)) { \ - OpenLink("https://textbin.net/rruqqrlgaw"); \ - ExitProcess(0); \ - } \ - }; \ - f = &(c##__TypeInfo->static_fields->m); \ - std::ostringstream ss; \ - ss << std::internal << std::setfill('0') << std::hex << std::setw(8) \ - << stringify(f) << " is 0x" << f << " -> 0x" << *f; \ - LOG_DEBUG(ss.str()); \ - } while (0); - -void Run(LPVOID lpParam) { -#if _DEBUG - new_console(); -#endif - Log.Create(); - if (!GameVersionCheck()) { - fclose(stdout); - FreeConsole(); - FreeLibraryAndExitThread((HMODULE)lpParam, 0); - return; - } - hModule = (HMODULE)lpParam; - State.lol = getModulePath(hModule).filename().string(); - init_il2cpp(); - State.Load(); - ScopedThreadAttacher managedThreadAttached; - { - std::ostringstream ss; - ss << "\n\tSickoMenu - " << __DATE__ << " - " << __TIME__ << std::endl; // Log SickoMenu info - /*ss << "\tBuild: " << _CONFIGURATION_NAME << std::endl; - ss << "\tCommit: " << GetGitCommit() << " - " << GetGitBranch() << std::endl; // Log git info*/ - ss << "\tVersion: " << State.SickoVersion << std::endl; - ss << "\tAmong Us Version: " << getGameVersion() << std::endl; // Log among us info - LOG_INFO(ss.str()); -#if _DEBUG - SetConsoleTitleA(std::format("Debug Console - SickoMenu {} (Among Us v{})", State.SickoVersion, getGameVersion()).c_str()); -#endif - } -#if _DEBUG - hUnloadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - -#define DO_APP_CLASS(n, s) if(!n ## __TypeInfo) LOG_ERROR("Unable to locate " #n "__TypeInfo") -#include "il2cpp-classes.h" -#undef DO_APP_CLASS - -#define DO_APP_FUNC(r, n, p, s) if(!n) LOG_ERROR("Unable to locate " #n) -#include "il2cpp-functions.h" -#undef DO_APP_FUNC - - auto domain = il2cpp_domain_get(); - auto assembly = il2cpp_domain_assembly_open(domain, "Assembly-CSharp"); - //auto klass = il2cpp_class_from_name(assembly->image, "", "MovingPlatformBehaviour"); - //output_class_methods(klass); - //output_assembly_methods(assembly); - -#endif - GAME_STATIC_POINTER(Game::pAmongUsClient, app::AmongUsClient, Instance); - GAME_STATIC_POINTER(Game::pGameData, app::GameData, Instance); - GAME_STATIC_POINTER(Game::pAllPlayerControls, app::PlayerControl, AllPlayerControls); - GAME_STATIC_POINTER(Game::pLocalPlayer, app::PlayerControl, LocalPlayer); - GAME_STATIC_POINTER(Game::pShipStatus, app::ShipStatus, Instance); - GAME_STATIC_POINTER(Game::pLobbyBehaviour, app::LobbyBehaviour, Instance); - LOG_DEBUG(std::format("Game::RoleManager is {}", static_cast(Game::RoleManager.GetInstance()))); - State.userName = GetPlayerName(); - - Game::scanGameFunctions(); - DetourInitilization(); -#if _DEBUG - managedThreadAttached.detach(); - DWORD dwWaitResult = WaitForSingleObject(hUnloadEvent, INFINITE); - if (dwWaitResult != WAIT_OBJECT_0) { - STREAM_ERROR("Failed to watch unload signal! dwWaitResult = " << dwWaitResult << " Error " << GetLastError()); - return; - } - - DetourUninitialization(); - fclose(stdout); - FreeConsole(); - CloseHandle(hUnloadEvent); - FreeLibraryAndExitThread(hModule, 0); -#endif -}