From 54cc65378deb3a2512fcb4582b4b476b788c99bb Mon Sep 17 00:00:00 2001
From: NightFyre <80198020+xCENTx@users.noreply.github.com>
Date: Mon, 29 Jan 2024 12:09:33 -0500
Subject: [PATCH] New Features
# FEATURES
- Teleport Pals to crosshair
- Waypoints ( add by name & rendering )
# HELPERS
- Get Party Pals
- Get class pointer by blueprint name
- Forge Actors ( set position , height, angle )
# FIXES
- Fixed modify attack
- Fixed Uninject DLL crash
---
DX11-Base.vcxproj.filters | 3 ++
config.cpp | 6 +++
config.h | 22 ++++++++
feature.cpp | 108 +++++++++++++++++++++++++++++++++++++-
feature.h | 10 +++-
initialize.hpp | 24 ++++++++-
src/D3D11Window.cpp | 7 +--
src/Hooking.cpp | 4 +-
src/Menu.cpp | 67 ++++++++++++++++++++++-
9 files changed, 240 insertions(+), 11 deletions(-)
diff --git a/DX11-Base.vcxproj.filters b/DX11-Base.vcxproj.filters
index ae247de..cf1847c 100644
--- a/DX11-Base.vcxproj.filters
+++ b/DX11-Base.vcxproj.filters
@@ -120,6 +120,9 @@
Header Files
+
+ Header Files
+
diff --git a/config.cpp b/config.cpp
index 5087091..1f09a9e 100644
--- a/config.cpp
+++ b/config.cpp
@@ -164,6 +164,12 @@ bool config::GetTAllPals(SDK::TArray* outResult)
return true;
}
+bool GetPartyPals(std::vector outResult)
+{
+ return false;
+}
+
+// credit: xCENTx
bool config::GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels, bool bSkipLocalPlayer)
{
SDK::UWorld* pWorld = Config.gWorld;
diff --git a/config.h b/config.h
index e88a03c..21d1eff 100644
--- a/config.h
+++ b/config.h
@@ -15,6 +15,8 @@ public:
//check
bool IsESP = false;
bool IsFullbright = false;
+ bool IsForgeMode = false;
+ bool IsTeleportAllToXhair = false;
bool IsAimbot = false;
bool IsSpeedHack = false;
bool IsAttackModiler = false;
@@ -35,6 +37,7 @@ public:
float SpeedModiflers = 1.0f;
//def and value
float mDebugESPDistance = 5.0f;
+ float mDebugEntCapDistance = 10.0f;
int DamageUp = 0;
int DefuseUp = 0;
int EXP = 0;
@@ -61,6 +64,24 @@ public:
};
//Filtered Items
std::vector db_filteredItems;
+
+
+
+ struct SWaypoint
+ {
+ std::string waypointName;
+ SDK::FVector waypointLocation;
+ SDK::FRotator waypointRotation;
+
+ bool bIsShown = true;
+ float* mColor[4];
+
+ SWaypoint() {};
+ SWaypoint(std::string wpName, SDK::FVector wpLocation, SDK::FRotator wpRotation) { waypointName = wpName; waypointLocation = wpLocation; waypointRotation = wpRotation; }
+ };
+ std::vector db_waypoints;
+ std::vector> db_filteredEnts;
+
//static function
static SDK::UWorld* GetUWorld();
@@ -75,6 +96,7 @@ public:
static bool GetTAllImpNPC(SDK::TArray* outResult);
static bool GetTAllNPC(SDK::TArray* outResult);
static bool GetTAllPals(SDK::TArray* outResult);
+ static bool GetPartyPals(std::vector outResult);
static bool GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels = false, bool bSkipLocalPlayer = false);
static void Init();
static void Update(const char* filterText);
diff --git a/feature.cpp b/feature.cpp
index 887137a..82459c3 100644
--- a/feature.cpp
+++ b/feature.cpp
@@ -29,6 +29,7 @@ void ESP()
ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), ImColor(128,0,0), T[i]->GetFullName().c_str());
}
+// credit: xCENTx
// 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)
@@ -235,7 +236,7 @@ void ExploitFly(bool IsFly)
IsFly ? pPalPlayerController->StartFlyToServer() : pPalPlayerController->EndFlyToServer();
}
-// credit: nknights23
+// credit: xCENTx
void SetFullbright(bool bIsSet)
{
ULocalPlayer* pLocalPlayer = Config.GetLocalPlayer();
@@ -335,6 +336,24 @@ void ResetStamina()
return;
pParams->ResetSP();
+
+
+ // Reset Pal Stamina ??
+ TArray outPals;
+ Config.GetTAllPals(&outPals);
+ DWORD palsSize = outPals.Count();
+ for (int i = 0; i < palsSize; i++)
+ {
+ APalCharacter* cPal = outPals[i];
+ if (!cPal || cPal->IsA(APalMonsterCharacter::StaticClass()))
+ continue;
+
+ UPalCharacterParameterComponent* pPalParams = pPalCharacter->CharacterParameterComponent;
+ if (!pPalParams)
+ return;
+
+ pPalParams->ResetSP();
+ }
}
//
@@ -472,6 +491,7 @@ void RemoveAncientTechPoint(__int32 mPoints)
pTechData->bossTechnologyPoint -= mPoints;
}
+// credit: xCENTx
float GetDistanceToActor(AActor* pLocal, AActor* pTarget)
{
if (!pLocal || !pTarget)
@@ -484,6 +504,92 @@ float GetDistanceToActor(AActor* pLocal, AActor* pTarget)
return distance / 100.0f;
}
+// credit xCENTx
+void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight, float mAngle)
+{
+ APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter();
+ APlayerController* pPlayerController = Config.GetPalPlayerController();
+ if (!pTarget || !pPalPlayerCharacter || !pPlayerController)
+ return;
+
+ APlayerCameraManager* pCamera = pPlayerController->PlayerCameraManager;
+ if (!pCamera)
+ return;
+
+ FVector playerLocation = pPalPlayerCharacter->K2_GetActorLocation();
+ FVector camFwdDir = pCamera->GetActorForwardVector() * ( mDistance * 100.f );
+ FVector targetLocation = playerLocation + camFwdDir;
+
+ if (mHeight != 0.0f)
+ targetLocation.Y += mHeight;
+
+ FRotator targetRotation = pTarget->K2_GetActorRotation();
+ if (mAngle != 0.0f)
+ targetRotation.Roll += mAngle;
+
+ pTarget->K2_SetActorLocation(targetLocation, false, nullptr, true);
+ pTarget->K2_SetActorRotation(targetRotation, true);
+}
+
+// credit: xCENTx
+void TeleportAllPalsToCrosshair(float mDistance)
+{
+ TArray outPals;
+ Config.GetTAllPals(&outPals);
+ DWORD palsCount = outPals.Count();
+ for (int i = 0; i < palsCount; i++)
+ {
+ APalCharacter* cPal = outPals[i];
+
+ if (!cPal || !cPal->IsA(APalMonsterCharacter::StaticClass()))
+ continue;
+
+ // @TODO: displace with entity width for true distance, right now it is distance from origin
+ // FVector palOrigin;
+ // FVector palBounds;
+ // cPal->GetActorBounds(true, &palOrigin, &palBounds, false);
+ // float adj = palBounds.X * .5 + mDistance;
+
+ ForgeActor(cPal, mDistance);
+ }
+}
+
+// credit: xCENTx
+void AddWaypointLocation(std::string wpName)
+{
+ APalCharacter* pPalCharacater = Config.GetPalPlayerCharacter();
+ if (!pPalCharacater)
+ return;
+
+ FVector wpLocation = pPalCharacater->K2_GetActorLocation();
+ FRotator wpRotation = pPalCharacater->K2_GetActorRotation();
+ config::SWaypoint newWaypoint = config::SWaypoint("[WAYPOINT]" + wpName, wpLocation, wpRotation);
+ Config.db_waypoints.push_back(newWaypoint);
+}
+
+// credit: xCENTx
+// must be called from a rendering thread with imgui context
+void RenderWaypointsToScreen()
+{
+ APalCharacter* pPalCharacater = Config.GetPalPlayerCharacter();
+ APalPlayerController* pPalController = Config.GetPalPlayerController();
+ if (!pPalCharacater || !pPalController)
+ return;
+
+ ImDrawList* draw = ImGui::GetWindowDrawList();
+
+ for (auto waypoint : Config.db_waypoints)
+ {
+ FVector2D vScreen;
+ if (!pPalController->ProjectWorldLocationToScreen(waypoint.waypointLocation, &vScreen, false))
+ continue;
+
+ auto color = ImColor(1.0f, 1.0f, 1.0f, 1.0f);
+
+ draw->AddText(ImVec2( vScreen.X, vScreen.Y ), color, waypoint.waypointName.c_str());
+ }
+}
+
/// OLDER METHODS
//SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo();
//SDK::TArray EA = { 0U };
diff --git a/feature.h b/feature.h
index 279323a..fefa0cb 100644
--- a/feature.h
+++ b/feature.h
@@ -51,4 +51,12 @@ void RemoveTechPoints(__int32 mPoints);
void RemoveAncientTechPoint(__int32 mPoints);
-float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget);
\ No newline at end of file
+float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget);
+
+void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight = 0.0f, float mAngle = 0.0f);
+
+void TeleportAllPalsToCrosshair(float mDistance);
+
+void AddWaypointLocation(std::string wpName);
+
+void RenderWaypointsToScreen();
\ No newline at end of file
diff --git a/initialize.hpp b/initialize.hpp
index daf1379..cb9598d 100644
--- a/initialize.hpp
+++ b/initialize.hpp
@@ -7,6 +7,18 @@
#include "include/Hooking.hpp"
using namespace DX11_Base;
+// please dont remove , this is useful for a variety of things
+void ClientBGThread()
+{
+ while (g_Running)
+ {
+ // test cache runners
+
+ std::this_thread::sleep_for(1ms);
+ std::this_thread::yield();
+ }
+}
+
DWORD WINAPI MainThread_Initialize()
{
g_Console = std::make_unique();
@@ -29,7 +41,9 @@ DWORD WINAPI MainThread_Initialize()
#endif
/// RENDER LOOP
- g_Running = TRUE;
+ g_Running = TRUE;
+
+ std::thread WCMUpdate(ClientBGThread); // Initialize Loops Thread
while (g_Running)
{
if (GetAsyncKeyState(VK_INSERT) & 1)
@@ -38,9 +52,17 @@ DWORD WINAPI MainThread_Initialize()
g_GameVariables->m_ShowHud = !g_GameVariables->m_ShowMenu;
}
+
+
+ if (g_KillSwitch)
+ {
+ g_KillSwitch = false;
+ g_Hooking->Unhook();
+ }
}
/// EXIT
+ WCMUpdate.join(); // Exit Loops Thread
FreeLibraryAndExitThread(g_hModule, EXIT_SUCCESS);
return EXIT_SUCCESS;
}
\ No newline at end of file
diff --git a/src/D3D11Window.cpp b/src/D3D11Window.cpp
index 4427d5a..8fa296d 100644
--- a/src/D3D11Window.cpp
+++ b/src/D3D11Window.cpp
@@ -41,6 +41,7 @@ bool HookCursor()
namespace DX11_Base {
static uint64_t* MethodsTable = NULL;
+ // @TODO: boolean for active window
LRESULT D3D11Window::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (g_GameVariables->m_ShowMenu) {
@@ -224,12 +225,6 @@ namespace DX11_Base {
///
HRESULT APIENTRY D3D11Window::HookPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
{
- if (g_KillSwitch) {
- g_Hooking->Unhook();
- g_D3D11Window->oIDXGISwapChainPresent(pSwapChain, SyncInterval, Flags);
- g_Running = FALSE;
- return 0;
- }
g_D3D11Window->Overlay(pSwapChain);
return g_D3D11Window->oIDXGISwapChainPresent(pSwapChain, SyncInterval, Flags);
}
diff --git a/src/Hooking.cpp b/src/Hooking.cpp
index 37b084d..992a945 100644
--- a/src/Hooking.cpp
+++ b/src/Hooking.cpp
@@ -31,8 +31,10 @@ namespace DX11_Base {
void Hooking::Unhook()
{
g_D3D11Window->Unhook();
- MH_RemoveHook(MH_ALL_HOOKS);
+ MH_DisableHook((Tick)(Config.ClientBase + Config.offset_Tick));
+ MH_RemoveHook((Tick)(Config.ClientBase + Config.offset_Tick));
g_Console->DestroyConsole();
+ g_Running = FALSE;
return;
}
}
diff --git a/src/Menu.cpp b/src/Menu.cpp
index 4eb9bc8..8b31213 100644
--- a/src/Menu.cpp
+++ b/src/Menu.cpp
@@ -42,6 +42,8 @@ namespace DX11_Base
{
// helper variables
char inputBuffer_getFnAddr[100];
+ char inputBuffer_getClass[100];
+ char inputBuffer_setWaypoint[32];
namespace Styles
{
@@ -380,6 +382,13 @@ namespace DX11_Base
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
ImGui::SliderFloat("##DISTANCE", &Config.mDebugESPDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp);
}
+ ImGui::Checkbox("TELEPORT PALS TO XHAIR", &Config.IsTeleportAllToXhair);
+ if (Config.IsTeleportAllToXhair)
+ {
+ ImGui::SameLine();
+ ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
+ ImGui::SliderFloat("##ENT_CAP_DISTANCE", &Config.mDebugEntCapDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp);
+ }
// @TODO: print additional debug information
if (ImGui::Button("PrintPlayerAddr", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20)))
@@ -390,6 +399,7 @@ namespace DX11_Base
}
+ // Get Function Pointer Offset
ImGui::InputTextWithHint("##INPUT", "INPUT GOBJECT fn NAME", inputBuffer_getFnAddr, 100);
ImGui::SameLine();
if (ImGui::Button("GET fn", ImVec2(ImGui::GetContentRegionAvail().x, 20)))
@@ -408,6 +418,55 @@ namespace DX11_Base
memset(inputBuffer_getFnAddr, 0, 100);
}
+
+ // Get Class pointer by name
+ ImGui::InputTextWithHint("##INPUT_GETCLASS", "INPUT OBJECT CLASS NAME", inputBuffer_getClass, 100);
+ ImGui::SameLine();
+ if (ImGui::Button("GET CLASS", ImVec2(ImGui::GetContentRegionAvail().x, 20)))
+ {
+ std::string input = inputBuffer_getClass;
+ SDK::UClass* czClass = SDK::UObject::FindObject(input.c_str());
+ if (czClass)
+ {
+ static __int64 dwHandle = reinterpret_cast<__int64>(GetModuleHandle(0));
+ g_Console->printdbg("[+] Found [%s] -> 0x%llX\n", Console::Colors::yellow, input.c_str(), czClass->Class);
+ }
+ else
+ g_Console->printdbg("[!] CLASS [%s] NOT FOUND!\n", Console::Colors::red, input.c_str());
+
+ }
+
+ // Waypoints
+ ImGui::InputTextWithHint("##INPUT_SETWAYPOINT", "CUSTOM WAYPOINT NAME", inputBuffer_setWaypoint, 32);
+ ImGui::SameLine();
+ if (ImGui::Button("SET", ImVec2(ImGui::GetContentRegionAvail().x, 20)))
+ {
+ std::string wpName = inputBuffer_setWaypoint;
+ if (wpName.size() > 0)
+ {
+ AddWaypointLocation(wpName);
+ memset(inputBuffer_setWaypoint, 0, 32);
+ }
+ }
+ if (Config.db_waypoints.size() > 0)
+ {
+ if (ImGui::BeginChild("##CHILD_WAYPOINTS", { 0.0f, 100.f }))
+ {
+ DWORD index = -1;
+ for (auto waypoint : Config.db_waypoints)
+ {
+ index++;
+ ImGui::PushID(index);
+ // ImGui::Checkbox("SHOW", &waypoint.bIsShown);
+ // ImGui::SameLine();
+ if (ImGui::Button(waypoint.waypointName.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 20)))
+ AnyWhereTP(waypoint.waypointLocation, false);
+ ImGui::PopID();
+ }
+
+ ImGui::EndChild();
+ }
+ }
}
}
@@ -662,6 +721,9 @@ namespace DX11_Base
if (Config.isDebugESP)
ESP_DEBUG(Config.mDebugESPDistance);
+ if (Config.db_waypoints.size() > 0)
+ RenderWaypointsToScreen();
+
ImGui::End();
}
@@ -681,7 +743,7 @@ namespace DX11_Base
//
if (Config.IsAttackModiler)
- SetPlayerDefenseParam(Config.DamageUp);
+ SetPlayerAttackParam(Config.DamageUp);
//
if (Config.IsDefuseModiler)
@@ -691,6 +753,9 @@ namespace DX11_Base
if (Config.IsInfStamina)
ResetStamina();
+ if (Config.IsTeleportAllToXhair)
+ TeleportAllPalsToCrosshair(Config.mDebugEntCapDistance);
+
//
// SetDemiGodMode(Config.IsMuteki);
}