some helper functions added
-
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#include "pch-il2cpp.h"
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
#include "ClientHelper.h"
|
#include "ClientHelper.h"
|
||||||
|
#include "wrapper.h"
|
||||||
|
|
||||||
bool IsSinglePlayer()
|
bool IsSinglePlayer()
|
||||||
{
|
{
|
||||||
@@ -17,3 +20,42 @@ bool IsHost()
|
|||||||
return app::BoltNetwork_get_IsServer(NULL);
|
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()
|
||||||
|
{
|
||||||
|
app::SaveHelpers* SaveHelper = app::SaveHelpers_get_singleton(nullptr);
|
||||||
|
|
||||||
|
if (SaveHelper) {
|
||||||
|
|
||||||
|
std::string str = il2cppi_to_string(SaveHelper->fields.sceneName);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string("unknown");
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
bool IsSinglePlayer();
|
bool IsSinglePlayer();
|
||||||
bool IsOnline();
|
bool IsOnline();
|
||||||
bool IsHost();
|
bool IsHost();
|
||||||
|
app::Menu* get_HorrorMenu();
|
||||||
|
std::string get_SceneName();
|
||||||
@@ -21,12 +21,10 @@ Wrapper::Wrapper()
|
|||||||
if (assembly) {
|
if (assembly) {
|
||||||
const char* assemblyName = il2cpp_image_get_name(assembly->image);
|
const char* assemblyName = il2cpp_image_get_name(assembly->image);
|
||||||
assemblyMap[assemblyName] = assembly;
|
assemblyMap[assemblyName] = assembly;
|
||||||
std::cout << "\t- " << assemblyName << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Il2CppAssembly* Wrapper::GetAssembly(const char* _assembly) {
|
const Il2CppAssembly* Wrapper::GetAssembly(const char* _assembly) {
|
||||||
for (const auto& entry : assemblyMap) {
|
for (const auto& entry : assemblyMap) {
|
||||||
if (strcmp(entry.first, _assembly) == 0) {
|
if (strcmp(entry.first, _assembly) == 0) {
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#include "../main.h"
|
#include "../main.h"
|
||||||
#include "../settings/settings.hpp"
|
#include "../settings/settings.hpp"
|
||||||
|
|
||||||
|
#include "misc/misc.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -187,7 +189,7 @@ void DrawMapSpecificTab() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Force start game")) {
|
if (ImGui::Button("Force start game")) {
|
||||||
//Misc::ForceStart();
|
Misc::ForceStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Knock out everyone")) {
|
if (ImGui::Button("Knock out everyone")) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "pch-il2cpp.h"
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "ClientHelper.h"
|
||||||
|
|
||||||
void Misc::SetRank(int rank)
|
void Misc::SetRank(int rank)
|
||||||
{
|
{
|
||||||
@@ -9,4 +10,12 @@ void Misc::SetRank(int rank)
|
|||||||
|
|
||||||
void Misc::SetSteamName(std::string& name)
|
void Misc::SetSteamName(std::string& name)
|
||||||
{
|
{
|
||||||
|
get_HorrorMenu()->fields.steamName = reinterpret_cast<app::String*>(il2cpp_string_new("0x"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Misc::ForceStart()
|
||||||
|
{
|
||||||
|
if (IsHost()) {
|
||||||
|
app::Menu_OnLobbyStartButtonClick(get_HorrorMenu(), nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,4 +7,5 @@
|
|||||||
namespace Misc {
|
namespace Misc {
|
||||||
void SetRank(int rank);
|
void SetRank(int rank);
|
||||||
void SetSteamName(std::string& name);
|
void SetSteamName(std::string& name);
|
||||||
|
void ForceStart();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user