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

Commit

Permalink
properly unlocks all cosmetics now
Browse files Browse the repository at this point in the history
  • Loading branch information
v0idp committed Nov 22, 2021
1 parent 9c1b355 commit 03a50fc
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 14 deletions.
77 changes: 77 additions & 0 deletions appdata/il2cpp-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10065,6 +10065,83 @@ namespace app
};
#pragma endregion

#pragma region NamePlateData
struct NamePlateData__Fields {
struct CosmeticData__Fields _;
void* Image;
bool Free;
int32_t Order;
bool NotInStore;
};

struct NamePlateData {
void* klass;
MonitorData* monitor;
struct NamePlateData__Fields fields;
};
#pragma endregion

#pragma region VisorData
struct VisorData__Fields {
struct CosmeticData__Fields _;
void* IdleFrame;
void* LeftIdleFrame;
void* ClimbFrame;
void* FloorFrame;
int32_t Order;
bool Free;
bool NotInStore;
};

struct VisorData {
void* klass;
MonitorData* monitor;
struct VisorData__Fields fields;
};
#pragma endregion

#pragma region PetData
struct PetBehaviour__Fields {
struct MonoBehaviour__Fields _;
struct PetData* Data;
struct PlayerControl* Source;
float YOffset;
void* animator;
void* rend;
void* shadowRend;
void* body;
struct Collider2D* Collider;
void* idleClip;
void* sadClip;
void* scaredClip;
void* walkClip;
};

struct PetBehaviour {
void* klass;
MonitorData* monitor;
struct PetBehaviour__Fields fields;
};

struct PetData__Fields {
struct CosmeticData__Fields _;
bool Free;
bool NotInStore;
#if defined(_CPLUSPLUS_)
StringNames__Enum StoreName;
#else
int32_t StoreName;
#endif
struct PetBehaviour* PetPrefab;
};

struct PetData {
void* klass;
MonitorData* monitor;
struct PetData__Fields fields;
};
#pragma endregion

#pragma region List_1_PetData_
struct __declspec(align(4)) List_1_PetData___Fields {
struct PetData__Array* _items;
Expand Down
20 changes: 14 additions & 6 deletions hooks/HatManager.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#include "pch-il2cpp.h"
#include "_hooks.h"

HatBehaviour__Array* dHatManager_GetUnlockedHats(HatManager* __this, MethodInfo* method) {
return __this->fields.AllHats->fields._items;
bool dHatManager_c__GetUnlockedHats_b__11_0(HatManager_c* __this, HatBehaviour* h, MethodInfo* method) {
return true;
}

PetData__Array* dHatManager_GetUnlockedPets(HatManager* __this, MethodInfo* method) {
return __this->fields.AllPets->fields._items;
bool dHatManager_c__GetUnlockedSkins_b__12_0(HatManager_c* __this, SkinData* s, MethodInfo* method) {
return true;
}

SkinData__Array* dHatManager_GetUnlockedSkins(HatManager* __this, MethodInfo* method) {
return __this->fields.AllSkins->fields._items;
bool dHatManager_c__GetUnlockedPets_b__9_0(HatManager_c* __this, PetData* h, MethodInfo* method) {
return true;
}

bool dHatManager_c__GetUnlockedVisors_b__15_0(HatManager_c* __this, VisorData* s, MethodInfo* method) {
return true;
}

bool dHatManager_c__GetUnlockedNamePlates_b__17_0(HatManager_c* __this, NamePlateData* s, MethodInfo* method) {
return true;
}
38 changes: 32 additions & 6 deletions hooks/_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
#include "main.h"
#include "SignatureScan.hpp"

typedef bool HATMANAGER_C_GETUNLOCKEDHATS(HatManager_c* __this, HatBehaviour* h, MethodInfo* method);
typedef bool HATMANAGER_C_GETUNLOCKEDSKINS(HatManager_c* __this, SkinData* s, MethodInfo* method);
typedef bool HATMANAGER_C_GETUNLOCKEDPETS(HatManager_c* __this, PetData* h, MethodInfo* method);
typedef bool HATMANAGER_C_GETUNLOCKEDVISORS(HatManager_c* __this, VisorData* s, MethodInfo* method);
typedef bool HATMANAGER_C_GETUNLOCKEDNAMEPLATES(HatManager_c* __this, NamePlateData* s, MethodInfo* method);

HATMANAGER_C_GETUNLOCKEDHATS* HatManager_c__GetUnlockedHats_b__11_0 = nullptr;
HATMANAGER_C_GETUNLOCKEDSKINS* HatManager_c__GetUnlockedSkins_b__12_0 = nullptr;
HATMANAGER_C_GETUNLOCKEDPETS* HatManager_c__GetUnlockedPets_b__9_0 = nullptr;
HATMANAGER_C_GETUNLOCKEDVISORS* HatManager_c__GetUnlockedVisors_b__15_0 = nullptr;
HATMANAGER_C_GETUNLOCKEDNAMEPLATES* HatManager_c__GetUnlockedNamePlates_b__17_0 = nullptr;

bool HookFunction(PVOID* ppPointer, PVOID pDetour, const char* functionName) {
if (DetourAttach(ppPointer, pDetour) != 0) {
std::cout << "Failed to hook " << functionName << std::endl;
Expand Down Expand Up @@ -53,10 +65,22 @@ void DetourInitilization() {
}
}

HatManager_c__GetUnlockedHats_b__11_0 = SignatureScan<HATMANAGER_C_GETUNLOCKEDHATS*>("55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 50 00", GetModuleHandleA("GameAssembly.dll"));
HOOKFUNC(HatManager_c__GetUnlockedHats_b__11_0);

HatManager_c__GetUnlockedSkins_b__12_0 = SignatureScan<HATMANAGER_C_GETUNLOCKEDSKINS*>("55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 42 80 B8 ? ? ? ? ?", GetModuleHandleA("GameAssembly.dll"));
HOOKFUNC(HatManager_c__GetUnlockedSkins_b__12_0);

HatManager_c__GetUnlockedPets_b__9_0= SignatureScan<HATMANAGER_C_GETUNLOCKEDPETS*>("55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 2C 00", GetModuleHandleA("GameAssembly.dll"));
HOOKFUNC(HatManager_c__GetUnlockedPets_b__9_0);

HatManager_c__GetUnlockedVisors_b__15_0 = SignatureScan<HATMANAGER_C_GETUNLOCKEDVISORS*>("55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 40 00", GetModuleHandleA("GameAssembly.dll"));
HOOKFUNC(HatManager_c__GetUnlockedVisors_b__15_0);

HatManager_c__GetUnlockedNamePlates_b__17_0 = SignatureScan<HATMANAGER_C_GETUNLOCKEDNAMEPLATES*>("55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 30 00", GetModuleHandleA("GameAssembly.dll"));
HOOKFUNC(HatManager_c__GetUnlockedNamePlates_b__17_0);

HOOKFUNC(SceneManager_Internal_ActiveSceneChanged);
HOOKFUNC(HatManager_GetUnlockedHats);
HOOKFUNC(HatManager_GetUnlockedPets);
HOOKFUNC(HatManager_GetUnlockedSkins);
HOOKFUNC(PlayerControl_FixedUpdate);
HOOKFUNC(PlayerControl_RpcSyncSettings);
HOOKFUNC(MeetingHud_Update);
Expand Down Expand Up @@ -126,9 +150,11 @@ void DetourUninitialization()
DetourUpdateThread(GetCurrentThread());
UNHOOKFUNC(GameObject_SetActive);
UNHOOKFUNC(SceneManager_Internal_ActiveSceneChanged);
UNHOOKFUNC(HatManager_GetUnlockedHats);
UNHOOKFUNC(HatManager_GetUnlockedPets);
UNHOOKFUNC(HatManager_GetUnlockedSkins);
UNHOOKFUNC(HatManager_c__GetUnlockedHats_b__11_0);
UNHOOKFUNC(HatManager_c__GetUnlockedSkins_b__12_0);
UNHOOKFUNC(HatManager_c__GetUnlockedPets_b__9_0);
UNHOOKFUNC(HatManager_c__GetUnlockedVisors_b__15_0);
UNHOOKFUNC(HatManager_c__GetUnlockedNamePlates_b__17_0);
UNHOOKFUNC(PlayerControl_FixedUpdate);
UNHOOKFUNC(PlayerControl_RpcSyncSettings);
UNHOOKFUNC(MeetingHud_Update);
Expand Down
17 changes: 16 additions & 1 deletion hooks/_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,19 @@ void dEOSManager_ReallyBeginFlow(EOSManager* __this, MethodInfo* method);
bool dEOSManager_IsFreechatAllowed(EOSManager* __this, MethodInfo* method);
void dChatController_Update(ChatController* __this, MethodInfo* method);
void dInnerNetClient_EnqueueDisconnect(InnerNetClient* __this, DisconnectReasons__Enum reason, String* stringReason, MethodInfo* method);
void dRoleManager_AssignRolesFromList(List_1_GameData_PlayerInfo_* players, int32_t teamMax, List_1_RoleTypes_* roleList, int32_t* rolesAssigned, MethodInfo* method);
void dRoleManager_AssignRolesFromList(List_1_GameData_PlayerInfo_* players, int32_t teamMax, List_1_RoleTypes_* roleList, int32_t* rolesAssigned, MethodInfo* method);

// 55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 50 00
bool dHatManager_c__GetUnlockedHats_b__11_0(HatManager_c* __this, HatBehaviour* h, MethodInfo* method);

// 55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 42 80 B8 ? ? ? ? ?
bool dHatManager_c__GetUnlockedSkins_b__12_0(HatManager_c* __this, SkinData* s, MethodInfo* method);

// 55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 2C 00
bool dHatManager_c__GetUnlockedPets_b__9_0(HatManager_c* __this, PetData* h, MethodInfo* method);

// 55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 40 00
bool dHatManager_c__GetUnlockedVisors_b__15_0(HatManager_c* __this, VisorData* s, MethodInfo* method);

// 55 8B EC 80 3D ? ? ? ? ? 75 14 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C6 05 ? ? ? ? ? 8B 45 0C 85 C0 74 3F 80 78 30 00
bool dHatManager_c__GetUnlockedNamePlates_b__17_0(HatManager_c* __this, NamePlateData* s, MethodInfo* method);
2 changes: 1 addition & 1 deletion user/gitparams.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define GIT_CUR_COMMIT e22fe71ce90ee66eaa1db5214991f244b3962409
#define GIT_CUR_COMMIT 9c1b3553fa9d5ce5471b61c88699736db773ed77
#define GIT_BRANCH 2021.11.9.5e

0 comments on commit 03a50fc

Please sign in to comment.