various header files added/updated
- Created a header file called players. added a helper function to get the gameobject of all players, the gameobject of the local player and the NolanBehaviour component - Added UnityCore file to make it easier for us to use unity functions - Misc file fully updated - Added Wrapper class to make it easier to use il2cpp functions - ClientHelper updated - color.hpp library was included in the project to make the console colorful
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include "pch-il2cpp.h"
|
||||
|
||||
#include "helpers.h"
|
||||
#include <iostream>
|
||||
#include <helpers.h>
|
||||
|
||||
#include "ClientHelper.h"
|
||||
#include "wrapper.h"
|
||||
#include "players/players.h"
|
||||
#include "UnityCore.h"
|
||||
|
||||
bool IsSinglePlayer()
|
||||
{
|
||||
@@ -21,226 +21,92 @@ bool IsHost()
|
||||
return app::BoltNetwork_get_IsServer(NULL);
|
||||
}
|
||||
|
||||
app::Menu* get_HorrorMenu() {
|
||||
Wrapper wrapper;
|
||||
|
||||
const Il2CppImage* image = wrapper.GetImage("Assembly-CSharp.dll");
|
||||
|
||||
// DO_APP_FUNC(0x0065B240, void, Menu_OnLobbyStartButtonClick, (Menu * __this, MethodInfo * method));
|
||||
// menu.OnLobbyStartButtonClick();
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "Horror", "Menu");
|
||||
|
||||
if (object != nullptr) {
|
||||
|
||||
app::Object_1* Horror_MenuObject = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (Horror_MenuObject) {
|
||||
app::Menu* HorrorMenu = reinterpret_cast<app::Menu*>(Horror_MenuObject);
|
||||
|
||||
if (HorrorMenu) {
|
||||
return HorrorMenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string get_SceneName()
|
||||
bool IsLocalPlayer(app::NolanBehaviour* player)
|
||||
{
|
||||
app::SaveHelpers* SaveHelper = app::SaveHelpers_get_singleton(nullptr);
|
||||
auto boltEntity = app::EntityBehaviour_get_entity((app::EntityBehaviour*)player, NULL);
|
||||
|
||||
if (SaveHelper) {
|
||||
if (not boltEntity
|
||||
|| not app::BoltEntity_get_IsAttached(boltEntity, NULL)
|
||||
|| not app::BoltEntity_get_IsOwner(boltEntity, NULL))
|
||||
return false;
|
||||
|
||||
std::string str = il2cppi_to_string(SaveHelper->fields.sceneName);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
return std::string("unknown");
|
||||
return true;
|
||||
}
|
||||
|
||||
void BurnRitualObj(bool burnAll)
|
||||
bool IsPlayerCrawling()
|
||||
{
|
||||
// Devour: SurvivalObjectBurnController
|
||||
// Molly: SurvivalMollyAltarController
|
||||
// Inn: InnMapController
|
||||
// Town: SurvivalTownAltarController
|
||||
// Slaughterhouse: SlaughterhouseAltarController
|
||||
if (!Player::GetLocalPlayer())
|
||||
return false;
|
||||
|
||||
/* MAP: TOWN, DEVOUR
|
||||
DO_APP_FUNC(0x00562320, void, SurvivalObjectBurnController_BurnGoat, (SurvivalObjectBurnController * __this, MethodInfo * method));
|
||||
DO_APP_FUNC(0x00562590, void, SurvivalObjectBurnController_SkipToGoat, (SurvivalObjectBurnController * __this, int32_t number, MethodInfo * method));
|
||||
*/
|
||||
|
||||
if (!IsHost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Wrapper wrapper;
|
||||
const Il2CppImage* image = wrapper.GetImage("Assembly-CSharp.dll");
|
||||
|
||||
std::string sceneName = get_SceneName();
|
||||
|
||||
std::cout << "call..\n";
|
||||
|
||||
// !!!!Check if Azazel is awake.
|
||||
BurnManager(sceneName, wrapper, image, burnAll);
|
||||
return app::NolanBehaviour_IsCrawling(Player::GetNolan(), nullptr);
|
||||
}
|
||||
|
||||
void BurnManager(std::string& sceneName, Wrapper& wrapper, const Il2CppImage* image, bool burnAll)
|
||||
bool IsPlayerCrawling(app::GameObject* go)
|
||||
{
|
||||
int32_t num = 10;
|
||||
if (go == NULL)
|
||||
return false;
|
||||
|
||||
if (sceneName == std::string("Devour")) {
|
||||
app::String* str = reinterpret_cast<app::String*>(il2cpp_string_new("NolanBehaviour"));
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "", "SurvivalObjectBurnController");
|
||||
if (app::GameObject_GetComponentByName != NULL) {
|
||||
app::Component* nbComponent = app::GameObject_GetComponentByName(go, str, nullptr);
|
||||
|
||||
if (object != nullptr) {
|
||||
auto SurvivalObjectBurnController_Object = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
if (nbComponent) {
|
||||
app::NolanBehaviour* nb = reinterpret_cast<app::NolanBehaviour*>(nbComponent);
|
||||
|
||||
if (SurvivalObjectBurnController_Object) {
|
||||
auto SurvivalObjectBurnController = reinterpret_cast<app::SurvivalObjectBurnController*>(SurvivalObjectBurnController_Object);
|
||||
|
||||
if (SurvivalObjectBurnController) {
|
||||
|
||||
if (burnAll) {
|
||||
if (app::SurvivalObjectBurnController_SkipToGoat) {
|
||||
app::SurvivalObjectBurnController_SkipToGoat(SurvivalObjectBurnController, num, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (app::SurvivalObjectBurnController_BurnGoat) {
|
||||
app::SurvivalObjectBurnController_BurnGoat(SurvivalObjectBurnController, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nb) {
|
||||
return app::NolanBehaviour_IsCrawling(nb, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sceneName == std::string("Molly")) {
|
||||
|
||||
/*
|
||||
MAP: MOLLY
|
||||
DO_APP_FUNC(0x0055C100, void, SurvivalMollyAltarController_SkipToGoat, (SurvivalMollyAltarController * __this, int32_t number, MethodInfo * method));
|
||||
DO_APP_FUNC(0x0055C8E0, void, SurvivalMollyAltarController_OnGoat, (SurvivalMollyAltarController * __this, MethodInfo * method));
|
||||
*/
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "", "SurvivalMollyAltarController");
|
||||
|
||||
if (object != nullptr) {
|
||||
auto MollyAltarController_Object = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (MollyAltarController_Object) {
|
||||
auto SurvivalMollyAltarController = reinterpret_cast<app::SurvivalMollyAltarController*>(MollyAltarController_Object);
|
||||
|
||||
if (SurvivalMollyAltarController) {
|
||||
|
||||
if (burnAll) {
|
||||
if (app::SurvivalMollyAltarController_SkipToGoat) {
|
||||
app::SurvivalMollyAltarController_SkipToGoat(SurvivalMollyAltarController, num, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (app::SurvivalMollyAltarController_OnGoat) {
|
||||
app::SurvivalMollyAltarController_OnGoat(SurvivalMollyAltarController, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sceneName == std::string("Inn")) {
|
||||
|
||||
/* MAP: INN
|
||||
DO_APP_FUNC(0x00930CD0, void, MapController_SetProgressTo, (MapController * __this, int32_t progress, MethodInfo * method));
|
||||
DO_APP_FUNC(0x00930EA0, void, MapController_IncreaseProgress, (MapController * __this, MethodInfo * method));
|
||||
*/
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "", "SurvivalMollyAltarController");
|
||||
|
||||
if (object != nullptr) {
|
||||
auto MapController_Object = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (MapController_Object) {
|
||||
auto MapController = reinterpret_cast<app::MapController*>(MapController_Object);
|
||||
|
||||
if (MapController) {
|
||||
|
||||
if (burnAll) {
|
||||
if (app::MapController_SetProgressTo) {
|
||||
app::MapController_SetProgressTo(MapController, num, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (app::MapController_IncreaseProgress) {
|
||||
app::MapController_IncreaseProgress(MapController, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sceneName == std::string("Town")) {
|
||||
/* MAP: TOWN, DEVOUR
|
||||
DO_APP_FUNC(0x00562320, void, SurvivalObjectBurnController_BurnGoat, (SurvivalObjectBurnController * __this, MethodInfo * method));
|
||||
DO_APP_FUNC(0x00562590, void, SurvivalObjectBurnController_SkipToGoat, (SurvivalObjectBurnController * __this, int32_t number, MethodInfo * method));
|
||||
*/
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "", "SurvivalMollyAltarController");
|
||||
|
||||
if (object != nullptr) {
|
||||
auto MapController_Object = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (MapController_Object) {
|
||||
auto MapController = reinterpret_cast<app::MapController*>(MapController_Object);
|
||||
|
||||
if (MapController) {
|
||||
|
||||
if (burnAll) {
|
||||
if (app::MapController_SetProgressTo) {
|
||||
app::MapController_SetProgressTo(MapController, num, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (app::MapController_IncreaseProgress) {
|
||||
app::MapController_IncreaseProgress(MapController, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sceneName == std::string("Slaughterhouse")) {
|
||||
/* MAP: Slaughterhouse
|
||||
DO_APP_FUNC(0x0050DEB0, void, SlaughterhouseAltarController_SkipToGoat, (SlaughterhouseAltarController * __this, int32_t number, MethodInfo * method));
|
||||
*/
|
||||
|
||||
Il2CppObject* object = wrapper.GetObjectFromClass(image, "", "SlaughterhouseAltarController");
|
||||
|
||||
if (object != nullptr) {
|
||||
auto SlaughterhouseAltarController_Object = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);
|
||||
|
||||
if (SlaughterhouseAltarController_Object) {
|
||||
auto SlaughterhouseAltarController = reinterpret_cast<app::SlaughterhouseAltarController*>(SlaughterhouseAltarController_Object);
|
||||
|
||||
if (SlaughterhouseAltarController) {
|
||||
|
||||
if (burnAll) {
|
||||
if (app::SlaughterhouseAltarController_SkipToGoat) {
|
||||
app::SlaughterhouseAltarController_SkipToGoat(SlaughterhouseAltarController, num, nullptr);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
return app::NolanBehaviour_IsCrawling(Player::GetNolan(), nullptr);
|
||||
}
|
||||
|
||||
bool IsInGame()
|
||||
{
|
||||
app::OptionsHelpers* optionsHelpers = UnityCore::Object<app::OptionsHelpers>::FindObjectOfType("OptionsHelpers");
|
||||
|
||||
if (optionsHelpers)
|
||||
return optionsHelpers->fields._inGame_k__BackingField;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
app::GameObject* GetAzazel(app::Survival* survival)
|
||||
{
|
||||
app::GameObject* ai = app::Survival_GetAzazel(survival, nullptr);
|
||||
|
||||
if (ai) {
|
||||
return ai;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
std::string SceneName()
|
||||
{
|
||||
if (app::SaveHelpers_get_singleton != nullptr) {
|
||||
app::SaveHelpers* SaveHelper = app::SaveHelpers_get_singleton(nullptr);
|
||||
|
||||
if (SaveHelper) {
|
||||
|
||||
std::string str = il2cppi_to_string(SaveHelper->fields.sceneName);
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
|
||||
float Time_DeltaTime()
|
||||
{
|
||||
if (app::Time_1_get_deltaTime) {
|
||||
return app::Time_1_get_deltaTime(nullptr);
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user