From 452af13d991bbe385b59f267496a4dfb4b793f31 Mon Sep 17 00:00:00 2001 From: Taiga <67109235+Taiga74164@users.noreply.github.com> Date: Sun, 3 Jul 2022 09:05:39 -0600 Subject: [PATCH] Added set UID size & position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set size found by @lunaticwhat with melon 🍉 Co-Authored-By: lunatic <56441863+lunaticwhat@users.noreply.github.com> --- cheat-library/src/appdata/il2cpp-functions.h | 10 ++++++++ cheat-library/src/appdata/il2cpp-types.h | 23 +++++++++++++++++++ .../src/user/cheat/visuals/ProfileChanger.cpp | 18 +++++++++++++++ .../src/user/cheat/visuals/ProfileChanger.h | 3 +++ 4 files changed, 54 insertions(+) diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index a69ab18..eeefcb1 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -169,8 +169,11 @@ DO_APP_FUNC(0x0652EA10, Component_1*, Component_1_GetComponent_1, (Component_1* DO_APP_FUNC(0x0662F520, void, GameObject_SetActive, (GameObject* __this, bool value, MethodInfo* method)); DO_APP_FUNC(0x0662F100, GameObject*, GameObject_CreatePrimitive, (PrimitiveType__Enum type, MethodInfo* method)); DO_APP_FUNC(0x0662F700, Transform*, GameObject_get_transform, (GameObject* __this, MethodInfo* method)); +DO_APP_FUNC(0x06555A60, Quaternion, Transform_get_localRotation, (Transform* __this, MethodInfo* method)); DO_APP_FUNC(0x06555EF0, void, Transform_set_localRotation, (Transform* __this, Quaternion value, MethodInfo* method)); +DO_APP_FUNC(0x06555AA0, Vector3, Transform_get_localScale, (Transform* __this, MethodInfo* method)); DO_APP_FUNC(0x065548E0, void, Transform_set_localScale, (Transform* __this, Vector3 value, MethodInfo* method)); +DO_APP_FUNC(0x06555A20, Vector3, Transform_get_localPosition, (Transform* __this, MethodInfo* method)); DO_APP_FUNC(0x06555EE0, void, Transform_set_localPosition, (Transform* __this, Vector3 value, MethodInfo* method)); DO_APP_FUNC(0x0662F090, Component_1*, GameObject_AddComponentInternal, (GameObject* __this, String* className, MethodInfo* method)); DO_APP_FUNC(0x0662F0A0, Component_1*, GameObject_AddComponent, (GameObject* __this, Type* componentType, MethodInfo* method)); @@ -207,6 +210,13 @@ DO_APP_FUNC(0x0658D5E0, void, Slider_1_set_minValue, (Slider_1* __this, float va DO_APP_FUNC(0x065F6470, Rect, Sprite_get_rect, (Sprite* __this, MethodInfo* method)); DO_APP_FUNC(0x0667D6A0, Texture2D*, NativeGallery_LoadImageAtPath, (String* imagePath, int32_t maxSize, bool markTextureNonReadable, bool generateMipmaps, bool linearColorSpace, MethodInfo* method)); DO_APP_FUNC(0x065F6270, Sprite*, Sprite_Create, (Texture2D* texture, Rect rect, Vector2 pivot, float pixelsPerUnit, MethodInfo* method)); +DO_APP_FUNC(0x06567B70, void, Text_set_alignment, (Text* __this, TextAnchor__Enum value, MethodInfo* method)); +DO_APP_FUNC(0x06567E10, void, Text_set_horizontalOverflow, (Text* __this, HorizontalWrapMode__Enum value, MethodInfo* method)); +DO_APP_FUNC(0x06568110, void, Text_set_verticalOverflow, (Text* __this, VerticalWrapMode__Enum value, MethodInfo* method)); +DO_APP_FUNC(0x06567A80, bool, Text_get_resizeTextForBestFit, (Text* __this, MethodInfo* method)); +DO_APP_FUNC(0x06567EE0, void, Text_set_resizeTextForBestFit, (Text* __this, bool value, MethodInfo* method)); +DO_APP_FUNC(0x06567450, int32_t, Text_get_fontSize, (Text* __this, MethodInfo* method)); +DO_APP_FUNC(0x06567CC0, void, Text_set_fontSize, (Text* __this, int32_t value, MethodInfo* method)); DO_APP_FUNC(0x036865D0, float, Miscs_CalcCurrentGroundWaterHeight, (float x, float z, MethodInfo* method)); DO_APP_FUNC(0x03685E00, float, Miscs_CalcCurrentGroundHeight, (float x, float z, MethodInfo* method)); diff --git a/cheat-library/src/appdata/il2cpp-types.h b/cheat-library/src/appdata/il2cpp-types.h index 0239083..fd5b020 100644 --- a/cheat-library/src/appdata/il2cpp-types.h +++ b/cheat-library/src/appdata/il2cpp-types.h @@ -11935,6 +11935,29 @@ namespace app { struct Material* vector[32]; }; + enum class TextAnchor__Enum : int32_t { + UpperLeft = 0x00000000, + UpperCenter = 0x00000001, + UpperRight = 0x00000002, + MiddleLeft = 0x00000003, + MiddleCenter = 0x00000004, + MiddleRight = 0x00000005, + LowerLeft = 0x00000006, + LowerCenter = 0x00000007, + LowerRight = 0x00000008, + }; + + enum class HorizontalWrapMode__Enum : int32_t { + Wrap = 0x00000000, + Overflow = 0x00000001, + }; + + enum class VerticalWrapMode__Enum : int32_t { + Truncate = 0x00000000, + Overflow = 0x00000001, + }; + + #if !defined(_GHIDRA_) && !defined(_IDA_) } #endif diff --git a/cheat-library/src/user/cheat/visuals/ProfileChanger.cpp b/cheat-library/src/user/cheat/visuals/ProfileChanger.cpp index 3292b04..a427750 100644 --- a/cheat-library/src/user/cheat/visuals/ProfileChanger.cpp +++ b/cheat-library/src/user/cheat/visuals/ProfileChanger.cpp @@ -34,6 +34,9 @@ namespace cheat::feature NF(f_Enabled, "Custom Profile", "Visuals::ProfileChanger", false), NF(f_UID, "UID", "Visuals::ProfileChanger", false), NF(f_UIDWaterMarkPrefix, "UIDWaterMarkPrefix", "Visuals::ProfileChanger", false), + NF(f_UIDsize, "UID Scale", "Visuals::ProfileChanger", 14), + NF(f_UIDpos_x, "UID Pos X", "Visuals::ProfileChanger", 1190), + NF(f_UIDpos_y, "UID Pos Y", "Visuals::ProfileChanger", 0), NF(f_NickName, "NickName", "Visuals::ProfileChanger", false), NF(f_Level, "Level", "Visuals::ProfileChanger", false), NF(f_Exp, "Exp", "Visuals::ProfileChanger", false), @@ -62,6 +65,9 @@ namespace cheat::feature ConfigWidget(f_Enabled, "Custom Profile."); ConfigWidget(f_UID, "Changes the uid visually."); ConfigWidget("Append \"UID:\" prefix on the water-mark", f_UIDWaterMarkPrefix); + ConfigWidget("UID size", f_UIDsize, 0.1, 14, 500.0, "Set UID size"); + ConfigWidget("UID Pos X", f_UIDpos_x, 1.f, 1.f, 1920.f, "Set UID position X"); + ConfigWidget("UID Pos y", f_UIDpos_y, 1.f, 0, 1080.f, "Set UID position y"); ConfigWidget(f_NickName, "Changes the nickname visually."); ConfigWidget(f_Level, "Changes the level visually."); ConfigWidget(f_Exp, "Changes the exp visually."); @@ -116,6 +122,18 @@ namespace cheat::feature if (Components::WaterMark != nullptr) app::Text_set_text(reinterpret_cast(Components::WaterMark), string_to_il2cppi(f_UID.value().value.empty() ? "" : std::string((f_UIDWaterMarkPrefix ? "UID: " : "") + f_UID.value().value)), nullptr); + + auto transformWatermark = app::GameObject_get_transform(GameObject::WaterMark, nullptr); + if (transformWatermark) + { + app::Vector3 uidPos = { f_UIDpos_x, f_UIDpos_y, 0 }; + app::Text_set_alignment(reinterpret_cast(Components::WaterMark), app::TextAnchor__Enum::LowerRight, nullptr); + app::Text_set_horizontalOverflow(reinterpret_cast(Components::WaterMark), app::HorizontalWrapMode__Enum::Overflow, nullptr); + app::Text_set_verticalOverflow(reinterpret_cast(Components::WaterMark), app::VerticalWrapMode__Enum::Overflow, nullptr); + app::Text_set_resizeTextForBestFit(reinterpret_cast(Components::WaterMark), false, nullptr); + app::Text_set_fontSize(reinterpret_cast(Components::WaterMark), f_UIDsize, nullptr); + app::Transform_set_position(transformWatermark, uidPos, nullptr); + } } nextUpdate = currentTime + (int)f_DelayUpdate; diff --git a/cheat-library/src/user/cheat/visuals/ProfileChanger.h b/cheat-library/src/user/cheat/visuals/ProfileChanger.h index facd1f4..b75d24c 100644 --- a/cheat-library/src/user/cheat/visuals/ProfileChanger.h +++ b/cheat-library/src/user/cheat/visuals/ProfileChanger.h @@ -11,6 +11,9 @@ namespace cheat::feature config::Field> f_Enabled; config::Field> f_UID; config::Field f_UIDWaterMarkPrefix; + config::Field f_UIDsize; + config::Field f_UIDpos_x; + config::Field f_UIDpos_y; config::Field> f_NickName; config::Field> f_Level; config::Field> f_Exp;