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

Commit ce9404d

Browse files
authored
Update to 2022.10.25s(2449) (#438)
* Update to 2022.10.25s Compatible with 2022.10.18e * fix Hook * Deprecated SaveManager_XXX functions
1 parent eceb352 commit ce9404d

21 files changed

+106
-122
lines changed

appdata/il2cpp-classes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ DO_APP_CLASS(ShipStatus, "Assembly-CSharp, ShipStatus");
88
DO_APP_CLASS(GameOptionsData, "Assembly-CSharp, GameOptionsData");
99
DO_APP_CLASS(Camera, "UnityEngine.CoreModule, UnityEngine.Camera");
1010
DO_APP_CLASS(LobbyBehaviour, "Assembly-CSharp, LobbyBehaviour");
11-
DO_APP_CLASS(SaveManager, "Assembly-CSharp, SaveManager");
11+
//DO_APP_CLASS(SaveManager, "Assembly-CSharp, SaveManager");
1212
DO_APP_CLASS(MeetingHud, "Assembly-CSharp, MeetingHud");
1313
//DO_APP_CLASS(DestroyableSingleton_1_RoleManager_, "Assembly-CSharp, DestroyableSingleton_1_RoleManager_");

appdata/il2cpp-functions.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ DO_APP_FUNC(void, InnerNetClient_DisconnectInternal, (InnerNetClient* __this, Di
202202

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

205+
// deprecated
206+
DO_APP_FUNC(String*, SaveManager_get_PlayerName, (MethodInfo* method), "Assembly-CSharp, System.String SaveManager::get_PlayerName()");
207+
// deprecated
208+
DO_APP_FUNC(void, SaveManager_set_PlayerName, (String* value, MethodInfo* method), "Assembly-CSharp, System.Void SaveManager::set_PlayerName(System.String)");
209+
// deprecated
205210
DO_APP_FUNC(bool, SaveManager_GetPurchase, (String* itemKey, String* bundleKey, MethodInfo* method), "Assembly-CSharp, System.Boolean SaveManager::GetPurchase(System.String, System.String)");
206211

207212
DO_APP_FUNC(void, PlayerControl_TurnOnProtection, (PlayerControl* __this, bool visible, int32_t colorId, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::TurnOnProtection(System.Boolean, System.Int32)");
@@ -216,4 +221,10 @@ DO_APP_FUNC(String*, GameData_PlayerOutfit_get_PlayerName, (GameData_PlayerOutfi
216221
DO_APP_FUNC(String*, GameData_PlayerInfo_get_PlayerName, (GameData_PlayerInfo* __this, MethodInfo* method), "Assembly-CSharp, System.String GameData+PlayerInfo::get_PlayerName()");
217222

218223
DO_APP_FUNC(void, AccountManager_UpdateKidAccountDisplay, (AccountManager* __this, MethodInfo* method), "Assembly-CSharp, System.Void AccountManager::UpdateKidAccountDisplay()");
219-
DO_APP_FUNC(void, PlayerStorageManager_OnReadPlayerPrefsComplete, (PlayerStorageManager* __this, void* data, MethodInfo* method), "Assembly-CSharp, System.Void PlayerStorageManager::OnReadPlayerPrefsComplete(Epic.OnlineServices.PlayerDataStorage.ReadFileCallbackInfo)");
224+
DO_APP_FUNC(void, PlayerStorageManager_OnReadPlayerPrefsComplete, (PlayerStorageManager* __this, void* data, MethodInfo* method), "Assembly-CSharp, System.Void PlayerStorageManager::OnReadPlayerPrefsComplete(Epic.OnlineServices.PlayerDataStorage.ReadFileCallbackInfo)");
225+
226+
// 2022.10.25s
227+
DO_APP_FUNC(PlayerData*, DataManager_get_Player, (MethodInfo* method), "Assembly-CSharp, AmongUs.Data.Player.PlayerData AmongUs.Data.DataManager::get_Player()");
228+
DO_APP_FUNC(String*, PlayerCustomizationData_get_Name, (PlayerCustomizationData* __this, MethodInfo* method), "Assembly-CSharp, System.String AmongUs.Data.Player.PlayerCustomizationData::get_Name()");
229+
DO_APP_FUNC(void, PlayerCustomizationData_set_Name, (PlayerCustomizationData* __this, String* value, MethodInfo* method), "Assembly-CSharp, System.Void AmongUs.Data.Player.PlayerCustomizationData::set_Name(System.String)");
230+
DO_APP_FUNC(bool, PlayerPurchasesData_GetPurchase, (PlayerPurchasesData* __this, String* itemKey, String* bundleKey, MethodInfo* method), "Assembly-CSharp, System.Boolean PlayerPurchasesData::GetPurchase(System.String, System.String)");

appdata/il2cpp-types.h

Lines changed: 5 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -12187,96 +12187,9 @@ struct RoleEffectAnimation__Array {
1218712187
};
1218812188

1218912189
struct SaveManager {
12190-
struct SaveManager__Class* klass;
12190+
Il2CppClass* klass;
1219112191
MonitorData* monitor;
1219212192
};
12193-
12194-
struct SaveManager__VTable {
12195-
VirtualInvokeData Equals;
12196-
VirtualInvokeData Finalize;
12197-
VirtualInvokeData GetHashCode;
12198-
VirtualInvokeData ToString;
12199-
};
12200-
12201-
struct SaveManager__StaticFields {
12202-
int32_t lastSchemaVersion;
12203-
bool loaded;
12204-
bool loadedStats;
12205-
bool loadedAnnounce;
12206-
bool loadedQCFavorites;
12207-
bool loadedStoreTabViewDates;
12208-
bool loadedCachedPurchases;
12209-
void* OnColorBlindChanged;
12210-
void* OnStreamerModeChanged;
12211-
struct String* lastPlayerName;
12212-
uint32_t colorConfig;
12213-
struct String* lastPet;
12214-
struct String* lastHat;
12215-
struct String* lastSkin;
12216-
struct String* lastVisor;
12217-
struct String* lastNamePlate;
12218-
bool showOnlineHelp;
12219-
bool warnedAboutGuestModeProgression;
12220-
int32_t privacyPolicyVersion;
12221-
bool askRedeemDLC;
12222-
bool showMinPlayerWarning;
12223-
void* purchases;
12224-
struct String* lastCosmicube;
12225-
struct String* storeBundlesViewDate;
12226-
struct String* storeHatsViewDate;
12227-
struct String* storeOutfitsViewDate;
12228-
struct String* storeVisorsViewDate;
12229-
struct String* storePetsViewDate;
12230-
struct String* storeNameplatesViewDate;
12231-
struct String* storeCosmicubeViewDate;
12232-
int32_t accountLoginStatus;
12233-
bool hasLoggedIn;
12234-
bool isGuest;
12235-
struct String* guardianEmail;
12236-
struct String* epicAccountId;
12237-
bool deleteDeviceIDFailed;
12238-
struct String* dobInfo;
12239-
struct String* birthDateSetDate;
12240-
int32_t birthDateDay;
12241-
int32_t birthDateMonth;
12242-
int32_t birthDateYear;
12243-
uint32_t playerLevel;
12244-
uint32_t playerXp;
12245-
uint32_t playerXpRequiredForNextLevel;
12246-
struct Announcement lastAnnounce;
12247-
void* quickChatFavorites;
12248-
int32_t chatModeType;
12249-
struct GameOptionsData* hostOptionsData;
12250-
struct GameOptionsData* searchOptionsData;
12251-
uint8_t showAdsScreen;
12252-
bool screenshake;
12253-
bool censorChat;
12254-
bool enableFriendsListInvites;
12255-
bool crossplayAllPlatforms;
12256-
bool streamerMode;
12257-
bool colorblindMode;
12258-
uint8_t sfxVolume;
12259-
uint8_t musicVolume;
12260-
bool vsync;
12261-
uint32_t lastLanguage;
12262-
#if defined(_CPLUSPLUS_)
12263-
ControlTypes__Enum touchConfig;
12264-
#else
12265-
int32_t touchConfig;
12266-
#endif
12267-
bool enableMouseMovement;
12268-
float joyStickSize;
12269-
void* purchaseFile;
12270-
};
12271-
12272-
struct SaveManager__Class {
12273-
Il2CppClass_0 _0;
12274-
Il2CppRuntimeInterfaceOffsetPair* interfaceOffsets;
12275-
struct SaveManager__StaticFields* static_fields;
12276-
const Il2CppRGCTXData* rgctx_data;
12277-
Il2CppClass_1 _1;
12278-
struct SaveManager__VTable vtable;
12279-
};
1228012193
#pragma endregion
1228112194

1228212195
#pragma region DestroyableSingleton_1_RoleManager_
@@ -12557,4 +12470,8 @@ struct RoleEffectAnimation__Array {
1255712470
};
1255812471
#pragma endregion
1255912472

12473+
typedef Il2CppObject PlayerData;
12474+
typedef Il2CppObject PlayerCustomizationData;
12475+
typedef Il2CppObject PlayerPurchasesData;
12476+
1256012477
}

framework/il2cpp-helpers.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,21 @@ void output_assembly_methods(const Il2CppAssembly* assembly) {
276276
}
277277
}
278278

279-
class ScopedThreadAttacher
280-
{
281-
public:
282-
ScopedThreadAttacher() : m_AttachedThread(nullptr) {
279+
ScopedThreadAttacher::ScopedThreadAttacher() : m_AttachedThread(nullptr) {
280+
if (il2cpp_thread_current() == nullptr)
283281
m_AttachedThread = il2cpp_thread_attach(il2cpp_domain_get());
284-
}
285-
~ScopedThreadAttacher() {
286-
if (m_AttachedThread)
287-
il2cpp_thread_detach(m_AttachedThread);
288-
}
282+
}
289283

290-
private:
291-
Il2CppThread* m_AttachedThread;
292-
};
284+
ScopedThreadAttacher::~ScopedThreadAttacher() {
285+
detach();
286+
}
287+
288+
void ScopedThreadAttacher::detach() {
289+
if (m_AttachedThread) {
290+
il2cpp_thread_detach(m_AttachedThread);
291+
m_AttachedThread = nullptr;
292+
}
293+
}
293294

294295
bool cctor_finished(Il2CppClass* klass)
295296
{

framework/il2cpp-helpers.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,14 @@ namespace app {
102102
E* _Ptr;
103103
};
104104
}
105-
}
105+
}
106+
107+
class ScopedThreadAttacher {
108+
public:
109+
ScopedThreadAttacher();
110+
~ScopedThreadAttacher();
111+
112+
void detach();
113+
private:
114+
Il2CppThread* m_AttachedThread;
115+
};

gui/esp.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static ImVec2 WorldToScreen(Vector2 pos)
5050
return value;
5151
}
5252

53-
struct PlayerData
53+
struct EspPlayerData
5454
{
5555
ImVec2 Position = { 0.0f, 0.0f };
5656
ImVec4 Color{ 0.0f, 0.0f, 0.0f, 0.0f };
@@ -67,7 +67,7 @@ typedef struct Drawing
6767
{
6868
std::mutex m_DrawingMutex;
6969

70-
std::array<PlayerData, Game::MAX_PLAYERS> m_Players;
70+
std::array<EspPlayerData, Game::MAX_PLAYERS> m_Players;
7171

7272
ImVec2 LocalPosition{ 0.0f, 0.0f };
7373
} drawing_t;

hooks/AirshipStatus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void dAirshipStatus_OnEnable(AirshipStatus* __this, MethodInfo* method)
2828

2929
State.mapType = Settings::MapType::Airship;
3030

31-
State.userName = convert_from_string(SaveManager__TypeInfo->static_fields->lastPlayerName);
31+
State.userName = GetPlayerName();
3232
ResetOriginalAppearance();
3333
}
3434

hooks/Chat.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,5 @@ void dChatBubble_SetName(ChatBubble* __this, String* playerName, bool isDead, bo
5151

5252
void dChatController_Update(ChatController* __this, MethodInfo* method)
5353
{
54-
//SaveManager__TypeInfo->static_fields->chatModeType = (int32_t)QuickChatModes__Enum::FreeChatOrQuickChat;
55-
SaveManager__TypeInfo->static_fields->isGuest = false;
5654
ChatController_Update(__this, method);
5755
}

hooks/EOSManager.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ void dEOSManager_InitializePlatformInterface(EOSManager* __this, MethodInfo* met
2626
bool dEOSManager_IsFreechatAllowed(EOSManager* __this, MethodInfo* method)
2727
{
2828
return app::EOSManager_IsFreechatAllowed(__this, method);
29-
//SaveManager__TypeInfo->static_fields->chatModeType = (uint32_t)QuickChatModes__Enum::FreeChatOrQuickChat;
30-
//return true;
3129
}
3230

3331
void dEOSManager_UpdatePermissionKeys(EOSManager* __this, void* callback, MethodInfo* method) {

hooks/InnerNetClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ void dInnerNetClient_Update(InnerNetClient* __this, MethodInfo* method)
110110
static int nameChangeCycleDelay = 0; //If we spam too many name changes, we're banned
111111

112112
if (nameChangeCycleDelay <= 0 && !State.activeImpersonation) {
113-
if ((convert_from_string(SaveManager__TypeInfo->static_fields->lastPlayerName) != State.userName) && !State.userName.empty()) {
114-
SaveManager__TypeInfo->static_fields->lastPlayerName = convert_to_string(State.userName);
113+
if ((GetPlayerName() != State.userName) && !State.userName.empty()) {
114+
SetPlayerName(State.userName);
115115
LOG_INFO("Name mismatch, setting name to \"" + State.userName + "\"");
116116
if (IsInGame())
117117
State.rpcQueue.push(new RpcSetName(State.userName));

0 commit comments

Comments
 (0)