code optimization &new helper functions added / modified
- UnityCore namespace changed to UnityEngine - Object class is no longer a template. FindObjectOfType function set to template - Added LogComponents function. It helps us retrieve components from the target gameObject. - Added GetObjectName function to Object structure (same method is available in utils header) - Added ConvertToSystemString function. Converts const char to system.string (app::String)
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<ClCompile Include="include\Minhook\src\hook.cpp" />
|
||||
<ClCompile Include="include\Minhook\src\trampoline.cpp" />
|
||||
<ClCompile Include="lib\ClientHelper.cpp" />
|
||||
<ClCompile Include="lib\UnityCore.cpp" />
|
||||
<ClCompile Include="lib\UnityEngine.cpp" />
|
||||
<ClCompile Include="lib\Wrapper.cpp" />
|
||||
<ClCompile Include="user\features\esp\esp.cpp" />
|
||||
<ClCompile Include="user\features\menu.cpp" />
|
||||
@@ -94,7 +94,7 @@
|
||||
<ClInclude Include="include\Minhook\src\HDE\table64.h" />
|
||||
<ClInclude Include="include\Minhook\src\trampoline.h" />
|
||||
<ClInclude Include="lib\ClientHelper.h" />
|
||||
<ClInclude Include="lib\UnityCore.h" />
|
||||
<ClInclude Include="lib\UnityEngine.h" />
|
||||
<ClInclude Include="lib\Wrapper.h" />
|
||||
<ClInclude Include="user\features\esp\esp.hpp" />
|
||||
<ClInclude Include="user\features\menu.hpp" />
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<ClCompile Include="user\features\misc\misc.cpp">
|
||||
<Filter>user\features\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lib\UnityCore.cpp">
|
||||
<ClCompile Include="lib\UnityEngine.cpp">
|
||||
<Filter>lib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="user\players\players.cpp">
|
||||
@@ -195,7 +195,7 @@
|
||||
<ClInclude Include="include\color.hpp">
|
||||
<Filter>include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lib\UnityCore.h">
|
||||
<ClInclude Include="lib\UnityEngine.h">
|
||||
<Filter>lib</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="user\players\players.h">
|
||||
|
||||
@@ -52,4 +52,12 @@ std::string il2cppi_to_string(Il2CppString* str) {
|
||||
std::string il2cppi_to_string(app::String* str) {
|
||||
return il2cppi_to_string(reinterpret_cast<Il2CppString*>(str));
|
||||
}
|
||||
app::String* ConvertToSystemString(const char* str)
|
||||
{
|
||||
Il2CppString* il2cpp_str = il2cpp_string_new(str);
|
||||
|
||||
app::String* system_string_str = reinterpret_cast<app::String*>(il2cpp_str);
|
||||
|
||||
return system_string_str;
|
||||
}
|
||||
#endif
|
||||
@@ -26,6 +26,9 @@ std::string il2cppi_to_string(Il2CppString* str);
|
||||
|
||||
// Helper function to convert System.String to std::string
|
||||
std::string il2cppi_to_string(app::String* str);
|
||||
|
||||
// Helper function to convert const char* to System.String
|
||||
app::String* ConvertToSystemString(const char* str);
|
||||
#endif
|
||||
|
||||
// Helper function to check if a metadata usage pointer is initialized
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "ClientHelper.h"
|
||||
#include "players/players.h"
|
||||
#include "UnityCore.h"
|
||||
#include "UnityEngine.h"
|
||||
|
||||
bool IsSinglePlayer()
|
||||
{
|
||||
@@ -46,10 +46,8 @@ bool IsPlayerCrawling(app::GameObject* go)
|
||||
if (go == NULL)
|
||||
return false;
|
||||
|
||||
app::String* str = reinterpret_cast<app::String*>(il2cpp_string_new("NolanBehaviour"));
|
||||
|
||||
if (app::GameObject_GetComponentByName != NULL) {
|
||||
app::Component* nbComponent = app::GameObject_GetComponentByName(go, str, nullptr);
|
||||
app::Component* nbComponent = app::GameObject_GetComponentByName(go, ConvertToSystemString("NolanBehaviour"), nullptr);
|
||||
|
||||
if (nbComponent) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
@@ -65,7 +63,7 @@ bool IsPlayerCrawling(app::GameObject* go)
|
||||
|
||||
bool IsInGame()
|
||||
{
|
||||
app::OptionsHelpers* optionsHelpers = UnityCore::Object<app::OptionsHelpers>::FindObjectOfType("OptionsHelpers");
|
||||
app::OptionsHelpers* optionsHelpers = UnityEngine::Object::FindObjectOfType<app::OptionsHelpers>("OptionsHelpers");
|
||||
|
||||
if (optionsHelpers)
|
||||
return optionsHelpers->fields._inGame_k__BackingField;
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
#include "pch-il2cpp.h"
|
||||
|
||||
#include "UnityCore.h"
|
||||
#include <helpers.h>
|
||||
|
||||
app::Component* Unity::GameObject::GetComponentByName(app::GameObject* go, const char* type)
|
||||
{
|
||||
app::String* str = reinterpret_cast<app::String*>(il2cpp_string_new(type));
|
||||
|
||||
if (str != nullptr) {
|
||||
app::Component* component = app::GameObject_GetComponentByName(go, str, nullptr);
|
||||
|
||||
if (component != nullptr) {
|
||||
return component;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Wrapper.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "ClientHelper.h"
|
||||
|
||||
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 {
|
||||
template<typename T>
|
||||
class Object {
|
||||
public:
|
||||
Object() = default;
|
||||
|
||||
static T* FindObjectOfType(const char* className, const char* classNamespace = "");
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline T* Object<T>::FindObjectOfType(const char* className, const char* classNamespace)
|
||||
{
|
||||
Wrapper obj("Assembly-CSharp.dll");
|
||||
|
||||
Il2CppObject* object = obj.find_class(classNamespace, className).get_class();
|
||||
if (object) {
|
||||
|
||||
if (app::Object_1_FindObjectOfType == nullptr) return nullptr;
|
||||
|
||||
app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (IsNull(obj_1) || obj_1 == nullptr) return nullptr;
|
||||
|
||||
T* foundObject = reinterpret_cast<T*>(obj_1);
|
||||
|
||||
if (foundObject) {
|
||||
return foundObject;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
72
lib/UnityEngine.cpp
Normal file
72
lib/UnityEngine.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "pch-il2cpp.h"
|
||||
|
||||
#include "UnityEngine.h"
|
||||
#include <helpers.h>
|
||||
|
||||
app::Component* UnityEngine::GameObject::GetComponentByName(app::GameObject* go, const char* type)
|
||||
{
|
||||
app::Component* component = app::GameObject_GetComponentByName(go, ConvertToSystemString(type), nullptr);
|
||||
|
||||
return component ? component : nullptr;
|
||||
}
|
||||
|
||||
app::Component__Array* UnityEngine::GameObject::LogComponents(app::GameObject* go)
|
||||
{
|
||||
Wrapper obj("UnityEngine.CoreModule.dll");
|
||||
|
||||
Il2CppObject* object = obj.find_class("UnityEngine", "Component").get_class();
|
||||
|
||||
if (!object) return nullptr;
|
||||
|
||||
app::Type* type = reinterpret_cast<app::Type*>(object);
|
||||
if (!type) return nullptr;
|
||||
|
||||
app::Component__Array* __components = app::GameObject_GetComponents(go, type, nullptr);
|
||||
|
||||
return __components ? __components : nullptr;
|
||||
}
|
||||
|
||||
const char* UnityEngine::Math::Vector3::ToString(app::Vector3* v)
|
||||
{
|
||||
app::String* str = app::Vector3_ToString(v, nullptr);
|
||||
|
||||
return str ? il2cppi_to_string(str).c_str() : "Vector::ToString returned nullptr!\n";
|
||||
}
|
||||
|
||||
const char* UnityEngine::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)).c_str();
|
||||
}
|
||||
|
||||
app::Transform* UnityEngine::Transform::Get(app::GameObject* go)
|
||||
{
|
||||
if (!go || !app::GameObject_get_transform) return nullptr;
|
||||
|
||||
app::Transform* __transform = app::GameObject_get_transform(go, nullptr);
|
||||
|
||||
return __transform ? __transform : nullptr;
|
||||
}
|
||||
|
||||
app::Vector3 UnityEngine::Transform::Position(app::Transform* transform)
|
||||
{
|
||||
if (!transform || !app::Transform_get_position) return app::Vector3();
|
||||
|
||||
return app::Transform_get_position(transform, nullptr);
|
||||
}
|
||||
|
||||
const char* UnityEngine::Object::GetObjectName(app::Object_1* obj)
|
||||
{
|
||||
static std::string name = il2cppi_to_string(app::Object_1_GetName(obj, nullptr));
|
||||
return name.c_str();
|
||||
}
|
||||
|
||||
app::GameObject__Array* UnityEngine::Object::FindGameObjectsWithTag(const char* tag)
|
||||
{
|
||||
app::GameObject__Array* go_array_result = app::GameObject_FindGameObjectsWithTag(ConvertToSystemString(tag), nullptr);
|
||||
|
||||
return go_array_result ? go_array_result : nullptr;
|
||||
}
|
||||
|
||||
void UnityEngine::Object::FindObjectFromInstanceID(int32_t instanceID)
|
||||
{
|
||||
}
|
||||
51
lib/UnityEngine.h
Normal file
51
lib/UnityEngine.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include "Wrapper.h"
|
||||
#include "helpers.h"
|
||||
#include "ClientHelper.h"
|
||||
|
||||
namespace UnityEngine {
|
||||
namespace GameObject {
|
||||
app::Component* GetComponentByName(app::GameObject* go, const char* type);
|
||||
app::Component__Array* LogComponents(app::GameObject* go);
|
||||
}
|
||||
|
||||
namespace Math {
|
||||
namespace Vector3 {
|
||||
const char* ToString(app::Vector3* v);
|
||||
const char* ToString(app::Vector3 v);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Transform {
|
||||
app::Transform* Get(app::GameObject* go);
|
||||
app::Vector3 Position(app::Transform* transform);
|
||||
}
|
||||
|
||||
struct Object {
|
||||
|
||||
static const char* GetObjectName(app::Object_1* obj);
|
||||
|
||||
static app::GameObject__Array* FindGameObjectsWithTag(const char* tag);
|
||||
|
||||
// Object_1_FindObjectFromInstanceID
|
||||
static void FindObjectFromInstanceID(int32_t instanceID);
|
||||
|
||||
template<typename T>
|
||||
static T* FindObjectOfType(const char* className, const char* classNamespace = "", const char* assemblyName = "Assembly-CSharp.dll") {
|
||||
|
||||
Wrapper obj(assemblyName);
|
||||
|
||||
Il2CppObject* object = obj.find_class(classNamespace, className).get_class();
|
||||
|
||||
if (!object || !app::Object_1_FindObjectOfType) return nullptr;
|
||||
|
||||
app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (!obj_1 || IsNull(obj_1)) return nullptr;
|
||||
|
||||
return reinterpret_cast<T*>(obj_1);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include "ClientHelper.h"
|
||||
#include "UnityCore.h"
|
||||
#include "UnityEngine.h"
|
||||
#include "players/players.h"
|
||||
#include "helpers.h"
|
||||
#include "esp.hpp"
|
||||
@@ -31,11 +31,11 @@ static void DrawBoxESP(app::GameObject *it, float footOffset, float headOffset,
|
||||
if (!it || cam == nullptr)
|
||||
return;
|
||||
|
||||
app::Transform* _transform = Unity::Transform::Get(it);
|
||||
app::Transform* _transform = UnityEngine::Transform::Get(it);
|
||||
if (_transform == nullptr)
|
||||
return;
|
||||
|
||||
app::Vector3 pos = Unity::Transform::Position(_transform);
|
||||
app::Vector3 pos = UnityEngine::Transform::Position(_transform);
|
||||
|
||||
app::Vector3 footpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + footOffset, pos.z}, NULL);
|
||||
app::Vector3 headpos = app::Camera_WorldToScreenPoint_1(cam, app::Vector3{pos.x, pos.y + headOffset, pos.z}, NULL);
|
||||
|
||||
@@ -5,17 +5,18 @@
|
||||
#include "ClientHelper.h"
|
||||
#include "players/players.h"
|
||||
#include "helpers.h"
|
||||
#include "UnityCore.h"
|
||||
#include "UnityEngine.h"
|
||||
#include <iostream>
|
||||
#include "Windows.h"
|
||||
#include <map>
|
||||
#include "utils/utils.hpp"
|
||||
|
||||
void Misc::ForceStart()
|
||||
{
|
||||
std::string _scene = SceneName();
|
||||
|
||||
if (IsHost() && _scene == std::string("Menu")) {
|
||||
app::Menu* _menu = UnityCore::Object<app::Menu>::FindObjectOfType("Menu", "Horror");
|
||||
app::Menu* _menu = UnityEngine::Object::FindObjectOfType<app::Menu>("Menu", "Horror");
|
||||
|
||||
if (_menu) {
|
||||
if (app::Menu_OnLobbyStartButtonClick) {
|
||||
@@ -60,8 +61,7 @@ void Misc::CarryItem(const char* itemName)
|
||||
std::string carryItem = itemMap[itemName];
|
||||
|
||||
if (!carryItem.empty() && Player::GetLocalPlayer()) {
|
||||
app::String* str2 = reinterpret_cast<app::String*>(il2cpp_string_new(carryItem.c_str()));
|
||||
app::NolanBehaviour_StartCarry(Player::GetNolan(), str2, nullptr);
|
||||
app::NolanBehaviour_StartCarry(Player::GetNolan(), ConvertToSystemString(carryItem.c_str()), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,7 @@ void Misc::CarryAnimal(const char* animalName)
|
||||
std::string carryAnimal = animalMap[animalName];
|
||||
|
||||
if (!carryAnimal.empty() && Player::GetLocalPlayer()) {
|
||||
app::String* str2 = reinterpret_cast<app::String*>(il2cpp_string_new(carryAnimal.c_str()));
|
||||
app::NolanBehaviour_StartCarry(Player::GetNolan(), str2, nullptr);
|
||||
app::NolanBehaviour_StartCarry(Player::GetNolan(), ConvertToSystemString(carryAnimal.c_str()), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,14 +94,12 @@ void Misc::InstantWin()
|
||||
|
||||
std::string _scene = SceneName();
|
||||
|
||||
if (_scene == std::string("Menu") && !IsHost() && !Player::GetLocalPlayer()) {
|
||||
return;
|
||||
}
|
||||
if (_scene == std::string("Menu") && !IsHost() && !Player::GetLocalPlayer()) return;
|
||||
|
||||
int32_t progress = 10;
|
||||
|
||||
if (_scene == std::string("Inn")) {
|
||||
app::MapController* _MapController = UnityCore::Object<app::MapController>::FindObjectOfType("MapController");
|
||||
app::MapController* _MapController = UnityEngine::Object::FindObjectOfType<app::MapController>("MapController");
|
||||
|
||||
if (_MapController) {
|
||||
|
||||
@@ -114,7 +111,7 @@ void Misc::InstantWin()
|
||||
}
|
||||
}
|
||||
else if (_scene == std::string("Slaughterhouse")) {
|
||||
app::SlaughterhouseAltarController* _SlaughterhouseAltarController = UnityCore::Object<app::SlaughterhouseAltarController>::FindObjectOfType("SlaughterhouseAltarController");
|
||||
app::SlaughterhouseAltarController* _SlaughterhouseAltarController = UnityEngine::Object::FindObjectOfType<app::SlaughterhouseAltarController>("SlaughterhouseAltarController");
|
||||
|
||||
if (_SlaughterhouseAltarController) {
|
||||
|
||||
@@ -126,7 +123,8 @@ void Misc::InstantWin()
|
||||
}
|
||||
}
|
||||
else {
|
||||
app::SurvivalObjectBurnController* _SurvivalObjectBurnController = UnityCore::Object<app::SurvivalObjectBurnController>::FindObjectOfType("SurvivalObjectBurnController");
|
||||
//app::SurvivalObjectBurnController* _SurvivalObjectBurnController = UnityEngine::Object::FindObjectOfType("SurvivalObjectBurnController");
|
||||
app::SurvivalObjectBurnController* _SurvivalObjectBurnController = UnityEngine::Object::FindObjectOfType<app::SurvivalObjectBurnController>("SurvivalObjectBurnController");
|
||||
|
||||
if (_SurvivalObjectBurnController) {
|
||||
// DO_APP_FUNC(0x00562590, void, SurvivalObjectBurnController_SkipToGoat, (SurvivalObjectBurnController * __this, int32_t number, MethodInfo * method));
|
||||
@@ -176,10 +174,10 @@ void Misc::SpawnPrefab(const char* prefabName) {
|
||||
if (localPlayer) {
|
||||
app::Quaternion rotation = app::Quaternion_get_identity(NULL);
|
||||
|
||||
app::Transform* playerTransform = Unity::Transform::Get(localPlayer);
|
||||
app::Transform* playerTransform = UnityEngine::Transform::Get(localPlayer);
|
||||
if (playerTransform == nullptr) return;
|
||||
|
||||
app::Vector3 playerPos = Unity::Transform::Position(playerTransform);
|
||||
app::Vector3 playerPos = UnityEngine::Transform::Position(playerTransform);
|
||||
|
||||
if (app::BoltNetwork_Instantiate_6) {
|
||||
app::GameObject* go = (app::GameObject*)app::BoltNetwork_Instantiate_6(p, playerPos, rotation, nullptr);
|
||||
@@ -196,7 +194,7 @@ void Misc::RankSpoofer(int value) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
app::NolanRankController* rankController = UnityCore::Object<app::NolanRankController>::FindObjectOfType("NolanRankController");
|
||||
app::NolanRankController* rankController = UnityEngine::Object::FindObjectOfType<app::NolanRankController>("NolanRankController");
|
||||
|
||||
if (rankController != nullptr) {
|
||||
if (app::NolanRankController_SetRank != nullptr) {
|
||||
@@ -229,7 +227,7 @@ void Misc::Revive(bool self)
|
||||
}
|
||||
|
||||
// app::SurvivalReviveInteractable
|
||||
app::SurvivalReviveInteractable* revive = UnityCore::Object<app::SurvivalReviveInteractable>::FindObjectOfType("SurvivalReviveInteractable");
|
||||
app::SurvivalReviveInteractable* revive = UnityEngine::Object::FindObjectOfType<app::SurvivalReviveInteractable>("SurvivalReviveInteractable");
|
||||
|
||||
if (revive == NULL) {
|
||||
if (self) {
|
||||
@@ -290,10 +288,10 @@ void Misc::Jumpscare() {
|
||||
return;
|
||||
}
|
||||
|
||||
app::Survival* survival = UnityCore::Object<app::Survival>::FindObjectOfType("Survival");
|
||||
app::Survival* survival = UnityEngine::Object::FindObjectOfType<app::Survival>("Survival");
|
||||
if (survival == NULL) { return; }
|
||||
|
||||
app::SurvivalAzazelBehaviour* azazel = UnityCore::Object<app::SurvivalAzazelBehaviour>::FindObjectOfType("SurvivalAzazelBehaviour");
|
||||
app::SurvivalAzazelBehaviour* azazel = UnityEngine::Object::FindObjectOfType<app::SurvivalAzazelBehaviour>("SurvivalAzazelBehaviour");
|
||||
|
||||
app::GameObject* ai = GetAzazel(survival);
|
||||
|
||||
@@ -307,7 +305,7 @@ void Misc::Jumpscare() {
|
||||
|
||||
if (currentPlayer == NULL) continue;
|
||||
|
||||
app::Component* component = Unity::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour");
|
||||
app::Component* component = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour");
|
||||
|
||||
if (component != NULL) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(component);
|
||||
@@ -335,10 +333,10 @@ void Misc::Kill(bool self) {
|
||||
return;
|
||||
}
|
||||
|
||||
app::Survival* survival = UnityCore::Object<app::Survival>::FindObjectOfType("Survival");
|
||||
app::Survival* survival = UnityEngine::Object::FindObjectOfType<app::Survival>("Survival");
|
||||
if (survival == NULL) { return; }
|
||||
|
||||
app::SurvivalAzazelBehaviour* azazel = UnityCore::Object<app::SurvivalAzazelBehaviour>::FindObjectOfType("SurvivalAzazelBehaviour");
|
||||
app::SurvivalAzazelBehaviour* azazel = UnityEngine::Object::FindObjectOfType<app::SurvivalAzazelBehaviour>("SurvivalAzazelBehaviour");
|
||||
|
||||
app::GameObject* ai = GetAzazel(survival);
|
||||
|
||||
@@ -363,7 +361,7 @@ void Misc::Kill(bool self) {
|
||||
|
||||
if (currentPlayer == NULL) continue;
|
||||
|
||||
app::Component* component = Unity::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour");
|
||||
app::Component* component = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour");
|
||||
|
||||
if (component != NULL) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(component);
|
||||
@@ -397,7 +395,8 @@ void Misc::TpToAzazel()
|
||||
|
||||
if (nb == nullptr) return;
|
||||
|
||||
app::Survival* _survival = UnityCore::Object<app::Survival>::FindObjectOfType("Survival");
|
||||
|
||||
app::Survival* _survival = UnityEngine::Object::FindObjectOfType<app::Survival>("Survival");
|
||||
if (_survival == nullptr) return;
|
||||
|
||||
// get azazel
|
||||
@@ -419,49 +418,5 @@ void Misc::TpToAzazel()
|
||||
|
||||
void Misc::UnlockAchievements()
|
||||
{
|
||||
app::AchievementHelpers* achievementsSingleton = app::AchievementHelpers_get_singleton(nullptr);
|
||||
|
||||
if (achievementsSingleton != nullptr) {
|
||||
|
||||
const char* achievements[] = {
|
||||
"ACH_ALL_CLIPBOARDS_READ", "ACH_ALL_NOTES_READ", "ACH_UNLOCKED_CAGE",
|
||||
"ACH_UNLOCKED_ATTIC_CAGE", "ACH_CALMED_ANNA", "ACH_FRIED_RAT",
|
||||
"ACH_BURNT_GOAT", "ACH_KNOCKED_OUT_BY_ANNA", "ACH_KNOCKOUT_OUT_BY_DEMON",
|
||||
"ACH_KNOCKED_OUT_IN_HIDING", "STAT_NUM_BLEACH_USED", "ACH_WON_SP",
|
||||
"ACH_WIN_NIGHTMARE", "ACH_WON_HARD_SP", "ACH_WON_COOP", "ACH_WON_HARD",
|
||||
"ACH_WIN_NIGHTMARE_SP", "ACH_LOST", "ACH_NEVER_KNOCKED_OUT",
|
||||
"ACH_ONLY_ONE_KNOCKED_OUT", "ACH_WON_HARD_NO_MEDKITS", "ACH_WON_NO_MEDKITS",
|
||||
"ACH_WON_NO_BATTERIES", "ACH_WON_NIGHTMARE_NO_MEDKITS",
|
||||
"ACH_WON_NO_KNOCKOUT_COOP", "ACH_WON_HARD_NO_BATTERIES",
|
||||
"ACH_WON_HARD_{0}", "ACH_WON_NIGHTMARE_{0}", "ACH_WON_NIGHTMARE_NO_BATTERIES",
|
||||
"ACH_SURVIVED_TO_7_GOATS", "ACH_SURVIVED_TO_5_GOATS", "ACH_SURVIVED_TO_3_GOATS",
|
||||
"ACH_WON_Manor_NIGHTMARE_SP", "ACH_WON_NIGHTMARE_", "ACH_WON_MANOR_NIGHTMARE_SP",
|
||||
"ACH_WON_TOWN_HARD", "ACH_WON_INN_HARD_SP", "ACH_ALL_FEATHERS",
|
||||
"ACH_WON_SLAUGHTERHOUSE_COOP", "ACH_ALL_BARBED_WIRES", "ACH_WON_INN_HARD",
|
||||
"ACH_WON_MOLLY_HARD", "ACH_ALL_HORSESHOES", "ACH_WON_MOLLY_HARD_SP",
|
||||
"ACH_WON_TOWN_NIGHTMARE_SP", "ACH_100_GASOLINE_USED", "ACH_WON_INN_SP",
|
||||
"ACH_WON_MANOR_HARD_SP", "ACH_WON_MOLLY_SP", "ACH_1000_PIGS_DESTROYED",
|
||||
"ACH_1000_MIRRORS_DESTROYED", "ACH_100_EGGS_DESTROYED", "ACH_WON_SLAUGHTERHOUSE_HARD_SP",
|
||||
"ACH_WON_TOWN_COOP", "ACH_100_FUSES_USED", "ACH_WON_MOLLY_COOP",
|
||||
"ACH_WON_MOLLY_NIGHTMARE_SP", "ACH_1000_BOOKS_DESTROYED", "ACH_ALL_PATCHES",
|
||||
"ACH_WON_SLAUGHTERHOUSE_SP", "ACH_WON_TOWN_NIGHTMARE", "ACH_WON_INN_COOP",
|
||||
"ACH_ALL_CHERRY_BLOSSOM", "ACH_WON_TOWN_HARD_SP", "ACH_WON_MOLLY_NIGHTMARE",
|
||||
"ACH_WON_INN_NIGHTMARE_SP", "ACH_ALL_ROSES", "ACH_WON_TOWN_SP",
|
||||
"ACH_WON_SLAUGHTERHOUSE_NIGHTMARE_SP", "ACH_WON_INN_NIGHTMARE",
|
||||
"ACH_WON_MANOR_COOP", "ACH_WON_SLAUGHTERHOUSE_HARD", "ACH_WON_SLAUGHTERHOUSE_NIGHTMARE",
|
||||
"ACH_WON_MANOR_HARD", "ACH_WON_MANOR_NIGHTMARE", "ACH_WON_MANOR_SP"
|
||||
};
|
||||
|
||||
|
||||
int size = sizeof(achievements) / sizeof(achievements[0]);
|
||||
|
||||
std::cout << "Achievements length: " << size << "\n";
|
||||
|
||||
for (int i = 0; i < size; ++i) {
|
||||
app::String* currentachievements = reinterpret_cast<app::String*>(il2cpp_string_new(achievements[i]));
|
||||
|
||||
// crash
|
||||
app::AchievementHelpers_Unlock(achievementsSingleton, currentachievements, false, nullptr);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "helpers.h"
|
||||
|
||||
#include "players/players.h"
|
||||
#include "UnityCore.h"
|
||||
#include "UnityEngine.h"
|
||||
#include "ClientHelper.h"
|
||||
#include "features/misc/misc.h"
|
||||
|
||||
@@ -67,19 +67,12 @@ TMenu_Update oMenu_Update = NULL;
|
||||
void __stdcall hMenu_Update(app::Menu* __this, MethodInfo* method) {
|
||||
|
||||
if (settings::steam_name_spoof) {
|
||||
|
||||
Il2CppString* steamId = il2cpp_string_new("43634643643");
|
||||
Il2CppString* new_name = il2cpp_string_new(settings::new_name.c_str());
|
||||
|
||||
__this->fields.steamID = reinterpret_cast<app::String*>(steamId);
|
||||
__this->fields.steamName = reinterpret_cast<app::String*>(new_name);
|
||||
__this->fields.steamName = ConvertToSystemString(settings::new_name.c_str());
|
||||
}
|
||||
|
||||
if (settings::server_name_spoof) {
|
||||
app::String* newServerName = reinterpret_cast<app::String*>(il2cpp_string_new(settings::server_name.c_str()));
|
||||
|
||||
if (app::Text_set_text != nullptr) {
|
||||
app::Text_set_text(__this->fields.serverNameText, newServerName, nullptr);
|
||||
app::Text_set_text(__this->fields.serverNameText, ConvertToSystemString(settings::server_name.c_str()), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +92,7 @@ void __stdcall hNolanBehaviour_Update(app::NolanBehaviour* __this, MethodInfo* m
|
||||
|
||||
if (transform) {
|
||||
|
||||
app::Vector3 pos = Unity::Transform::Position(transform);
|
||||
app::Vector3 pos = UnityEngine::Transform::Position(transform);
|
||||
|
||||
if (GetAsyncKeyState('W') & 0x8000) {
|
||||
pos = pos + (app::Transform_get_forward(transform, nullptr) * speed * Time_DeltaTime());
|
||||
@@ -124,7 +117,7 @@ void __stdcall hNolanBehaviour_Update(app::NolanBehaviour* __this, MethodInfo* m
|
||||
app::GameObject* thisGameObject = app::Component_get_gameObject((app::Component*)__this, nullptr);
|
||||
|
||||
if (thisGameObject != nullptr || !IsNull((app::Object_1*)thisGameObject)) {
|
||||
app::Component* _UltimateCharacterLocomotion = Unity::GameObject::GetComponentByName(thisGameObject, "UltimateCharacterLocomotion");
|
||||
app::Component* _UltimateCharacterLocomotion = UnityEngine::GameObject::GetComponentByName(thisGameObject, "UltimateCharacterLocomotion");
|
||||
|
||||
if (_UltimateCharacterLocomotion != nullptr && !IsNull((app::Object_1*)_UltimateCharacterLocomotion)) {
|
||||
if (app::UltimateCharacterLocomotion_SetPosition_1) {
|
||||
@@ -161,8 +154,7 @@ void __stdcall hNolanBehaviour_FixedUpdate(app::NolanBehaviour* __this, MethodIn
|
||||
app::GameObject* goAzazel = __this->fields.m_Survival->fields.m_Azazel;
|
||||
|
||||
if (goAzazel) {
|
||||
app::String* azazelComponent = reinterpret_cast<app::String*>(il2cpp_string_new("UltimateCharacterLocomotion"));
|
||||
auto component = app::GameObject_GetComponentByName(goAzazel, azazelComponent, nullptr);
|
||||
auto component = app::GameObject_GetComponentByName(goAzazel, ConvertToSystemString("UltimateCharacterLocomotion"), nullptr);
|
||||
|
||||
if (component) {
|
||||
app::UltimateCharacterLocomotion* locomotion = reinterpret_cast<app::UltimateCharacterLocomotion*>(component);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "Wrapper.h"
|
||||
#include "ClientHelper.h"
|
||||
#include "hooks/hooks.hpp"
|
||||
#include "UnityCore.h"
|
||||
#include "UnityEngine.h"
|
||||
#include "color.hpp"
|
||||
#include "features/misc/misc.h"
|
||||
#include "utils/utils.hpp"
|
||||
@@ -80,15 +80,12 @@ void Run()
|
||||
std::cout << "[DevourClient]: " << dye::red_on_black("Client is out of date!") << "\n\n";
|
||||
|
||||
const char* latestDownloadLink = client.GetLatestDownloadLink();
|
||||
app::String* str = reinterpret_cast<app::String*>(il2cpp_string_new(latestDownloadLink));
|
||||
|
||||
const int result = MessageBox(NULL, L"Version is not up to date! Would you like to download the new version?", L"DevourClient", MB_YESNO | MB_ICONERROR);
|
||||
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case IDYES:
|
||||
app::Application_OpenURL(str, nullptr);
|
||||
app::Application_OpenURL(ConvertToSystemString(latestDownloadLink), nullptr);
|
||||
break;
|
||||
case IDNO:
|
||||
MessageBox(NULL, L"You can download the new version at any time to benefit from new features, improvements, and bug fixes", L"DevourClient", MB_OK | MB_ICONEXCLAMATION);
|
||||
@@ -130,18 +127,18 @@ void Run()
|
||||
std::string scene = SceneName();
|
||||
|
||||
if (scene == std::string("Menu")) {
|
||||
app::Menu* horrorMenu = UnityCore::Object<app::Menu>::FindObjectOfType("Menu", "Horror");
|
||||
app::Menu* horrorMenu = UnityEngine::Object::FindObjectOfType<app::Menu>("Menu", "Horror");
|
||||
|
||||
if (!horrorMenu)
|
||||
return;
|
||||
|
||||
app::String* str = reinterpret_cast<app::String*>(il2cpp_string_new("Welcome to DevourClient.\n\nAfter ensuring the game is in full screen, press the INS key to activate the menu.\n\n\nYou can disable the cheat by pressing the 'END' key."));
|
||||
app::String* message_modal_textContent = ConvertToSystemString("Welcome to DevourClient.\n\nAfter ensuring the game is in full screen, press the INS key to activate the menu.\n\n\nYou can disable the cheat by pressing the 'END' key.");
|
||||
|
||||
if (str) {
|
||||
if (message_modal_textContent) {
|
||||
if (app::Menu_ShowMessageModal == nullptr)
|
||||
return;
|
||||
|
||||
app::Menu_ShowMessageModal(horrorMenu, str, nullptr);
|
||||
app::Menu_ShowMessageModal(horrorMenu, message_modal_textContent, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
#include "pch-il2cpp.h"
|
||||
|
||||
#include "players.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <helpers.h>
|
||||
#include "UnityEngine.h"
|
||||
#include "ClientHelper.h"
|
||||
|
||||
|
||||
app::GameObject__Array* Players::GetAllPlayers()
|
||||
{
|
||||
app::String* playerTagStr = reinterpret_cast<app::String*>(il2cpp_string_new("Player"));
|
||||
app::GameObject__Array* players = UnityEngine::Object::FindGameObjectsWithTag("Player");
|
||||
|
||||
if (app::GameObject_FindGameObjectsWithTag) {
|
||||
app::GameObject__Array* playersTag = app::GameObject_FindGameObjectsWithTag(playerTagStr, nullptr);
|
||||
|
||||
if (playersTag) {
|
||||
return playersTag;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return players ? players : nullptr;
|
||||
}
|
||||
|
||||
app::GameObject* Player::GetLocalPlayer()
|
||||
@@ -36,7 +27,6 @@ app::GameObject* Player::GetLocalPlayer()
|
||||
}
|
||||
|
||||
app::GameObject__Array* playerList = Players::GetAllPlayers();
|
||||
app::String* NolanBehaviourStr = reinterpret_cast<app::String*>(il2cpp_string_new("NolanBehaviour"));
|
||||
|
||||
if (!playerList || playerList->max_length == 0)
|
||||
return nullptr;
|
||||
@@ -49,16 +39,14 @@ app::GameObject* Player::GetLocalPlayer()
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
if (app::GameObject_GetComponentByName) {
|
||||
app::Component* nbComponent = app::GameObject_GetComponentByName(currentPlayer, NolanBehaviourStr, nullptr);
|
||||
app::Component* nbComponent = UnityEngine::GameObject::GetComponentByName(currentPlayer, "NolanBehaviour");
|
||||
|
||||
if (nbComponent) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
if (nbComponent) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
|
||||
if (nb && IsLocalPlayer(nb)) {
|
||||
cachedLocalPlayer = currentPlayer;
|
||||
return currentPlayer;
|
||||
}
|
||||
if (nb && IsLocalPlayer(nb)) {
|
||||
cachedLocalPlayer = currentPlayer;
|
||||
return currentPlayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,16 +63,16 @@ app::NolanBehaviour* Player::GetNolan()
|
||||
if (localPlayer == nullptr) return nullptr;
|
||||
|
||||
if (lastLocalPlayer != localPlayer) {
|
||||
app::String* NolanBehaviourStr = reinterpret_cast<app::String*>(il2cpp_string_new("NolanBehaviour"));
|
||||
if (app::GameObject_GetComponentByName) {
|
||||
app::Component* nbComponent = app::GameObject_GetComponentByName(localPlayer, NolanBehaviourStr, nullptr);
|
||||
|
||||
if (nbComponent) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
if (nb) {
|
||||
cachedNolan = nb;
|
||||
lastLocalPlayer = localPlayer;
|
||||
}
|
||||
app::Component* nbComponent = UnityEngine::GameObject::GetComponentByName(localPlayer, "NolanBehaviour");
|
||||
|
||||
if (nbComponent) {
|
||||
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
|
||||
if (nb) {
|
||||
cachedNolan = nb;
|
||||
lastLocalPlayer = localPlayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user