From 9dc8140e59d58656416a673ce9ebe427593efbb3 Mon Sep 17 00:00:00 2001 From: NightFyre <80198020+xCENTx@users.noreply.github.com> Date: Sun, 28 Jan 2024 13:08:50 -0500 Subject: [PATCH] Project Adjustments PROJECT SETTINGS - Additional Options "/bigobj" for debug builds - Output directory relocated to solution directory "/bin" - include "ProjDir" as an additional include directory for debug builds FEATURES - adjust params for some functions to include default values - relocate functions from Menu to Features for clarity - included comments ISSUES - SpeedHack is causing a crash if toggled while loading from main menu - Database Tab is causing a crash due to "Config.Update" --- DX11-Base.vcxproj | 9 +- config.cpp | 11 + config.h | 3 +- feature.cpp | 489 ++++++++++++++++++++++--------- feature.h | 26 +- include/Console.hpp | 39 +-- include/helper.h | 5 +- initialize.hpp | 4 +- src/Console.cpp | 6 +- src/D3D11Window.cpp | 10 +- src/Game.cpp | 6 +- src/Hooking.cpp | 4 +- src/Menu.cpp | 682 ++++++++++++++++---------------------------- 13 files changed, 688 insertions(+), 606 deletions(-) diff --git a/DX11-Base.vcxproj b/DX11-Base.vcxproj index 4a370cb..dd57baa 100644 --- a/DX11-Base.vcxproj +++ b/DX11-Base.vcxproj @@ -43,13 +43,13 @@ DynamicLibrary true - v143 + v142 Unicode DynamicLibrary false - v143 + v142 true Unicode @@ -79,9 +79,12 @@ true + $(SolutionDir)\bin + $(ProjectName)_debug false + $(SolutionDir)\bin @@ -131,6 +134,8 @@ pch.h stdcpplatest stdc17 + /bigobj + $(ProjectDir); Windows diff --git a/config.cpp b/config.cpp index dbe1fa6..8535898 100644 --- a/config.cpp +++ b/config.cpp @@ -69,6 +69,15 @@ SDK::APalPlayerCharacter* config::GetPalPlayerCharacter() return nullptr; } +SDK::APalPlayerController* config::GetPalPlayerController() +{ + SDK::APalPlayerCharacter* pPlayer = GetPalPlayerCharacter(); + if (!pPlayer) + return nullptr; + + return static_cast(pPlayer->GetPalPlayerController()); +} + SDK::APalPlayerState* config::GetPalPlayerState() { SDK::APalPlayerCharacter* pPlayer = GetPalPlayerCharacter(); @@ -194,6 +203,8 @@ void config::Init() TickFunc = (Tick)(Config.ClientBase + Config.offset_Tick); + Config.gWorld = Config.GetUWorld(); + MH_CreateHook(TickFunc, DetourTick, reinterpret_cast(&OldTickFunc)); //init database diff --git a/config.h b/config.h index 5313629..7589f5b 100644 --- a/config.h +++ b/config.h @@ -64,7 +64,8 @@ public: //static function static SDK::UWorld* GetUWorld(); static SDK::UPalCharacterImportanceManager* GetCharacterImpManager(); - static SDK::APalPlayerCharacter* GetPalPlayerCharacter(); + static SDK::APalPlayerCharacter* GetPalPlayerCharacter(); + static SDK::APalPlayerController* GetPalPlayerController(); static SDK::APalPlayerState* GetPalPlayerState(); static SDK::UPalPlayerInventoryData* GetInventoryComponent(); static SDK::APalWeaponBase* GetPlayerEquippedWeapon(); diff --git a/feature.cpp b/feature.cpp index 72af8de..f7ed5d2 100644 --- a/feature.cpp +++ b/feature.cpp @@ -2,6 +2,7 @@ #include "feature.h" using namespace SDK; +// should only be called from a GUI thread with ImGui context void ESP() { APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); @@ -28,6 +29,8 @@ void ESP() ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), ImColor(128,0,0), T[i]->GetFullName().c_str()); } +// draws debug information for the input actor array +// should only be called from a GUI thread with ImGui context void ESP_DEBUG(float mDist, ImVec4 color, UClass* mEntType) { APalPlayerCharacter* pLocalPlayer = Config.GetPalPlayerCharacter(); @@ -42,7 +45,7 @@ void ESP_DEBUG(float mDist, ImVec4 color, UClass* mEntType) if (!config::GetAllActorsofType(mEntType, &actors, true)) return; - auto draw = ImGui::GetWindowDrawList(); + auto draw = ImGui::GetBackgroundDrawList(); __int32 actorsCount = actors.size(); for (AActor* actor : actors) @@ -71,158 +74,57 @@ void ESP_DEBUG(float mDist, ImVec4 color, UClass* mEntType) } } -void DrawUActorComponent(SDK::TArray Comps,ImColor color) +// should only be called from a GUI thread with ImGui context +void DrawUActorComponent(TArray Comps,ImColor color) { ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(ImGui::GetIO().DisplaySize.x / 2, ImGui::GetIO().DisplaySize.y / 2), color, "Drawing..."); - if (Comps.IsValid()) + if (!Comps.IsValid()) + return; + for (int i = 0; i < Comps.Count(); i++) { - for (int i = 0; i < Comps.Count(); i++) - { - - if (Comps[i] != NULL) - { - - ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), color, Comps[i]->GetFullName().c_str()); - } - } + + if (!Comps[i]) + continue; + + ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), color, Comps[i]->GetFullName().c_str()); } } -void UnlockAllEffigies() { - SDK::APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); - if (!pPalCharacter) +// credit: +void UnlockAllEffigies() +{ + APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + APalPlayerState* pPalPlayerState = Config.GetPalPlayerState(); + if (!pPalCharacter || !pPalPlayerState) return; - SDK::UWorld* world = Config.GetUWorld(); + UWorld* world = Config.GetUWorld(); if (!world) return; - SDK::TUObjectArray* objects = world->GObjects; + TUObjectArray* objects = world->GObjects; - for (int i = 0; i < objects->NumElements; ++i) { - SDK::UObject* object = objects->GetByIndex(i); + for (int i = 0; i < objects->NumElements; ++i) + { + UObject* object = objects->GetByIndex(i); - if (!object) { + if (!object) continue; - } - if (!object->IsA(SDK::APalLevelObjectRelic::StaticClass())) { + if (!object->IsA(APalLevelObjectRelic::StaticClass())) continue; - } - SDK::APalLevelObjectObtainable* relic = (SDK::APalLevelObjectObtainable*)object; + APalLevelObjectObtainable* relic = (APalLevelObjectObtainable*)object; if (!relic) { continue; } - ((SDK::APalPlayerState*)pPalCharacter->PlayerState)->RequestObtainLevelObject_ToServer(relic); + pPalPlayerState->RequestObtainLevelObject_ToServer(relic); } } -void ResetStamina() -{ - APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); - if (!pPalCharacter) - return; - - UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent; - if (!pParams) - return; - - pParams->ResetSP(); -} - -void SetInfiniteAmmo(bool bInfAmmo) -{ - APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); - if (!pPalCharacter) - return; - - UPalShooterComponent* pShootComponent = pPalCharacter->ShooterComponent; - if (!pShootComponent) - return; - - APalWeaponBase* pWeapon = pShootComponent->HasWeapon; - if (pWeapon) - pWeapon->IsRequiredBullet = bInfAmmo ? false : true; - -} - -void SetCraftingSpeed(float mNewSpeed, bool bRestoreDefault) -{ - APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); - if (!pPalCharacter) - return; - - UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent; - if (!pParams) - return; - - UPalIndividualCharacterParameter* ivParams = pParams->IndividualParameter; - if (!ivParams) - return; - - FPalIndividualCharacterSaveParameter sParams = ivParams->SaveParameter; - TArray mCraftSpeedArray = sParams.CraftSpeedRates.Values; - - if (mCraftSpeedArray.Count() > 0) - mCraftSpeedArray[0].Value = bRestoreDefault ? 1.0f : mNewSpeed; -} - -void AddTechPoints(__int32 mPoints) -{ - APalPlayerState* mPlayerState = Config.GetPalPlayerState(); - if (!mPlayerState) - return; - - UPalTechnologyData* pTechData = mPlayerState->TechnologyData; - if (!pTechData) - return; - - pTechData->TechnologyPoint += mPoints; -} - -void AddAncientTechPoints(__int32 mPoints) -{ - APalPlayerState* mPlayerState = Config.GetPalPlayerState(); - if (!mPlayerState) - return; - - UPalTechnologyData* pTechData = mPlayerState->TechnologyData; - if (!pTechData) - return; - - pTechData->bossTechnologyPoint += mPoints; -} - -void RemoveTechPoints(__int32 mPoints) -{ - APalPlayerState* mPlayerState = Config.GetPalPlayerState(); - if (!mPlayerState) - return; - - UPalTechnologyData* pTechData = mPlayerState->TechnologyData; - if (!pTechData) - return; - - pTechData->TechnologyPoint -= mPoints; -} - -void RemoveAncientTechPoint(__int32 mPoints) -{ - APalPlayerState* mPlayerState = Config.GetPalPlayerState(); - if (!mPlayerState) - return; - - UPalTechnologyData* pTechData = mPlayerState->TechnologyData; - if (!pTechData) - return; - - pTechData->bossTechnologyPoint -= mPoints; -} - // Credit: BennettStaley -void AddToInventoryContainer(__int32 mCount, __int32 mIndex) +void IncrementInventoryItemCountByIndex(__int32 mCount, __int32 mIndex) { APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); if (!p_appc != NULL) @@ -257,4 +159,333 @@ void AddToInventoryContainer(__int32 mCount, __int32 mIndex) __int32 StackCount = pSelectedSlot->GetStackCount(); __int32 mNewCount = StackCount += mCount; InventoryData->RequestAddItem(FirstItemId.StaticId, mNewCount, true); -} \ No newline at end of file +} + +// +void AddItemToInventoryByName(UPalPlayerInventoryData* data, char* itemName, int count) +{ + // obtain lib instance + static UKismetStringLibrary* lib = UKismetStringLibrary::GetDefaultObj(); + + // Convert FNAME + wchar_t ws[255]; + swprintf(ws, 255, L"%hs", itemName); + FName Name = lib->Conv_StringToName(FString(ws)); + + // Call + data->RequestAddItem(Name, count, true); +} + +// Credit: asashi +void SpawnMultiple_ItemsToInventory(config::QuickItemSet Set) +{ + SDK::UPalPlayerInventoryData* InventoryData = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GetInventoryData(); + switch (Set) + { + case 0: + for (int i = 0; i < IM_ARRAYSIZE(database::basic_items_stackable); i++) + AddItemToInventoryByName(InventoryData, _strdup(database::basic_items_stackable[i].c_str()), 100); + break; + case 1: + for (int i = 0; i < IM_ARRAYSIZE(database::basic_items_single); i++) + AddItemToInventoryByName(InventoryData, _strdup(database::basic_items_single[i].c_str()), 1); + break; + case 2: + for (int i = 0; i < IM_ARRAYSIZE(database::pal_unlock_skills); i++) + AddItemToInventoryByName(InventoryData, _strdup(database::pal_unlock_skills[i].c_str()), 1); + break; + case 3: + for (int i = 0; i < IM_ARRAYSIZE(database::spheres); i++) + AddItemToInventoryByName(InventoryData, _strdup(database::spheres[i].c_str()), 100); + break; + case 4: + for (int i = 0; i < IM_ARRAYSIZE(database::tools); i++) + AddItemToInventoryByName(InventoryData, _strdup(database::tools[i].c_str()), 1); + break; + default: + break; + } +} + +// +void AnyWhereTP(FVector& vector, bool IsSafe) +{ + APalPlayerState* pPalPlayerState = Config.GetPalPlayerState(); + APalPlayerController* pPalPlayerController = Config.GetPalPlayerController(); + if (!pPalPlayerController || !pPalPlayerState) + return; + + vector = { vector.X,vector.Y + 100,vector.Z }; + FGuid guid = pPalPlayerController->GetPlayerUId(); + pPalPlayerController->Transmitter->Player->RegisterRespawnLocation_ToServer(guid, vector); + pPalPlayerState->RequestRespawn(); +} + +// +void ExploitFly(bool IsFly) +{ + SDK::APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + if (!pPalPlayerCharacter) + return; + + APalPlayerController* pPalPlayerController = pPalPlayerCharacter->GetPalPlayerController(); + if (!pPalPlayerController) + return; + + IsFly ? pPalPlayerController->StartFlyToServer() : pPalPlayerController->EndFlyToServer(); +} + +// +void SpeedHack(float mSpeed) +{ + UWorld* pWorld = Config.gWorld; + if (!pWorld) + return; + + AWorldSettings* pWorldSettings = pWorld->K2_GetWorldSettings(); + if (!pWorldSettings) + return; + + pWorldSettings->TimeDilation = mSpeed; +} + +// +void SetDemiGodMode(bool bIsSet) +{ + auto pCharacter = Config.GetPalPlayerCharacter(); + if (!pCharacter) + return; + + auto pParams = pCharacter->CharacterParameterComponent; + if (!pParams) + return; + + auto mIVs = pParams->IndividualParameter; + if (!mIVs) + return; + + auto sParams = mIVs->SaveParameter; + + pParams->bIsEnableMuteki = bIsSet; // Credit: Mokobake + if (!bIsSet) + return; + + // attempt additional parameters + sParams.HP.Value = sParams.MaxHP.Value; + sParams.MP.Value = sParams.MaxMP.Value; + sParams.FullStomach = sParams.MaxFullStomach; + sParams.PhysicalHealth = EPalStatusPhysicalHealthType::Healthful; + sParams.SanityValue = 100.f; + sParams.HungerType = EPalStatusHungerType::Default; +} + +// +void RespawnLocalPlayer(bool bIsSafe) +{ + APalPlayerController* pPalPlayerController = Config.GetPalPlayerController(); + APalPlayerState* pPalPlayerState = Config.GetPalPlayerState(); + if (!pPalPlayerController || !pPalPlayerState) + return; + + bIsSafe ? pPalPlayerController->TeleportToSafePoint_ToServer() : pPalPlayerState->RequestRespawn(); +} + +// +void ReviveLocalPlayer() +{ + APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + if (!pPalPlayerCharacter) + return; + + FFixedPoint newHealthPoint = FFixedPoint(99999999); + pPalPlayerCharacter->ReviveCharacter_ToServer(newHealthPoint); + +} + +// +void ResetStamina() +{ + APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + if (!pPalCharacter) + return; + + UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent; + if (!pParams) + return; + + pParams->ResetSP(); +} + +// +void GiveExperiencePoints(__int32 mXP) +{ + auto pPalPlayerState = Config.GetPalPlayerState(); + if (!pPalPlayerState) + return; + + pPalPlayerState->GrantExpForParty(mXP); +} + +// +void SetPlayerAttackParam(__int32 mNewAtk) +{ + APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + if (!pPalPlayerCharacter) + return; + + UPalCharacterParameterComponent* pParams = pPalPlayerCharacter->CharacterParameterComponent; + if (!pParams) + return; + + if (pParams->AttackUp != mNewAtk) + pParams->AttackUp = mNewAtk; +} + +// +void SetPlayerDefenseParam(__int32 mNewDef) +{ + APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + if (!pPalPlayerCharacter) + return; + + UPalCharacterParameterComponent* pParams = pPalPlayerCharacter->CharacterParameterComponent; + if (!pParams) + return; + + if (pParams->DefenseUp != mNewDef) + pParams->DefenseUp = mNewDef; +} + +// +void SetInfiniteAmmo(bool bInfAmmo) +{ + APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + if (!pPalCharacter) + return; + + UPalShooterComponent* pShootComponent = pPalCharacter->ShooterComponent; + if (!pShootComponent) + return; + + APalWeaponBase* pWeapon = pShootComponent->HasWeapon; + if (pWeapon) + pWeapon->IsRequiredBullet = bInfAmmo ? false : true; + +} + +// +void SetCraftingSpeed(float mNewSpeed, bool bRestoreDefault) +{ + APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + if (!pPalCharacter) + return; + + UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent; + if (!pParams) + return; + + UPalIndividualCharacterParameter* ivParams = pParams->IndividualParameter; + if (!ivParams) + return; + + FPalIndividualCharacterSaveParameter sParams = ivParams->SaveParameter; + TArray mCraftSpeedArray = sParams.CraftSpeedRates.Values; + + if (mCraftSpeedArray.Count() > 0) + mCraftSpeedArray[0].Value = bRestoreDefault ? 1.0f : mNewSpeed; +} + +// +void AddTechPoints(__int32 mPoints) +{ + APalPlayerState* mPlayerState = Config.GetPalPlayerState(); + if (!mPlayerState) + return; + + UPalTechnologyData* pTechData = mPlayerState->TechnologyData; + if (!pTechData) + return; + + pTechData->TechnologyPoint += mPoints; +} + +// +void AddAncientTechPoints(__int32 mPoints) +{ + APalPlayerState* mPlayerState = Config.GetPalPlayerState(); + if (!mPlayerState) + return; + + UPalTechnologyData* pTechData = mPlayerState->TechnologyData; + if (!pTechData) + return; + + pTechData->bossTechnologyPoint += mPoints; +} + +// +void RemoveTechPoints(__int32 mPoints) +{ + APalPlayerState* mPlayerState = Config.GetPalPlayerState(); + if (!mPlayerState) + return; + + UPalTechnologyData* pTechData = mPlayerState->TechnologyData; + if (!pTechData) + return; + + pTechData->TechnologyPoint -= mPoints; +} + +// +void RemoveAncientTechPoint(__int32 mPoints) +{ + APalPlayerState* mPlayerState = Config.GetPalPlayerState(); + if (!mPlayerState) + return; + + UPalTechnologyData* pTechData = mPlayerState->TechnologyData; + if (!pTechData) + return; + + pTechData->bossTechnologyPoint -= mPoints; +} + + +/// OLDER METHODS +//SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo(); +//SDK::TArray EA = { 0U }; +//void SpawnPal(char* PalName, bool IsMonster, int rank=1, int lvl = 1, int count=1) +//{ +// SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); +// +// //Convert FNAME +// wchar_t ws[255]; +// swprintf(ws, 255, L"%hs", PalName); +// SDK::FName Name = lib->Conv_StringToName(SDK::FString(ws)); +// //Call +// if (Config.GetPalPlayerCharacter() != NULL) +// { +// if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) +// { +// if (Config.GetPalPlayerCharacter()->GetPalPlayerController()) +// { +// if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()) +// { +// if (IsMonster) +// { +// Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestSpawnMonsterForPlayer(Name, count, lvl); +// return; +// } +// EA[0] = SDK::EPalWazaID::AirCanon; +// palinfo.Level = lvl; +// palinfo.Rank = rank; +// palinfo.PalName.Key = Name; +// palinfo.WazaList = EA; +// palinfo.PassiveSkill = NULL; +// Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->Debug_CaptureNewMonsterByDebugOtomoInfo_ToServer(palinfo); +// } +// } +// } +// } +//} \ No newline at end of file diff --git a/feature.h b/feature.h index 4c65e56..e10920c 100644 --- a/feature.h +++ b/feature.h @@ -5,16 +5,38 @@ void ESP(); -void ESP_DEBUG(float mDist, ImVec4 color, SDK::UClass* mEntType = SDK::AActor::StaticClass()); +void ESP_DEBUG(float mDist, ImVec4 color = { 1.0f, 0.0f, 0.0f, 01.0f }, SDK::UClass* mEntType = SDK::AActor::StaticClass()); void DrawUActorComponent(SDK::TArray Comps, ImColor color); void UnlockAllEffigies(); -void AddToInventoryContainer(__int32 mCount, __int32 mIndex = 0); +void IncrementInventoryItemCountByIndex(__int32 mCount, __int32 mIndex = 0); + +void AddItemToInventoryByName(SDK::UPalPlayerInventoryData* data, char* itemName, int count); + +void SpawnMultiple_ItemsToInventory(config::QuickItemSet Set); + +void AnyWhereTP(SDK::FVector& vector, bool IsSafe); + +void ExploitFly(bool IsFly); + +void SpeedHack(float mSpeed); + +void SetDemiGodMode(bool bIsSet); + +void RespawnLocalPlayer(bool bIsSafe); + +void ReviveLocalPlayer(); void ResetStamina(); +void GiveExperiencePoints(__int32 mXP); + +void SetPlayerAttackParam(__int32 mNewAtk); + +void SetPlayerDefenseParam(__int32 mNewDef); + void SetInfiniteAmmo(bool bInfAmmo); void SetCraftingSpeed(float mNewSpeed, bool bRestoreDefault = false); diff --git a/include/Console.hpp b/include/Console.hpp index 2fb8d90..b5bc4ec 100644 --- a/include/Console.hpp +++ b/include/Console.hpp @@ -2,27 +2,30 @@ #include "helper.h" namespace DX11_Base { - struct Colors { - int dark_blue = 1; - int dark_green = 2; - int dark_teal = 3; - int dark_red = 4; - int dark_pink = 5; - int dark_yellow = 6; - int dark_white = 7; - int dark_gray = 8; - int blue = 9; - int green = 10; - int teal = 11; - int red = 12; - int pink = 13; - int yellow = 14; - int white = 15; - int DEFAULT = 15; - }; class Console { + public: + enum Colors + { + dark_blue = 1, + dark_green, + dark_teal, + dark_red, + dark_pink, + dark_yellow, + dark_white, + dark_gray, + blue, + green, + teal, + red, + pink, + yellow , + white, + DEFAULT = white, + }; + public: FILE* stream_in{}; FILE* stream_out{}; diff --git a/include/helper.h b/include/helper.h index 1ed690c..cb21236 100644 --- a/include/helper.h +++ b/include/helper.h @@ -1,5 +1,5 @@ #pragma once -#define DEBUG 1 +#define DEBUG 0 // External Libraries #include "../libs/ImGui/imgui.h" @@ -7,7 +7,8 @@ #include "../libs/ImGui/imgui_Impl_dx11.h" #include "../libs/ImGui/imgui_Impl_Win32.h" -namespace DX11_Base { +namespace DX11_Base +{ using namespace std::chrono_literals; inline HMODULE g_hModule{}; inline LPCWSTR g_ModuleName{}; diff --git a/initialize.hpp b/initialize.hpp index ece6783..b378574 100644 --- a/initialize.hpp +++ b/initialize.hpp @@ -21,7 +21,7 @@ DWORD WINAPI MainThread_Initialize() g_Console = std::make_unique(); #if DEBUG g_Console->InitializeConsole("Debug Console"); - g_Console->printdbg("ImGui Hook - Initializing . . .\n\n", g_Console->color.DEFAULT); + g_Console->printdbg("ImGui Hook - Initializing . . .\n\n", Console::Colors::DEFAULT); #endif /// ESTABLISH GAME DATA g_GameData = std::make_unique(); @@ -34,7 +34,7 @@ DWORD WINAPI MainThread_Initialize() g_Hooking->Hook(); #if DEBUG - g_Console->printdbg("Main::Initialized\n", g_Console->color.green); + g_Console->printdbg("Main::Initialized\nUWorld:\t0x%llX\n", Console::Colors::green, Config.gWorld); #endif std::thread WCMUpdate(ClientBGThread); // Initialize Loops Thread diff --git a/src/Console.cpp b/src/Console.cpp index e9d7fd1..628b173 100644 --- a/src/Console.cpp +++ b/src/Console.cpp @@ -26,7 +26,7 @@ namespace DX11_Base { va_start(arg, Color); vfprintf(stream_out, Text, arg); va_end(arg); - SetConsoleTextAttribute(g_Handle, color.DEFAULT); + SetConsoleTextAttribute(g_Handle, Colors::DEFAULT); return; } @@ -47,13 +47,13 @@ namespace DX11_Base { switch (FLAG) { case(TRUE): output = " [ON]\n"; - color = g_Console->color.green; + color = Colors::green; append = TEXT + output; printdbg(append.c_str(), color); break; case(FALSE): output = " [OFF]\n"; - color = g_Console->color.red; + color = Colors::red; append = TEXT + output; printdbg(append.c_str(), color); break; diff --git a/src/D3D11Window.cpp b/src/D3D11Window.cpp index ca9bc51..c2d1eb0 100644 --- a/src/D3D11Window.cpp +++ b/src/D3D11Window.cpp @@ -60,12 +60,12 @@ namespace DX11_Base { CreateHook(12, (void**)&oID3D11DrawIndexed, MJDrawIndexed); Sleep(1000); #if DEBUG - g_Console->printdbg("D3D11Window::Hook Initialized\n", g_Console->color.pink); + g_Console->printdbg("D3D11Window::Hook Initialized\n", Console::Colors::pink); #endif return TRUE; } #if DEBUG - g_Console->printdbg("[+] D3D11Window::Hook Failed to Initialize\n", g_Console->color.red); + g_Console->printdbg("[+] D3D11Window::Hook Failed to Initialize\n", Console::Colors::red); #endif return FALSE; } @@ -165,7 +165,7 @@ namespace DX11_Base { return FALSE; } #if DEBUG - g_Console->printdbg("D3D11Window::Window Created\n", g_Console->color.pink); + g_Console->printdbg("D3D11Window::Window Created\n", Console::Colors::pink); #endif return TRUE; } @@ -178,7 +178,7 @@ namespace DX11_Base { return FALSE; } #if DEBUG - g_Console->printdbg("D3D11Window::Window Destroyed\n", g_Console->color.pink); + g_Console->printdbg("D3D11Window::Window Destroyed\n", Console::Colors::pink); #endif return TRUE; } @@ -209,7 +209,7 @@ namespace DX11_Base { m_OldWndProc = (WNDPROC)SetWindowLongPtr(g_GameVariables->g_GameWindow, GWLP_WNDPROC, (__int3264)(LONG_PTR)WndProc); b_ImGui_Initialized = TRUE; #if DEBUG - g_Console->printdbg("D3D11Window::Swapchain Initialized\n", g_Console->color.pink); + g_Console->printdbg("D3D11Window::Swapchain Initialized\n", Console::Colors::pink); #endif return 1; } diff --git a/src/Game.cpp b/src/Game.cpp index f4ee4a8..29114ed 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -4,7 +4,7 @@ namespace DX11_Base { GameData::GameData() { #if DEBUG - g_Console->printdbg("GameData::Initialized\n", g_Console->color.pink); + g_Console->printdbg("GameData::Initialized\n", Console::Colors::pink); #endif return; } @@ -12,7 +12,7 @@ namespace DX11_Base { GameVariables::GameVariables() { #if DEBUG - g_Console->printdbg("GameVariables::Initialized\n", g_Console->color.pink); + g_Console->printdbg("GameVariables::Initialized\n", Console::Colors::pink); #endif return; } @@ -41,7 +41,7 @@ namespace DX11_Base { GetModuleFileNameExA(g_GameHandle, NULL, tempPath, sizeof(tempPath)); g_GamePath = tempPath; #if DEBUG - g_Console->printdbg("GameData::Init - Process Window Info Established\n", g_Console->color.pink); + g_Console->printdbg("GameData::Init - Process Window Info Established\n", Console::Colors::pink); #endif } } \ No newline at end of file diff --git a/src/Hooking.cpp b/src/Hooking.cpp index 16cc46c..37b084d 100644 --- a/src/Hooking.cpp +++ b/src/Hooking.cpp @@ -5,7 +5,7 @@ namespace DX11_Base { { MH_Initialize(); #if DEBUG - g_Console->printdbg("Hooking::Initialized\n", g_Console->color.pink); + g_Console->printdbg("Hooking::Initialized\n", Console::Colors::pink); #endif return; } @@ -23,7 +23,7 @@ namespace DX11_Base { Config.Init(); MH_EnableHook(MH_ALL_HOOKS); #if DEBUG - g_Console->printdbg("Hooking::Hook Initialized\n", g_Console->color.pink); + g_Console->printdbg("Hooking::Hook Initialized\n", Console::Colors::pink); #endif return; } diff --git a/src/Menu.cpp b/src/Menu.cpp index b0214bf..c85ef9d 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -36,122 +36,14 @@ int InputTextCallback(ImGuiInputTextCallbackData* data) { return 0; } -//SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo(); -//SDK::TArray EA = { 0U }; -//void SpawnPal(char* PalName, bool IsMonster, int rank=1, int lvl = 1, int count=1) -//{ -// SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); -// -// //Convert FNAME -// wchar_t ws[255]; -// swprintf(ws, 255, L"%hs", PalName); -// SDK::FName Name = lib->Conv_StringToName(SDK::FString(ws)); -// //Call -// if (Config.GetPalPlayerCharacter() != NULL) -// { -// if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) -// { -// if (Config.GetPalPlayerCharacter()->GetPalPlayerController()) -// { -// if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()) -// { -// if (IsMonster) -// { -// Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestSpawnMonsterForPlayer(Name, count, lvl); -// return; -// } -// EA[0] = SDK::EPalWazaID::AirCanon; -// palinfo.Level = lvl; -// palinfo.Rank = rank; -// palinfo.PalName.Key = Name; -// palinfo.WazaList = EA; -// palinfo.PassiveSkill = NULL; -// Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->Debug_CaptureNewMonsterByDebugOtomoInfo_ToServer(palinfo); -// } -// } -// } -// } -//} -void AddItem(SDK::UPalPlayerInventoryData* data,char* itemName, int count) -{ - SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); - //Convert FNAME - wchar_t ws[255]; - swprintf(ws, 255, L"%hs",itemName); - SDK::FName Name = lib->Conv_StringToName(SDK::FString(ws)); - //Call - data->RequestAddItem(Name, count, true); -} -void AnyWhereTP(SDK::FVector& vector,bool IsSafe) +namespace DX11_Base { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { + // helper variables + char inputBuffer_getFnAddr[100]; - SDK::FGuid guid = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPlayerUId(); - vector = { vector.X,vector.Y + 100,vector.Z }; - Config.GetPalPlayerCharacter()->GetPalPlayerController()->Transmitter->Player->RegisterRespawnLocation_ToServer(guid, vector); - Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestRespawn(); - } - return; -} -void ExploitFly(bool IsFly) -{ - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) + namespace Styles { - if (IsFly) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->StartFlyToServer(); - } - } - else - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->EndFlyToServer(); - } - } - - } - return; -} -void Spawn_Multiple(config::QuickItemSet Set) -{ - SDK::UPalPlayerInventoryData * InventoryData = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GetInventoryData(); - switch (Set) - { - case 0: - for (int i = 0; i < IM_ARRAYSIZE(database::basic_items_stackable); i++) { - AddItem(InventoryData, _strdup(database::basic_items_stackable[i].c_str()), 100); - } - case 1: - for (int i = 0; i < IM_ARRAYSIZE(database::basic_items_single); i++) - { - AddItem(InventoryData, _strdup(database::basic_items_single[i].c_str()), 1); - } - case 2: - for (int i = 0; i < IM_ARRAYSIZE(database::pal_unlock_skills); i++) { - AddItem(InventoryData, _strdup(database::pal_unlock_skills[i].c_str()), 1); - } - case 3: - for (int i = 0; i < IM_ARRAYSIZE(database::spheres); i++) { - AddItem(InventoryData, _strdup(database::spheres[i].c_str()), 100); - } - case 4: - for (int i = 0; i < IM_ARRAYSIZE(database::tools); i++) { - AddItem(InventoryData, _strdup(database::tools[i].c_str()), 1); - } - default: - break; - } -}//Creadit:asashi - -namespace DX11_Base { - - namespace Styles { void InitStyle() { ImGuiStyle& style = ImGui::GetStyle(); @@ -159,29 +51,26 @@ namespace DX11_Base { // STYLE PROPERTIES style.WindowTitleAlign = ImVec2(0.5f, 0.5f); - - // Base ImGui Styling , Aplying a custyom style is left up to you. ImGui::StyleColorsClassic(); - /// EXAMPLE COLOR - //colors[ImGuiCol_FrameBg] = ImVec4(0, 0, 0, 0); - - // COLORS - if (g_Menu->dbg_RAINBOW_THEME) { + if (g_Menu->dbg_RAINBOW_THEME) + { // RGB MODE STLYE PROPERTIES colors[ImGuiCol_Separator] = ImVec4(g_Menu->dbg_RAINBOW); colors[ImGuiCol_TitleBg] = ImVec4(0, 0, 0, 1.0f); colors[ImGuiCol_TitleBgActive] = ImVec4(0, 0, 0, 1.0f); colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0, 0, 0, 1.0f); } - else { + else + { /// YOUR DEFAULT STYLE PROPERTIES HERE } } } - namespace Tabs { + namespace Tabs + { void TABPlayer() { @@ -229,16 +118,8 @@ namespace DX11_Base { ImGui::SliderFloat("SpeedModifilers", &Config.SpeedModiflers, 1, 10); ImGui::SliderInt("AttackModifilers", &Config.DamageUp, 0, 200000); ImGui::SliderInt("defenseModifilers", &Config.DefuseUp, 0, 200000); - - if (ImGui::Button("PrintPlayerAddr", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - g_Console->printdbg("\n\n[+] APalPlayerCharacter: %x [+]\n\n", g_Console->color.green, p_appc); - } - } } + void TABExploit() { //Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestSpawnMonsterForPlayer(name, 5, 1); @@ -253,23 +134,14 @@ namespace DX11_Base { if (ImGui::Button("Give item", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) + SDK::APalPlayerState* p_apps = Config.GetPalPlayerState(); + if (p_appc && p_apps) { - - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) + SDK::UPalPlayerInventoryData* InventoryData = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GetInventoryData(); + if (InventoryData && (Config.ItemName != NULL)) { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - SDK::UPalPlayerInventoryData* InventoryData = Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GetInventoryData(); - if (InventoryData != NULL) - { - if (Config.ItemName != NULL) - { - g_Console->printdbg("\n\n[+] ItemName: %s [+]\n\n", g_Console->color.green, Config.ItemName); - AddItem(InventoryData, Config.ItemName, Config.Item); - } - } - } + g_Console->printdbg("\n\n[+] ItemName: %s [+]\n\n", Console::Colors::green, Config.ItemName); + AddItemToInventoryByName(InventoryData, Config.ItemName, Config.Item); } } } @@ -278,22 +150,20 @@ namespace DX11_Base { ImGui::InputInt("Multiple of how much:", &Config.AddItemCount); if (ImGui::Button("Give items from slot", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - AddToInventoryContainer(Config.AddItemCount, Config.AddItemSlot); - } + IncrementInventoryItemCountByIndex(Config.AddItemCount, Config.AddItemSlot); // this does not work lol // std::stringstream AddItemsString; // AddItemsString << "Give " << Config.AddItemCount << " items from slot" << Config.AddItemSlot; if (ImGui::Button("Unlock All Effigies", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { UnlockAllEffigies(); - } + if (ImGui::Button("ToggleFly", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { Config.IsToggledFly = !Config.IsToggledFly; ExploitFly(Config.IsToggledFly); } + /*if (ImGui::Button("DeleteSelf", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20))) { SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); @@ -308,42 +178,15 @@ namespace DX11_Base { } } }*/ + if (ImGui::Button("GodHealth", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - SDK::FFixedPoint fixpoint = SDK::FFixedPoint(); - fixpoint.Value = 99999999; - Config.GetPalPlayerCharacter()->ReviveCharacter_ToServer(fixpoint); - - } - } - } - } + ReviveLocalPlayer(); + //Creadit WoodgamerHD - if(ImGui::Button("Give exp", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - if (Config.EXP >= 0) - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->GrantExpForParty(Config.EXP); - } - } - } - } - } + if (ImGui::Button("Give exp", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + GiveExperiencePoints(Config.EXP); } + void TABConfig() { @@ -355,12 +198,13 @@ namespace DX11_Base { ImGui::Spacing(); if (ImGui::Button("UNHOOK DLL", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { #if DEBUG - g_Console->printdbg("\n\n[+] UNHOOK INITIALIZED [+]\n\n", g_Console->color.red); + g_Console->printdbg("\n\n[+] UNHOOK INITIALIZED [+]\n\n", Console::Colors::red); #endif g_KillSwitch = TRUE; } } + void TABDatabase() { //ImGui::Checkbox("IsItems", &Config.matchDbItems); @@ -381,31 +225,13 @@ namespace DX11_Base { } } } + void TABTeleporter() { ImGui::Checkbox("SafeTeleport", &Config.IsSafe); if (ImGui::Button("Home", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - if (Config.IsSafe) - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->TeleportToSafePoint_ToServer(); - } - else - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestRespawn(); - } + RespawnLocalPlayer(Config.IsSafe); - } - } - } - } ImGui::InputFloat3("Pos",Config.Pos); ImGui::SameLine(); if (ImGui::Button("TP", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) @@ -413,46 +239,78 @@ namespace DX11_Base { SDK::FVector vector = { Config.Pos[0],Config.Pos[1],Config.Pos[2] }; AnyWhereTP(vector, Config.IsSafe); } - for (const auto& pair : database::locationMap) { + + for (const auto& pair : database::locationMap) + { const std::string& locationName = pair.first; - if (ImGui::Button(locationName.c_str())) { + if (ImGui::Button(locationName.c_str())) + { SDK::FVector location = SDK::FVector(pair.second[0], pair.second[1], pair.second[2]); AnyWhereTP(location, Config.IsSafe); } } } - void TABQuick()//Creadit:asashi + + void TABQuick() { - if (ImGui::Button("Basic Items stack", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { - Spawn_Multiple(config::QuickItemSet::basic_items_stackable); + if (ImGui::Button("Basic Items stack", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + SpawnMultiple_ItemsToInventory(config::QuickItemSet::basic_items_stackable); + + if (ImGui::Button("Basic Items single", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + SpawnMultiple_ItemsToInventory(config::QuickItemSet::basic_items_single); + + if (ImGui::Button("Unlock Pal skills", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + SpawnMultiple_ItemsToInventory(config::QuickItemSet::pal_unlock_skills); + + if (ImGui::Button("Spheres", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + SpawnMultiple_ItemsToInventory(config::QuickItemSet::spheres); + + if (ImGui::Button("Tools", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + SpawnMultiple_ItemsToInventory(config::QuickItemSet::tools); + } + + void TABDebug() + { + + // @TODO: print additional debug information + if (ImGui::Button("PrintPlayerAddr", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + { + SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); + if (p_appc != NULL) + { + g_Console->printdbg("\n\n[+] APalPlayerCharacter: %x [+]\n\n", Console::Colors::green, p_appc); } - if (ImGui::Button("Basic Items single", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { - Spawn_Multiple(config::QuickItemSet::basic_items_single); - } - if (ImGui::Button("Unlock Pal skills", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { - Spawn_Multiple(config::QuickItemSet::pal_unlock_skills); - } - if (ImGui::Button("Spheres", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { - Spawn_Multiple(config::QuickItemSet::spheres); - } - if (ImGui::Button("Tools", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) { - Spawn_Multiple(config::QuickItemSet::tools); + } + + ImGui::InputTextWithHint("##INPUT", "INPUT GOBJECT fn NAME", inputBuffer_getFnAddr, 100); + ImGui::SameLine(); + if (ImGui::Button("GET fn", ImVec2(ImGui::GetContentRegionAvail().x, 20))) + { + std::string input = inputBuffer_getFnAddr; + SDK::UFunction* object = SDK::UObject::FindObject(input); + if (object) + { + static __int64 dwHandle = reinterpret_cast<__int64>(GetModuleHandle(0)); + void* fnAddr = object->ExecFunction; + unsigned __int64 fnOffset = (reinterpret_cast<__int64>(fnAddr) - dwHandle); + g_Console->printdbg("[+] Found %s @ 0x%llX\n", Console::Colors::yellow, input.c_str(), fnOffset); + } + } + } } void Menu::Draw() { if (Config.IsESP) - { ESP(); - } + if (g_GameVariables->m_ShowMenu) MainMenu(); + if (Config.bisOpenManager && g_GameVariables->m_ShowMenu) - { ManagerMenu(); - } if (g_GameVariables->m_ShowHud) HUD(&g_GameVariables->m_ShowHud); @@ -463,118 +321,133 @@ namespace DX11_Base { if (Config.isDebugESP) ESP_DEBUG(Config.mDebugESPDistance, ImVec4(0,1,0,1)); } + void Menu::ManagerMenu() { - if (ImGui::Begin("Manager", &g_GameVariables->m_ShowMenu, 96)) + if (!ImGui::Begin("Manager", &g_GameVariables->m_ShowMenu, 96)) { - if (Config.GetUWorld() != NULL) + ImGui::End(); + return; + } + + + if (Config.gWorld) + { + ImGui::Checkbox("filterPlayer", &Config.filterPlayer); + SDK::TArray T = Config.GetUWorld()->PersistentLevel->Actors; + for (int i = 0; i < T.Count(); i++) { - ImGui::Checkbox("filterPlayer", &Config.filterPlayer); - SDK::TArray T = Config.GetUWorld()->PersistentLevel->Actors; - for (int i = 0; i < T.Count(); i++) + if (!T[i]) + continue; + + if (!T[i]->IsA(SDK::APalCharacter::StaticClass())) + continue; + + SDK::APalCharacter* Character = (SDK::APalCharacter*)T[i]; + SDK::FString name; + if (Config.filterPlayer) { - if (T[i] != NULL) + if (!T[i]->IsA(SDK::APalPlayerCharacter::StaticClass())) + continue; + } + if (T[i]->IsA(SDK::APalPlayerCharacter::StaticClass())) + { + if (!Character) + continue; + + Character->CharacterParameterComponent->GetNickname(&name); + } + else + { + SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); + if (!Character) + continue; + + std::string s = Character->GetFullName(); + size_t firstUnderscorePos = s.find('_'); + + if (firstUnderscorePos != std::string::npos) { - if (T[i]->IsA(SDK::APalCharacter::StaticClass())) + std::string result = s.substr(firstUnderscorePos + 1); + + size_t secondUnderscorePos = result.find('_'); + + if (secondUnderscorePos != std::string::npos) { + result = result.substr(0, secondUnderscorePos); + } + wchar_t ws[255]; + swprintf(ws, 255, L"%hs", result); + name = SDK::FString(ws); + } + } + ImGui::Text(name.ToString().c_str()); + ImGui::SameLine(); + ImGui::PushID(i); + if (ImGui::Button("Kill")) + { + if (T[i]->IsA(SDK::APalCharacter::StaticClass())) + Damage(Character, 99999999999); + } + ImGui::SameLine(); + if (ImGui::Button("TP")) + { + if (Config.GetPalPlayerCharacter() != NULL) + { + if (Character) { - SDK::APalCharacter* Character = (SDK::APalCharacter*)T[i]; - SDK::FString name; - if (Config.filterPlayer) - { - if (!T[i]->IsA(SDK::APalPlayerCharacter::StaticClass())) - { - continue; - } - } - if (T[i]->IsA(SDK::APalPlayerCharacter::StaticClass())) - { - if (!Character) { continue; } - Character->CharacterParameterComponent->GetNickname(&name); - } - else - { - SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); - if (!Character) { continue; } - std::string s = Character->GetFullName(); - size_t firstUnderscorePos = s.find('_'); - - if (firstUnderscorePos != std::string::npos) { - std::string result = s.substr(firstUnderscorePos + 1); - - size_t secondUnderscorePos = result.find('_'); - - if (secondUnderscorePos != std::string::npos) { - result = result.substr(0, secondUnderscorePos); - } - wchar_t ws[255]; - swprintf(ws, 255, L"%hs", result); - name = SDK::FString(ws); - } - } - ImGui::Text(name.ToString().c_str()); - ImGui::SameLine(); - ImGui::PushID(i); - if (ImGui::Button("Kill")) - { - if (T[i]->IsA(SDK::APalCharacter::StaticClass())) - { - Damage(Character, 99999999999); - } - continue; - } - ImGui::SameLine(); - if (ImGui::Button("TP")) - { - if (Config.GetPalPlayerCharacter() != NULL) - { - if (!Character) { continue; } - SDK::FVector vector = Character->K2_GetActorLocation(); - AnyWhereTP(vector, Config.IsSafe); - } - } - - /*if (Character->IsA(SDK::APalPlayerCharacter::StaticClass())) - { - ImGui::SameLine(); - if (ImGui::Button("Boss")) - { - if (Config.GetPalPlayerCharacter() != NULL) - { - auto controller = Config.GetPalPlayerCharacter()->GetPalPlayerController(); - if (controller != NULL) - { - controller->Transmitter->BossBattle->RequestBossBattleEntry_ToServer(SDK::EPalBossType::ElectricBoss, (SDK::APalPlayerCharacter*)Character); - controller->Transmitter->BossBattle->RequestBossBattleStart_ToServer(SDK::EPalBossType::ElectricBoss, (SDK::APalPlayerCharacter*)Character); - } - } - } - }*/ - if (Character->IsA(SDK::APalPlayerCharacter::StaticClass())) - { - ImGui::SameLine(); - if (ImGui::Button("MaskIt")) - { - if (Config.GetPalPlayerCharacter() != NULL) - { - auto controller = Config.GetPalPlayerCharacter()->GetPalPlayerController(); - if (controller != NULL) - { - auto player = (SDK::APalPlayerCharacter*)Character; - SDK::FString fakename; - player->CharacterParameterComponent->GetNickname(&fakename); - Config.GetPalPlayerCharacter()->GetPalPlayerController()->Transmitter->NetworkIndividualComponent->UpdateCharacterNickName_ToServer(Config.GetPalPlayerCharacter()->CharacterParameterComponent->IndividualHandle->ID, fakename); - } - } - } - } - ImGui::PopID(); + SDK::FVector vector = Character->K2_GetActorLocation(); + AnyWhereTP(vector, Config.IsSafe); } } } + + /*if (Character->IsA(SDK::APalPlayerCharacter::StaticClass())) + { + ImGui::SameLine(); + if (ImGui::Button("Boss")) + { + if (Config.GetPalPlayerCharacter() != NULL) + { + auto controller = Config.GetPalPlayerCharacter()->GetPalPlayerController(); + if (controller != NULL) + { + controller->Transmitter->BossBattle->RequestBossBattleEntry_ToServer(SDK::EPalBossType::ElectricBoss, (SDK::APalPlayerCharacter*)Character); + controller->Transmitter->BossBattle->RequestBossBattleStart_ToServer(SDK::EPalBossType::ElectricBoss, (SDK::APalPlayerCharacter*)Character); + } + } + } + }*/ + if (Character->IsA(SDK::APalPlayerCharacter::StaticClass())) + { + ImGui::SameLine(); + if (ImGui::Button("MaskIt")) + { + if (Config.GetPalPlayerCharacter() != NULL) + { + auto controller = Config.GetPalPlayerCharacter()->GetPalPlayerController(); + if (controller != NULL) + { + auto player = (SDK::APalPlayerCharacter*)Character; + SDK::FString fakename; + player->CharacterParameterComponent->GetNickname(&fakename); + Config.GetPalPlayerCharacter()->GetPalPlayerController()->Transmitter->NetworkIndividualComponent->UpdateCharacterNickName_ToServer(Config.GetPalPlayerCharacter()->CharacterParameterComponent->IndividualHandle->ID, fakename); + } + } + } + } + ImGui::PopID(); } + } + + if (Config.GetUWorld() != NULL) + { + } + + ImGui::End(); } - void Menu::MainMenu() + + void Menu::MainMenu() { if (!g_GameVariables->m_ShowDemo) Styles::InitStyle(); @@ -602,41 +475,39 @@ namespace DX11_Base { if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None)) { - if (ImGui::BeginTabItem("Player")) - { - Tabs::TABPlayer(); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("EXPLOIT")) - { - Tabs::TABExploit(); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Database")) - { - Tabs::TABDatabase(); - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("CONFIG")) - { - Tabs::TABConfig(); - ImGui::EndTabItem(); - } - if (Config.IsQuick && ImGui::BeginTabItem("Quick")) - { - Tabs::TABQuick(); - ImGui::EndTabItem(); - } - if (Config.bisTeleporter && ImGui::BeginTabItem("Teleporter")) - { - Tabs::TABTeleporter(); - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); + if (ImGui::BeginTabItem("Player")) + { + Tabs::TABPlayer(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("EXPLOIT")) + { + Tabs::TABExploit(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Database")) + { + Tabs::TABDatabase(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("CONFIG")) + { + Tabs::TABConfig(); + ImGui::EndTabItem(); + } + if (Config.IsQuick && ImGui::BeginTabItem("Quick")) + { + Tabs::TABQuick(); + ImGui::EndTabItem(); + } + if (Config.bisTeleporter && ImGui::BeginTabItem("Teleporter")) + { + Tabs::TABTeleporter(); + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); } ImGui::End(); - - } void Menu::HUD(bool* p_open) @@ -645,94 +516,31 @@ namespace DX11_Base { void Menu::Loops() { + // Respawn if ((GetAsyncKeyState(VK_F5) & 1)) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - if (Config.IsSafe) - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->TeleportToSafePoint_ToServer(); - } - else - { - Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestRespawn(); + RespawnLocalPlayer(Config.IsSafe); - } - - } - } - } - } + // Revive Player if ((GetAsyncKeyState(VK_F6) & 1)) - { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) - { - if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) - { - SDK::FFixedPoint fixpoint = SDK::FFixedPoint(); - fixpoint.Value = 99999999; - Config.GetPalPlayerCharacter()->ReviveCharacter_ToServer(fixpoint); + ReviveLocalPlayer(); - } - } - } - } + // if (Config.IsSpeedHack) - { - if (Config.GetUWorld() - || Config.GetUWorld()->PersistentLevel - || Config.GetUWorld()->PersistentLevel->WorldSettings) - { - Config.GetUWorld()->PersistentLevel->WorldSettings->TimeDilation = Config.SpeedModiflers; - } - } + SpeedHack(Config.SpeedModiflers); + + // if (Config.IsAttackModiler) - { - if (Config.GetPalPlayerCharacter() != NULL && Config.GetPalPlayerCharacter()->CharacterParameterComponent->AttackUp != Config.DamageUp) - { - if (Config.GetPalPlayerCharacter()->CharacterParameterComponent != NULL) - { - Config.GetPalPlayerCharacter()->CharacterParameterComponent->AttackUp = Config.DamageUp; - } - } - } - //Creadit Mokobake - /** - if (Config.GetPalPlayerCharacter() != NULL) - { - if (Config.GetPalPlayerCharacter()->CharacterParameterComponent != NULL) - { - Config.GetPalPlayerCharacter()->CharacterParameterComponent->bIsEnableMuteki = Config.IsMuteki; - } - }**/ + SetPlayerDefenseParam(Config.DamageUp); + + // if (Config.IsDefuseModiler) - { - if (Config.GetPalPlayerCharacter() != NULL && Config.GetPalPlayerCharacter()->CharacterParameterComponent->DefenseUp != Config.DefuseUp) - { - if (Config.GetPalPlayerCharacter()->CharacterParameterComponent != NULL) - { - Config.GetPalPlayerCharacter()->CharacterParameterComponent->DefenseUp = Config.DefuseUp; - } - } - } + SetPlayerDefenseParam(Config.DefuseUp); + + // if (Config.IsInfStamina) - { - if (Config.GetPalPlayerCharacter() != NULL) - { - if (Config.GetPalPlayerCharacter()->CharacterParameterComponent != NULL) - { - Config.GetPalPlayerCharacter()->CharacterParameterComponent->ResetSP(); - } - } - } - + ResetStamina(); + + // + // SetDemiGodMode(Config.IsMuteki); } } \ No newline at end of file