diff --git a/config.cpp b/config.cpp index bf2d1c5..dc4af3d 100644 --- a/config.cpp +++ b/config.cpp @@ -6,7 +6,17 @@ config Config; Tick TickFunc; Tick OldTickFunc; +GetAllPlayer GetAllPlayerFunc; +GetAllPlayer OldGetAllPlayerFunc; +void DetourPlayers(SDK::UPalCharacterImportanceManager* i_this, SDK::TArray* OutArray) +{ + if(i_this->PlayerList.IsValid()) + { + Config.AllPlayers = i_this->PlayerList_ForOutsideGet; + } + return OldGetAllPlayerFunc(i_this, OutArray); +} bool DetourTick(SDK::APalPlayerCharacter* m_this,float DeltaSecond) { if (m_this->GetPalPlayerController() != NULL) @@ -14,7 +24,6 @@ bool DetourTick(SDK::APalPlayerCharacter* m_this,float DeltaSecond) if (m_this->GetPalPlayerController()->IsLocalPlayerController()) { Config.localPlayer = m_this; - } } return OldTickFunc(m_this, DeltaSecond); @@ -40,12 +49,22 @@ SDK::APalPlayerCharacter* config::GetPalPlayerCharacter() return nullptr; } +SDK::TArray config::GetTAllPlayers() +{ + if (Config.AllPlayers.IsValid()) + { + return Config.AllPlayers; + } + return NULL; +} + void config::Init() { - //����IsAdjustLocation�������� Config.ClientBase = (DWORD64)GetModuleHandleA("PalWorld-Win64-Shipping.exe"); + TickFunc = (Tick)(Config.ClientBase + Config.offset_Tick); + GetAllPlayerFunc = (GetAllPlayer)(Config.ClientBase + Config.offset_GetAllPlayers); MH_CreateHook(TickFunc, DetourTick, reinterpret_cast(&OldTickFunc)); - + MH_CreateHook(GetAllPlayerFunc, DetourPlayers, reinterpret_cast(&OldGetAllPlayerFunc)); } diff --git a/config.h b/config.h index e372db2..e6e91ac 100644 --- a/config.h +++ b/config.h @@ -4,13 +4,14 @@ #include "SDK.hpp" typedef bool(*Tick)(SDK::APalPlayerCharacter* m_this,float DeltaSecond); - +typedef void(*GetAllPlayer)(SDK::UPalCharacterImportanceManager* i_this, SDK::TArray* OutArray); class config { public: DWORD64 ClientBase = 0; - DWORD64 offset_Tick = 0x2AB44D0; + DWORD64 offset_Tick = 0x2AB44D0;//APalPlayerCharacter::Tick + DWORD64 offset_GetAllPlayers = 0x2962330;// UPalCharacterImportanceManager::GetAllPlayer //�˵��ж� bool IsESP = true; bool IsAimbot = false; @@ -30,10 +31,13 @@ public: int Item = 0; float Pos[3] = {0,0,0}; SDK::APalPlayerCharacter* localPlayer = NULL; - + SDK::TArray AllPlayers = {}; + SDK::UObject* WorldContextObject = NULL; + //���� static SDK::UWorld* GetUWorld(); static SDK::APalPlayerCharacter* GetPalPlayerCharacter(); + static SDK::TArray GetTAllPlayers(); static void Init(); }; extern config Config; diff --git a/src/Menu.cpp b/src/Menu.cpp index c8224a3..ecb6779 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -201,8 +201,42 @@ namespace DX11_Base { } } } + if (ImGui::Button("test", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20))) + { + + g_Console->printdbg("\n\n[+] WorldContextObject: %x [+]\n\n", g_Console->color.green,Config.WorldContextObject); + + if (Config.GetTAllPlayers().IsValid()) + { + SDK::TArray T = Config.GetTAllPlayers(); + for (int i =0;i< T.Num();i++) + { + g_Console->printdbg("\n\n[+] APalPlayerCharacter: %x [+]\n\n", g_Console->color.green,T[i]); + if (T[i]->GetPalPlayerController() != NULL) + { + if (T[i]->GetPalPlayerController()->IsLocalController()) + { + g_Console->printdbg("\n\n[+] Finded APalPlayerCharacter:[+]\n\n", g_Console->color.green); + } + if (T[i] != NULL) + { + if (T[i]->GetPalPlayerController()->GetPalPlayerState() != NULL) + { + SDK::FFixedPoint fixpoint = SDK::FFixedPoint(); + fixpoint.Value = 99999999; + T[i]->ReviveCharacter_ToServer(fixpoint); + } + } + } + } + } + else + { + g_Console->printdbg("\n\n[+]GetTAllPlayers().IsInValid[+]\n\n", g_Console->color.red); + } + } //Creadit WoodgamerHD - if (ImGui::Button("Give EXP", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20))) + if(ImGui::Button("Give EXP", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20))) { SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); if (p_appc != NULL) @@ -225,6 +259,7 @@ namespace DX11_Base { SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); if (p_appc != NULL) { + if (Config.GetPalPlayerCharacter()->GetPalPlayerController() != NULL) { if (Config.GetPalPlayerCharacter()->GetPalPlayerController()->GetPalPlayerState() != NULL) @@ -256,7 +291,7 @@ namespace DX11_Base { void TABConfig() { ImGui::Text("PalWorld Menu"); - ImGui::Text("VERSION: v1.0"); + ImGui::Text("VERSION: v1.1"); ImGui::Spacing(); ImGui::Separator();