Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
2022.03.29 (#327)
Browse files Browse the repository at this point in the history
* updated structs (still broken)

* still crashes in multiplayer matches
* disabled cosmetics hooks for now
* 'Show Ghosts' in hooks/PlayerControl.cpp::dRenderer_set_enabled hook is nonfunctional

* fixed crash

* able to play full multiplayer match now
* Show Ghosts still broken, cosmetics still disabled

* fixed 'Show Ghosts' & multithreading crash

* all modifications to event-related collections should use the Replay.replayEventMutex
* included comment for future devs to see too
* also removed use of MFC static libs, they don't seem to be necessary and i don't have them installed

* fixed cosmetics unlocking

* shoutout to @cddjr for suggestion on hooking SaveManager::GetPurchase
* also removed MFC static libs from all build configs
  • Loading branch information
kotae4 authored Apr 2, 2022
1 parent b99ea4e commit 7434164
Show file tree
Hide file tree
Showing 23 changed files with 733 additions and 415 deletions.
6 changes: 3 additions & 3 deletions AmongUsMenu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<ClCompile Include="rpc\RpcPlayerAppearance.cpp" />
<ClCompile Include="rpc\RpcSetRole.cpp" />
<ClCompile Include="rpc\RpcUsePlatform.cpp" />
<ClCompile Include="SaveManager.cpp" />
<ClCompile Include="user\keybinds.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down Expand Up @@ -187,7 +188,6 @@
</ClCompile>
<ClCompile Include="hooks\Chat.cpp" />
<ClCompile Include="hooks\Doors.cpp" />
<ClCompile Include="hooks\HatManager.cpp" />
<ClCompile Include="hooks\KeyboardJoystick.cpp" />
<ClCompile Include="hooks\MeetingHud.cpp" />
<ClCompile Include="hooks\PlayerControl.cpp" />
Expand Down Expand Up @@ -428,7 +428,7 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand All @@ -437,7 +437,7 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>Static</UseOfMfc>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Version|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand Down
12 changes: 6 additions & 6 deletions AmongUsMenu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
<ClCompile Include="hooks\GameOptionsData.cpp">
<Filter>hooks</Filter>
</ClCompile>
<ClCompile Include="hooks\HatManager.cpp">
<Filter>hooks</Filter>
</ClCompile>
<ClCompile Include="hooks\HudManager.cpp">
<Filter>hooks</Filter>
</ClCompile>
Expand Down Expand Up @@ -268,9 +265,9 @@
<ClCompile Include="events\ProtectPlayerEvent.cpp">
<Filter>events</Filter>
</ClCompile>
<ClInclude Include="hooks\RoleManager.hpp">
<Filter>hooks</Filter>
</ClInclude>
<ClInclude Include="hooks\RoleManager.hpp">
<Filter>hooks</Filter>
</ClInclude>
<ClCompile Include="hooks\RoleManager.cpp">
<Filter>hooks</Filter>
</ClCompile>
Expand All @@ -289,6 +286,9 @@
<ClCompile Include="profiler.cpp">
<Filter>user</Filter>
</ClCompile>
<ClCompile Include="SaveManager.cpp">
<Filter>hooks</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="appdata\il2cpp-api-functions.h">
Expand Down
9 changes: 9 additions & 0 deletions SaveManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "pch-il2cpp.h"
#include "_hooks.h"
#include "state.hpp"
#include "game.h"

bool dSaveManager_GetPurchase(String* itemKey, String* bundleKey, MethodInfo* method)
{
return true;
}
5 changes: 4 additions & 1 deletion appdata/il2cpp-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ DO_APP_FUNC(void, Object_DestroyImmediate, (Object_1* obj, MethodInfo* method),
DO_APP_FUNC(Component_1*, Component_GetComponent, (Component_1* __this, Type* type, MethodInfo* method), "UnityEngine.CoreModule, UnityEngine.Component UnityEngine.Component::GetComponent(System.Type)");

DO_APP_FUNC(Transform*, GameObject_get_transform, (GameObject* __this, MethodInfo* method), "UnityEngine.CoreModule, UnityEngine.Transform UnityEngine.GameObject::get_transform()");
DO_APP_FUNC(Transform*, Transform_GetRoot, (Transform* __this, MethodInfo* method), "UnityEngine.CoreModule, UnityEngine.Transform UnityEngine.Transform::GetRoot()");
DO_APP_FUNC(String*, Component_get_tag, (Component_1* __this, MethodInfo* method), "UnityEngine.CoreModule, System.String UnityEngine.Component::get_tag()");
DO_APP_FUNC(void, GameObject_set_layer, (GameObject* __this, int32_t value, MethodInfo* method), "UnityEngine.CoreModule, System.Void UnityEngine.GameObject::set_layer(System.Int32)");
DO_APP_FUNC(int32_t, GameObject_get_layer, (GameObject* __this, MethodInfo* method), "UnityEngine.CoreModule, System.Int32 UnityEngine.GameObject::get_layer()");
Expand Down Expand Up @@ -196,4 +197,6 @@ DO_APP_FUNC(void, RoleManager_AssignRolesForTeam, (List_1_GameData_PlayerInfo_*
DO_APP_FUNC(void, RoleManager_AssignRolesFromList, (List_1_GameData_PlayerInfo_* players, int32_t teamMax, List_1_RoleTypes_* roleList, int32_t* rolesAssigned, MethodInfo* method), "Assembly-CSharp, System.Void RoleManager::AssignRolesFromList(System.Collections.Generic.List<GameData.PlayerInfo>, System.Int32, System.Collections.Generic.List<RoleTypes>, System.Int32&)");
DO_APP_FUNC(void, InnerNetClient_EnqueueDisconnect, (InnerNetClient* __this, DisconnectReasons__Enum reason, String* stringReason, MethodInfo* method), "Assembly-CSharp, System.Void InnerNet.InnerNetClient::EnqueueDisconnect(DisconnectReasons, System.String)");

DO_APP_FUNC(void, PlayerPhysics_FixedUpdate, (PlayerPhysics* __this, MethodInfo* method), "Assembly-CSharp, System.Void PlayerPhysics::FixedUpdate()");
DO_APP_FUNC(void, PlayerPhysics_FixedUpdate, (PlayerPhysics* __this, MethodInfo* method), "Assembly-CSharp, System.Void PlayerPhysics::FixedUpdate()");

DO_APP_FUNC(bool, SaveManager_GetPurchase, (String* itemKey, String* bundleKey, MethodInfo* method), "Assembly-CSharp, System.Boolean SaveManager::GetPurchase(System.String, System.String)");
Loading

0 comments on commit 7434164

Please sign in to comment.