From 9596af580e8117d8b75fb7c8610abc6410f6d628 Mon Sep 17 00:00:00 2001 From: Miya Date: Thu, 25 Aug 2022 12:16:29 +0800 Subject: [PATCH] add open team immediately open team without waiting --- cheat-library/cheat-library.vcxproj | 2 + cheat-library/cheat-library.vcxproj.filters | 6 +++ cheat-library/src/appdata/il2cpp-functions.h | 4 ++ cheat-library/src/appdata/il2cpp-types.h | 14 +++++ cheat-library/src/user/cheat/cheat.cpp | 2 + .../user/cheat/world/OpenTeamImmediately.cpp | 52 +++++++++++++++++++ .../user/cheat/world/OpenTeamImmediately.h | 24 +++++++++ 7 files changed, 104 insertions(+) create mode 100644 cheat-library/src/user/cheat/world/OpenTeamImmediately.cpp create mode 100644 cheat-library/src/user/cheat/world/OpenTeamImmediately.h diff --git a/cheat-library/cheat-library.vcxproj b/cheat-library/cheat-library.vcxproj index 2ad8cae..21e443c 100644 --- a/cheat-library/cheat-library.vcxproj +++ b/cheat-library/cheat-library.vcxproj @@ -102,6 +102,7 @@ + @@ -194,6 +195,7 @@ + diff --git a/cheat-library/cheat-library.vcxproj.filters b/cheat-library/cheat-library.vcxproj.filters index 4e297a7..d10f161 100644 --- a/cheat-library/cheat-library.vcxproj.filters +++ b/cheat-library/cheat-library.vcxproj.filters @@ -261,6 +261,9 @@ Header Files + + Header Files + @@ -480,6 +483,9 @@ Source Files + + Source Files + diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index a9c51d3..69c5738 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -358,6 +358,10 @@ DO_APP_FUNC(0x05C8B870, float, Canvas_get_scaleFactor, (/*Canvas**/void* __this, DO_APP_FUNC(0x03066EB0, void, LevelTimeManager_SetInternalTimeOfDay, (/*LevelTimeManager**/void* __this, float inHours, bool force, bool refreshEnviroTime, MethodInfo* method)); +// Open team immediately +// F3 0F 10 83 ?? ?? ?? ?? 0F 29 74 24 30 F3 0F 10 B3 ?? ?? ?? ?? +DO_APP_FUNC(0x01387C20, bool, MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext, (InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method)); + // Singletons DO_APP_FUNC(0x061A8830, void*, Singleton_GetInstance, (MethodInfo* method)); diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index a928806..2cb7dc2 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -10544,6 +10544,20 @@ namespace app { struct IGKEDHHIDMA__Fields fields; }; + struct __declspec(align(8)) InLevelMainPageContext_DoTeamCountDown_Iterator__Fields + { + int32_t HGCHJINEMCM; + struct Object* KOBKOALABHL; + struct InLevelMainPageContext* _levelMainPageContext; + }; + + struct InLevelMainPageContext_DoTeamCountDown_Iterator + { + struct InLevelMainPageContext_DoTeamCountDown_Iterator__Class* klass; + MonitorData* monitor; + struct InLevelMainPageContext_DoTeamCountDown_Iterator__Fields fields; + }; + struct MonoMiniMap__Fields { struct MonoBehaviour__Fields _; struct Button* _actionButton; diff --git a/cheat-library/src/user/cheat/cheat.cpp b/cheat-library/src/user/cheat/cheat.cpp index 58f6614..4c1adfd 100644 --- a/cheat-library/src/user/cheat/cheat.cpp +++ b/cheat-library/src/user/cheat/cheat.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,7 @@ namespace cheat FEAT_INST(AutoTreeFarm), FEAT_INST(AutoDestroy), FEAT_INST(AutoSeelie), + FEAT_INST(OpenTeamImmediately), FEAT_INST(VacuumLoot), FEAT_INST(DialogSkip), FEAT_INST(DumbEnemies), diff --git a/cheat-library/src/user/cheat/world/OpenTeamImmediately.cpp b/cheat-library/src/user/cheat/world/OpenTeamImmediately.cpp new file mode 100644 index 0000000..e66e52f --- /dev/null +++ b/cheat-library/src/user/cheat/world/OpenTeamImmediately.cpp @@ -0,0 +1,52 @@ +#include "pch-il2cpp.h" +#include "OpenTeamImmediately.h" + +#include + +namespace cheat::feature +{ + static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method); + + OpenTeamImmediately::OpenTeamImmediately() : Feature(), + NF(f_Enabled, "Enable Open Team Immediately", "Open Team", false) + { + HookManager::install(app::MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext, MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook); + } + + const FeatureGUIInfo& OpenTeamImmediately::GetGUIInfo() const + { + static const FeatureGUIInfo info{ "", "World", false }; + return info; + } + + void OpenTeamImmediately::DrawMain() + { + ConfigWidget("Open Team Immediately", f_Enabled, "Open team immediately without waiting for count down."); + } + + bool OpenTeamImmediately::NeedStatusDraw() const + { + return f_Enabled; + } + + void OpenTeamImmediately::DrawStatus() + { + ImGui::Text("OpenTeamImmediately"); + } + + OpenTeamImmediately& OpenTeamImmediately::GetInstance() + { + static OpenTeamImmediately instance; + return instance; + } + + static bool MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook(app::InLevelMainPageContext_DoTeamCountDown_Iterator* __this, MethodInfo* method) + { + auto& openTeamImmediately = OpenTeamImmediately::GetInstance(); + if (openTeamImmediately.f_Enabled) + { + __this->fields._levelMainPageContext->fields._countDownTime = __this->fields._levelMainPageContext->fields.EnterCountDown + 1.f; + } + return CALL_ORIGIN(MoleMole_InLevelMainPageContext_DoTeamCountDown_c_Iterator0__MoveNext_Hook, __this, method); + } +} \ No newline at end of file diff --git a/cheat-library/src/user/cheat/world/OpenTeamImmediately.h b/cheat-library/src/user/cheat/world/OpenTeamImmediately.h new file mode 100644 index 0000000..26bfa8f --- /dev/null +++ b/cheat-library/src/user/cheat/world/OpenTeamImmediately.h @@ -0,0 +1,24 @@ +#include +#include + +namespace cheat::feature +{ + + class OpenTeamImmediately : public Feature + { + public: + config::Field> f_Enabled; + + static OpenTeamImmediately& GetInstance(); + + const FeatureGUIInfo& GetGUIInfo() const override; + void DrawMain() override; + + virtual bool NeedStatusDraw() const override; + void DrawStatus() override; + + private: + OpenTeamImmediately(); + }; +} +