diff --git a/appdata/il2cpp-types.h b/appdata/il2cpp-types.h index b4a45a8..c14010d 100644 --- a/appdata/il2cpp-types.h +++ b/appdata/il2cpp-types.h @@ -1,4 +1,4 @@ -// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty +// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty // Target Unity version: 2021.2.0 - 2021.2.99 #if defined(_GHIDRA_) || defined(_IDA_) @@ -84572,6 +84572,18 @@ struct Vector3 { float x; float y; float z; + + app::Vector3 operator+(const app::Vector3& other) const { + return { x + other.x, y + other.y, z + other.z }; + } + + app::Vector3 operator*(float scalar) const { + return { x * scalar, y * scalar, z * scalar }; + } + + app::Vector3 operator-(const app::Vector3& other) const { + return { x - other.x, y - other.y, z - other.z }; + } }; struct Vector3__Boxed { diff --git a/lib/UnityCore.cpp b/lib/UnityCore.cpp index 2295412..05fb2eb 100644 --- a/lib/UnityCore.cpp +++ b/lib/UnityCore.cpp @@ -1,6 +1,7 @@ #include "pch-il2cpp.h" #include "UnityCore.h" +#include app::Component* Unity::GameObject::GetComponentByName(app::GameObject* go, const char* type) { @@ -16,3 +17,47 @@ app::Component* Unity::GameObject::GetComponentByName(app::GameObject* go, const return nullptr; } + +std::string Unity::Math::Vector3::ToString(app::Vector3* v) +{ + app::String* str = app::Vector3_ToString(v, nullptr); + + if (str == NULL) { + return std::string("NULL"); + } + + return il2cppi_to_string(str); +} + +std::string Unity::Math::Vector3::ToString(app::Vector3 v) +{ + return ("x: " + std::to_string(v.x) + " y: " + std::to_string(v.y) + " z: " + std::to_string(v.z)); +} + + +app::Transform* Unity::Transform::Get(app::GameObject* go) +{ + if (go != nullptr) { + if (app::GameObject_get_transform != nullptr) { + + app::Transform* __transform = app::GameObject_get_transform(go, nullptr); + + if (__transform) { + return __transform; + } + } + } + + return nullptr; +} + +app::Vector3 Unity::Transform::Position(app::Transform* transform) +{ + if (transform != nullptr) { + if (app::Transform_get_position != nullptr) { + return app::Transform_get_position(transform, nullptr); + } + } + + return app::Vector3(); +} diff --git a/lib/UnityCore.h b/lib/UnityCore.h index 5eba9ec..69eb5fd 100644 --- a/lib/UnityCore.h +++ b/lib/UnityCore.h @@ -2,12 +2,25 @@ #include "Wrapper.h" #include +#include namespace Unity { namespace GameObject { // DO_APP_FUNC(0x02D34DA0, Component *, GameObject_GetComponentByName, (GameObject * __this, String * type, MethodInfo * method)); app::Component* GetComponentByName(app::GameObject* go, const char* type); } + + namespace Math{ + namespace Vector3 { + std::string ToString(app::Vector3* v); + std::string ToString(app::Vector3 v); + } + } + + namespace Transform{ + app::Transform* Get(app::GameObject* go); + app::Vector3 Position(app::Transform* transform); + } } namespace UnityCore { diff --git a/user/features/menu.cpp b/user/features/menu.cpp index 6c85a1c..6eb9de0 100644 --- a/user/features/menu.cpp +++ b/user/features/menu.cpp @@ -277,9 +277,10 @@ void DrawMiscTab() { /* if (ImGui::Button("Unlock Achievements")) { - //Unlock Achievements + Misc::CustomizedLobby(); } + if (ImGui::Button("TP Keys")) { //Misc::TPKeys(); } @@ -289,13 +290,17 @@ void DrawMiscTab() { ImGui::Checkbox("Change server name", &settings::server_name_spoof); ImGui::InputText("New name##server", &settings::server_name); + */ ImGui::Checkbox("Fly", &settings::fly); + ImGui::SliderFloat("Speed: ", &settings::fly_speed, 1.f, 10.f); + /* if (ImGui::Button("Make random noise")) { //Misc::PlayRandomSound(); } + ImGui::Checkbox("Walk in lobby", &settings::walk_in_lobby); ImGui::Checkbox("Auto respawn", &settings::auto_respawn); diff --git a/user/features/misc/misc.cpp b/user/features/misc/misc.cpp index 8ced730..09386fa 100644 --- a/user/features/misc/misc.cpp +++ b/user/features/misc/misc.cpp @@ -1,4 +1,4 @@ -#include "pch-il2cpp.h" +#include "pch-il2cpp.h" #include "Misc.h" #include "Wrapper.h" @@ -138,9 +138,80 @@ void Misc::InstantWin() } } +// This function has not been tested +// This function has not been tested +// This function has not been tested +void Misc::Fly(float speed) { + auto localPlayer = Player::GetLocalPlayer(); + + if (localPlayer == nullptr) return; + + auto nb = Player::GetNolan(); + app::Transform* _transform = Unity::Transform::Get(localPlayer); + + if (_transform) { + app::Vector3 pos = Unity::Transform::Position(_transform); + + if (GetAsyncKeyState('W') & 0x8000) { + pos = pos + (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('S') & 0x8000) { + pos = pos - (app::Transform_get_forward(_transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('D') & 0x8000) { + pos = pos + (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState('A') & 0x8000) { + pos = pos - (app::Transform_get_right(_transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState(VK_SPACE) & 0x8000) { + pos = pos + (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime()); + } + if (GetAsyncKeyState(VK_LCONTROL) & 0x8000) { + pos = pos - (app::Transform_get_up(_transform, nullptr) * speed * Time_DeltaTime()); + } + + auto component = Unity::GameObject::GetComponentByName(localPlayer, "UltimateCharacterLocomotion"); + + if (component) { + app::UltimateCharacterLocomotion* locomotion = reinterpret_cast(component); + + if (locomotion) { + if (app::UltimateCharacterLocomotion_SetPosition_1 == nullptr) return; + + app::UltimateCharacterLocomotion_SetPosition_1(locomotion, pos, false, nullptr); + } + } + } +} + void Misc::CustomizedLobby() { + +} +// This function has not been tested +// This function has not been tested +// This function has not been tested +void Misc::SpawnPrefab(app::PrefabId id) { + if (il2cppi_is_initialized(app::BoltPrefabs__TypeInfo)) { + app::PrefabId pGate = (*app::BoltPrefabs__TypeInfo)->static_fields->ManorGate; + + app::Quaternion rotation = app::Quaternion_get_identity(NULL); + + auto localPlayer = Player::GetLocalPlayer(); + + if (localPlayer) { + app::Transform* _transform = Unity::Transform::Get(localPlayer); + if (_transform == nullptr) return; + + app::Vector3 pos = Unity::Transform::Position(_transform); + + // CRASH???????????????? + app::BoltNetwork_Instantiate_6(pGate, pos, rotation, NULL); + } + + } } void Misc::RankSpoofer(int value) { @@ -182,9 +253,6 @@ void Misc::FullBright() } } -void Misc::Fly() { - -} void Misc::Revive(bool self) { diff --git a/user/features/misc/misc.h b/user/features/misc/misc.h index 85723b0..5bc27cf 100644 --- a/user/features/misc/misc.h +++ b/user/features/misc/misc.h @@ -9,9 +9,10 @@ namespace Misc { void CarryItem(const char* itemName); void CarryAnimal(const char* animalName); void InstantWin(); + void Fly(float speed); void CustomizedLobby(); + void SpawnPrefab(app::PrefabId id); void FullBright(); - void Fly(); void Revive(bool self); void GetKeys(); void Jumpscare(); diff --git a/user/main.cpp b/user/main.cpp index 438fee7..a5afb47 100644 --- a/user/main.cpp +++ b/user/main.cpp @@ -113,6 +113,9 @@ void Run() if (settings::fullBright) Misc::FullBright(); + if (settings::fly) + Misc::Fly(settings::fly_speed); + std::this_thread::sleep_for(std::chrono::milliseconds(400)); } CreateThread(0, 0, EjectThread, 0, 0, 0); diff --git a/user/settings/settings.cpp b/user/settings/settings.cpp index 3228cde..e2f2674 100644 --- a/user/settings/settings.cpp +++ b/user/settings/settings.cpp @@ -35,6 +35,7 @@ namespace settings { bool server_name_spoof = false; std::string server_name = "Jadis0x"; bool fly = false; + float fly_speed = 1.f; bool unlock_all = true; bool exp_modifier = false; int new_exp = 2000; diff --git a/user/settings/settings.hpp b/user/settings/settings.hpp index 1c71c85..1baf0f5 100644 --- a/user/settings/settings.hpp +++ b/user/settings/settings.hpp @@ -39,6 +39,7 @@ namespace settings { extern bool server_name_spoof; extern std::string server_name; extern bool fly; + extern float fly_speed; extern bool unlock_all; extern bool exp_modifier; extern int new_exp;