diff --git a/config.cpp b/config.cpp index 3d02219..dbe1fa6 100644 --- a/config.cpp +++ b/config.cpp @@ -20,9 +20,9 @@ void config::Update(const char* filterText) } std::sort(Config.db_filteredItems.begin(), Config.db_filteredItems.end()); } -const std::vector& config::GetFilteredItems(){ return Config.db_filteredItems; } +const std::vector& config::GetFilteredItems() { return Config.db_filteredItems; } -bool DetourTick(SDK::APalPlayerCharacter* m_this,float DeltaSecond) +bool DetourTick(SDK::APalPlayerCharacter* m_this, float DeltaSecond) { if (m_this->GetPalPlayerController() != NULL) { @@ -31,7 +31,7 @@ bool DetourTick(SDK::APalPlayerCharacter* m_this,float DeltaSecond) Config.localPlayer = m_this; } } - return OldTickFunc(m_this, DeltaSecond); + return OldTickFunc(m_this, DeltaSecond); } SDK::UWorld* config::GetUWorld() { @@ -52,8 +52,8 @@ SDK::UPalCharacterImportanceManager* config::GetCharacterImpManager() if (!pWorld) return nullptr; - SDK::UGameInstance* pGameInstance = pWorld->OwningGameInstance; - if (!pGameInstance) + SDK::UGameInstance* pGameInstance = pWorld->OwningGameInstance; + if (!pGameInstance) return nullptr; return static_cast(pGameInstance)->CharacterImportanceManager; @@ -172,7 +172,7 @@ bool config::GetAllActorsofType(SDK::UClass* mType, std::vector* o if (!pActor || !pActor->RootComponent || (pActor == pLocalPlayer && bSkipLocalPlayer)) continue; - if (!pActor->IsA(mType)) + if (!pActor->IsA(mType)) continue; result.push_back(pActor); @@ -191,7 +191,7 @@ void config::Init() { //register hook Config.ClientBase = (DWORD64)GetModuleHandleA("PalWorld-Win64-Shipping.exe"); - + TickFunc = (Tick)(Config.ClientBase + Config.offset_Tick); MH_CreateHook(TickFunc, DetourTick, reinterpret_cast(&OldTickFunc)); diff --git a/config.h b/config.h index 323e855..f4772c1 100644 --- a/config.h +++ b/config.h @@ -4,16 +4,14 @@ #include "database.h" #include "SDK.hpp" -typedef bool(*Tick)(SDK::APalPlayerCharacter* m_this,float DeltaSecond); -typedef void(*AddStatus)(SDK::UPalNetworkIndividualComponent* p_this, SDK::FPalInstanceID* ID, SDK::TArray* AddStatusPointArray); +typedef bool(*Tick)(SDK::APalPlayerCharacter* m_this, float DeltaSecond); class config { public: //offsets DWORD64 ClientBase = 0; - DWORD64 offset_Tick = 0x2AB1DC0;//APalPlayerCharacter::Tick // 48 89 5C 24 ? 57 48 83 EC 60 48 8B F9 E8 ? ? ? ? 48 8B | [IDA NOTE]: 2ND RESULT - DWORD64 offset_AddStatus = 0x2B0E960; //UPalNetworkIndividualComponent::AddPlayerCharacterStatusPoint_ToServer + DWORD64 offset_Tick = 0x2AB1DC0;//APalPlayerCharacter::Tick //check bool IsESP = false; bool IsAimbot = false; @@ -28,20 +26,20 @@ public: bool IsMonster = false; bool IsQuick = false; bool matchDbItems = true; - bool isEq = false; bool isDebugESP = false; - float mDebugESPDistance = 5.0f; - - //def and value + bool bisOpenManager = false; + bool filterPlayer = false; + bool bisRandomName = false; float SpeedModiflers = 1.0f; + //def and value + float mDebugESPDistance = 5.0f; int DamageUp = 0; int DefuseUp = 0; int EXP = 0; int Item = 0; - float Pos[3] = {0,0,0}; + float Pos[3] = { 0,0,0 }; char ItemName[255]; char inputTextBuffer[255] = ""; - int EqModifiler = 1; SDK::UWorld* gWorld = nullptr; SDK::APalPlayerCharacter* localPlayer = NULL; SDK::TArray AllPlayers = {}; @@ -53,7 +51,7 @@ public: enum QuickItemSet { basic_items_stackable, - basic_items_single, + basic_items_single, pal_unlock_skills, spheres, tools @@ -69,12 +67,11 @@ public: static SDK::APalPlayerState* GetPalPlayerState(); static SDK::UPalPlayerInventoryData* GetInventoryComponent(); static SDK::APalWeaponBase* GetPlayerEquippedWeapon(); - static SDK::TArray GetTAllPlayers(); static bool GetTAllPlayers(SDK::TArray* outResult); static bool GetTAllImpNPC(SDK::TArray* outResult); static bool GetTAllNPC(SDK::TArray* outResult); static bool GetTAllPals(SDK::TArray* outResult); - static bool GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels = false , bool bSkipLocalPlayer = false); + static bool GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels = false, bool bSkipLocalPlayer = false); static void Init(); static void Update(const char* filterText); static const std::vector& GetFilteredItems(); diff --git a/include/Menu.hpp b/include/Menu.hpp index 6565f79..cb06b17 100644 --- a/include/Menu.hpp +++ b/include/Menu.hpp @@ -23,6 +23,7 @@ namespace DX11_Base { // FORWARD DECLARE FUNCTIONS void Draw(); void MainMenu(); + void ManagerMenu(); void HUD(bool* p_open); void Loops(); diff --git a/src/Menu.cpp b/src/Menu.cpp index 37c8880..ca7d694 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -2,48 +2,39 @@ #include "../include/Menu.hpp" #include "SDK.hpp" #include "config.h" - -AddStatus Equi; -AddStatus OldEqui; - -void DetourEqui(SDK::UPalNetworkIndividualComponent* p_this, SDK::FPalInstanceID* ID, SDK::TArray* AddStatusPointArray) +std::string rand_str(const int len) { - if(AddStatusPointArray->IsValid()) + std::string str; + char c; + int idx; + for (idx = 0; idx < len; idx++) { - for (int i = 0; i < AddStatusPointArray->Count(); i++) - { - (*AddStatusPointArray)[i].StatusPoint = -1 * Config.EqModifiler; - } + c = 'a' + rand() % 26; + str.push_back(c); } - return; + return str; } +void Damage(SDK::APalCharacter* character, int32 damage) +{ + SDK::FPalDamageInfo info = SDK::FPalDamageInfo(); + info.AttackElementType = SDK::EPalElementType::Normal; + info.Attacker = Config.GetPalPlayerCharacter(); + info.AttackerGroupID = Config.GetPalPlayerState()->IndividualHandleId.PlayerUId; + info.AttackerLevel = 50; + info.AttackType = SDK::EPalAttackType::Weapon; + info.bApplyNativeDamageValue = true; + info.bAttackableToFriend = true; + info.IgnoreShield = true; + info.NativeDamageValue = damage; + Config.GetPalPlayerState()->SendDamage_ToServer(character, info); +} + int InputTextCallback(ImGuiInputTextCallbackData* data) { char inputChar = data->EventChar; Config.Update(Config.inputTextBuffer); return 0; -} -void ToggleEqui(bool isEq) -{ - if (isEq) - { - if (Equi = NULL) - { - Equi = (AddStatus)(Config.ClientBase + Config.offset_AddStatus); - MH_CreateHook(Equi, DetourEqui, reinterpret_cast(OldEqui)); - MH_EnableHook(Equi); - return; - } - MH_EnableHook(Equi); - return; - } - else - { - MH_DisableHook(Equi); - } - - } //SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo(); //SDK::TArray EA = { 0U }; @@ -203,6 +194,24 @@ namespace DX11_Base { ImGui::Checkbox("InfStamina", &Config.IsInfStamina); + + if (ImGui::Button("RandomName", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + { + if (Config.GetPalPlayerCharacter() != NULL) + { + if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) + { + SDK::UKismetStringLibrary* lib = SDK::UKismetStringLibrary::GetDefaultObj(); + std::string s = rand_str(20); + + wchar_t ws[255]; + swprintf(ws, 255, L"%hs", s.c_str()); + + Config.GetPalPlayerCharacter()->GetPalPlayerController()->Transmitter->NetworkIndividualComponent->UpdateCharacterNickName_ToServer(Config.GetPalPlayerCharacter()->CharacterParameterComponent->IndividualHandle->ID, SDK::FString(ws)); + } + } + } + //Creadit Mokobake //ImGui::Checkbox("MuteKiGodmode", &Config.IsMuteki); @@ -234,6 +243,7 @@ namespace DX11_Base { { //Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState()->RequestSpawnMonsterForPlayer(name, 5, 1); ImGui::Checkbox("IsQuick", &Config.IsQuick); + ImGui::Checkbox("Open Manager", &Config.bisOpenManager); ImGui::Checkbox("SafeTeleport", &Config.IsSafe); //creadit //ImGui::Checkbox("PalIsMonster", &Config.IsMonster); @@ -392,17 +402,11 @@ namespace DX11_Base { } } } - if (ImGui::Button("Equivalent", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) - { - Config.isEq = !Config.isEq; - ToggleEqui(Config.isEq); - } - ImGui::InputInt("EquiModifiler", &Config.EqModifiler); } void TABConfig() { ImGui::Text("PalWorld Menu"); - ImGui::Text("VERSION: v1.1"); + ImGui::Text("VERSION: v1.2.3"); ImGui::Spacing(); ImGui::Separator(); @@ -463,6 +467,10 @@ namespace DX11_Base { } if (g_GameVariables->m_ShowMenu) MainMenu(); + if (Config.bisOpenManager && g_GameVariables->m_ShowMenu) + { + ManagerMenu(); + } if (g_GameVariables->m_ShowHud) HUD(&g_GameVariables->m_ShowHud); @@ -473,7 +481,117 @@ 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 (Config.GetUWorld() != NULL) + { + ImGui::Checkbox("filterPlayer", &Config.filterPlayer); + SDK::TArray T = Config.GetUWorld()->PersistentLevel->Actors; + for (int i = 0; i < T.Count(); i++) + { + if (T[i] != NULL) + { + if (T[i]->IsA(SDK::APalCharacter::StaticClass())) + { + 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(); + } + } + } + } + } + } void Menu::MainMenu() { if (!g_GameVariables->m_ShowDemo)