diff --git a/README.md b/README.md index 6691b0b..8576811 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ SotCore core = new SotCore(); //if u are in steam version replace by true if (core.Prepare(false)) { - UE4Actor localPlayer = core.GetLocalPlayer(); + Player localPlayer = new Player(core.GetLocalPlayer()); //Do your things here } else diff --git a/SotCoreTest/Program.cs b/SotCoreTest/Program.cs index 657f85a..72061be 100644 --- a/SotCoreTest/Program.cs +++ b/SotCoreTest/Program.cs @@ -5,6 +5,7 @@ namespace SotEspCoreTest { class Program { + static void Main(string[] args) { SotCore core = new SotCore(); @@ -15,12 +16,15 @@ static void Main(string[] args) { Console.WriteLine("Name : {0} | Actual Name : {1} Pos : {2} Rot : {3}", actor.BaseName, actor.getName(), actor.getPos().ToString(), actor.getRot().ToString()); } - UE4Actor localPlayer = core.GetLocalPlayer(); + Player localPlayer = new Player(core.GetLocalPlayer()); Console.WriteLine("LocalPlayer Name : {0} | LocalPlayer Actual Name : {1} LocalPlayer Pos : {2} LocalPlayer Rot : {3}", localPlayer.BaseName, localPlayer.getName(), localPlayer.getPos().ToString(), localPlayer.getRot().ToString()); CameraManager cameraManager = core.GetCameraManager(); Console.WriteLine("Camera Manager | Pos : {0} Rot : {1} FOV {2}", cameraManager.getPos().ToString(), cameraManager.getRot().ToString(), cameraManager.getFOV()); + + Console.WriteLine("LocalPlayer in-game Name : {0} | Health : {1} | Max Health : {2} | Wielded Item Name {3} ", localPlayer.getPlayerName(), localPlayer.getHealth(), localPlayer.getMaxHealth(), localPlayer.getWieldedItem()); + } } } diff --git a/SotCoreWrapper/Core.h b/SotCoreWrapper/Core.h index 8af239e..94d36b0 100644 --- a/SotCoreWrapper/Core.h +++ b/SotCoreWrapper/Core.h @@ -1,3 +1,4 @@ #pragma once #include "SotCore.h" +#include "Player.h" #include "SOTStuff.h" \ No newline at end of file diff --git a/SotCoreWrapper/Player.cpp b/SotCoreWrapper/Player.cpp new file mode 100644 index 0000000..ef99be3 --- /dev/null +++ b/SotCoreWrapper/Player.cpp @@ -0,0 +1,30 @@ +#include "pch.h" +#include "Player.h" +namespace SoT +{ + Player::Player(UE4Actor^ actor) : UE4Actor(actor) + { + + } + + System::String^ Player::getPlayerName() + { + return gcnew System::String(getActor().GetPlayerState().GetName().c_str()); + } + + System::String^ Player::getWieldedItem() + { + return gcnew System::String(getActor().GetWieldedItemComponent().GetWieldedItem().GetItemInfo().GetItemDesc().GetName().c_str()); + } + + int Player::getHealth() + { + return getActor().GetHealthComponent().GetHealth(); + } + + int Player::getMaxHealth() + { + return getActor().GetHealthComponent().GetMaxHealth(); + } + +} \ No newline at end of file diff --git a/SotCoreWrapper/Player.h b/SotCoreWrapper/Player.h new file mode 100644 index 0000000..ae1d616 --- /dev/null +++ b/SotCoreWrapper/Player.h @@ -0,0 +1,17 @@ +#pragma once +#include "Core.h" +#include "UE4ActorWrapper.h" +namespace SoT +{ + public ref class Player : public UE4Actor + { + public: + Player::Player(UE4Actor^ actor); + System::String^ getPlayerName(); + System::String^ getWieldedItem(); + int getHealth(); + int getMaxHealth(); + + }; +} + diff --git a/SotCoreWrapper/SOTStuff.cpp b/SotCoreWrapper/SOTStuff.cpp index 6c4a440..2e22266 100644 --- a/SotCoreWrapper/SOTStuff.cpp +++ b/SotCoreWrapper/SOTStuff.cpp @@ -49,7 +49,7 @@ namespace Core TArray AActor::GetIslandarray() { - return MemoryManager->Read< TArray>(*(uintptr_t*)(__pad0x0 + 0x523A)); + return MemoryManager->Read< TArray>(*(uintptr_t*)(__pad0x0 + 0x0470)); } UDrowningComponent ACharacter::GetDrowningComponent() diff --git a/SotCoreWrapper/SOTStuff.h b/SotCoreWrapper/SOTStuff.h index 8041b73..7b8ccbb 100644 --- a/SotCoreWrapper/SOTStuff.h +++ b/SotCoreWrapper/SOTStuff.h @@ -268,6 +268,36 @@ namespace Core char __pad0x0[0x1000]; }; + struct FIsland + { + int IslandNameId; + char __pad0x4[0x4]; + byte IslandType; + unsigned char UnknownData00[0x7]; + char __pad0x10[0x8]; + Vector3 IslandBoundsCentre; + float IslandBoundsRadius; + float IslandTriggerRadius; + float IslandSafeZoneRadius; + char __pad0x30[0x38]; + }; + + class AIslandService + { + public: + unsigned char UnknownData00[0x88]; // 0x03D0(0x0088) MISSED OFFSET + unsigned char UnknownData01[0x0008]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData02[0x0008]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData03[0x0008]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData04[0x18]; // 0x0470(0x0018) MISSED OFFSET + TArray IslandArray; // 0x0488(0x0010) (Net, ZeroConstructor) + unsigned char UnknownData05[0x120]; // 0x0498(0x0120) MISSED OFFSET + unsigned char UnknownData06[0x0010]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData07[0x0010]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData08[0x0010]; // 0x0458(0x0008) (ZeroConstructor, Transient, IsPlainOldData) + unsigned char UnknownData09[0x8]; // 0x05E8(0x0008) MISSED OFFSET + }; + class AActor { public: diff --git a/SotCoreWrapper/SotCore.cpp b/SotCoreWrapper/SotCore.cpp index 48fa3f0..6ba3d3a 100644 --- a/SotCoreWrapper/SotCore.cpp +++ b/SotCoreWrapper/SotCore.cpp @@ -151,7 +151,6 @@ namespace Core auto objectActor = *reinterpret_cast(&worldActors[i]); auto objectID = objectActor.GetID(); auto objectName = getNameFromIDmem(objectID); -; actors.push_back(objectActor); } TempActors = actors; diff --git a/SotCoreWrapper/SotCoreWrapper.h b/SotCoreWrapper/SotCoreWrapper.h index f1870f2..8e9152b 100644 --- a/SotCoreWrapper/SotCoreWrapper.h +++ b/SotCoreWrapper/SotCoreWrapper.h @@ -5,6 +5,7 @@ #include "UE4ActorWrapper.h" #include "VectorUE4.h" #include "CameraManager.h" +#include "Player.h" #include "process_manager.h" using namespace System; diff --git a/SotCoreWrapper/SotCoreWrapper.vcxproj b/SotCoreWrapper/SotCoreWrapper.vcxproj index 83cef8f..c4f5e07 100644 --- a/SotCoreWrapper/SotCoreWrapper.vcxproj +++ b/SotCoreWrapper/SotCoreWrapper.vcxproj @@ -123,6 +123,7 @@ + @@ -140,6 +141,7 @@ + diff --git a/SotCoreWrapper/SotCoreWrapper.vcxproj.filters b/SotCoreWrapper/SotCoreWrapper.vcxproj.filters index 7e5eb22..40cc2e1 100644 --- a/SotCoreWrapper/SotCoreWrapper.vcxproj.filters +++ b/SotCoreWrapper/SotCoreWrapper.vcxproj.filters @@ -60,6 +60,9 @@ Fichiers d%27en-tĂȘte + + Fichiers d%27en-tĂȘte + @@ -95,6 +98,9 @@ Fichiers sources + + Fichiers sources + diff --git a/SotCoreWrapper/UE4ActorWrapper.cpp b/SotCoreWrapper/UE4ActorWrapper.cpp index cb2630b..ebcba87 100644 --- a/SotCoreWrapper/UE4ActorWrapper.cpp +++ b/SotCoreWrapper/UE4ActorWrapper.cpp @@ -1,12 +1,16 @@ #include "pch.h" #include "Core.h" #include "UE4ActorWrapper.h" -#include -using namespace msclr::interop; namespace SoT { + UE4Actor::UE4Actor(UE4Actor^ actor) + { + this->BaseName = actor->BaseName; + this->IDActors = actor->IDActors; + } + UE4Actor::UE4Actor(std::string BaseName, int IDActors) { this->BaseName = gcnew System::String(BaseName.c_str()); diff --git a/SotCoreWrapper/UE4ActorWrapper.h b/SotCoreWrapper/UE4ActorWrapper.h index ba92cca..b6110ac 100644 --- a/SotCoreWrapper/UE4ActorWrapper.h +++ b/SotCoreWrapper/UE4ActorWrapper.h @@ -1,8 +1,13 @@ #pragma once #include #include "VectorUE4.h" +#include +using namespace msclr::interop; + using namespace System; using namespace Core; + + namespace SoT { public ref class UE4Actor @@ -11,8 +16,10 @@ namespace SoT VectorUE4^ pos; VectorUE4^ rot; bool isValid(); + internal: AActor UE4Actor::getActor(); public: + UE4Actor(UE4Actor^ actor); UE4Actor(std::string BaseName, int IDActors); System::String^ getName(); VectorUE4^ UE4Actor::getPos(); diff --git a/SotCoreWrapper/offsets.h b/SotCoreWrapper/offsets.h index e47492a..d2caa35 100644 --- a/SotCoreWrapper/offsets.h +++ b/SotCoreWrapper/offsets.h @@ -107,7 +107,7 @@ namespace Core struct UWieldedItemComponent { - int WieldedItem = 1192; + int WieldedItem = 696; }UWieldedItemComponent; struct AWieldableItem