Adjust the structure so that you can now try to package other characters

This commit is contained in:
2200151533 2024-01-24 18:52:50 +08:00
parent cbf8da8219
commit a56edb517c
3 changed files with 66 additions and 8 deletions

View File

@ -6,7 +6,17 @@ config Config;
Tick TickFunc;
Tick OldTickFunc;
GetAllPlayer GetAllPlayerFunc;
GetAllPlayer OldGetAllPlayerFunc;
void DetourPlayers(SDK::UPalCharacterImportanceManager* i_this, SDK::TArray<SDK::APalCharacter*>* 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<SDK::APalPlayerCharacter*> config::GetTAllPlayers()
{
if (Config.AllPlayers.IsValid())
{
return Config.AllPlayers;
}
return NULL;
}
void config::Init()
{
//<2F><><EFBFBD><EFBFBD>IsAdjustLocation<6F><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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<void**>(&OldTickFunc));
MH_CreateHook(GetAllPlayerFunc, DetourPlayers, reinterpret_cast<void**>(&OldGetAllPlayerFunc));
}

View File

@ -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<SDK::APalCharacter*>* OutArray);
class config
{
public:
DWORD64 ClientBase = 0;
DWORD64 offset_Tick = 0x2AB44D0;
DWORD64 offset_Tick = 0x2AB44D0;//APalPlayerCharacter::Tick
DWORD64 offset_GetAllPlayers = 0x2962330;// UPalCharacterImportanceManager::GetAllPlayer
//<2F>˵<EFBFBD><CBB5>ж<EFBFBD>
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<SDK::APalPlayerCharacter*> AllPlayers = {};
SDK::UObject* WorldContextObject = NULL;
//<2F><><EFBFBD><EFBFBD>
static SDK::UWorld* GetUWorld();
static SDK::APalPlayerCharacter* GetPalPlayerCharacter();
static SDK::TArray<SDK::APalPlayerCharacter*> GetTAllPlayers();
static void Init();
};
extern config Config;

View File

@ -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<SDK::APalPlayerCharacter*> 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<Num>", ImVec2(ImGui::GetWindowContentRegionWidth() - 3, 20)))
if(ImGui::Button("Give EXP<Num>", 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();