mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
fix some versions
fixed s18 (I think), did something to teams, reverted harvesting thing because it was buggy
This commit is contained in:
@@ -28,6 +28,8 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam
|
||||
if (BuildingSMActor->IsDestroyed())
|
||||
return OnDamageServerOriginal(BuildingActor, Damage, DamageTags, Momentum, HitInfo, InstigatedBy, DamageCauser, EffectContext);
|
||||
|
||||
/*
|
||||
|
||||
static auto LastDamageAmountOffset = BuildingSMActor->GetOffset("LastDamageAmount");
|
||||
static auto LastDamageHitOffset = BuildingSMActor->GetOffset("LastDamageHit", false) != -1 ? BuildingSMActor->GetOffset("LastDamageHit") : BuildingSMActor->GetOffset("LastDamageHitImpulseDir"); // idc
|
||||
|
||||
@@ -38,6 +40,8 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam
|
||||
BuildingSMActor->Get<float>(LastDamageAmountOffset) = Damage;
|
||||
BuildingSMActor->Get<float>(LastDamageHitOffset) = CurrentBuildingHealth;
|
||||
|
||||
*/
|
||||
|
||||
if (!PlayerController || !Weapon)
|
||||
return OnDamageServerOriginal(BuildingActor, Damage, DamageTags, Momentum, HitInfo, InstigatedBy, DamageCauser, EffectContext);
|
||||
|
||||
@@ -84,7 +88,7 @@ void ABuildingActor::OnDamageServerHook(ABuildingActor* BuildingActor, float Dam
|
||||
|
||||
// LOG_INFO(LogDev, "Out: {}", Out);
|
||||
|
||||
const float DamageThatWillAffect = PreviousLastDamageHit > 0 && Damage > PreviousLastDamageHit ? PreviousLastDamageHit : Damage;
|
||||
const float DamageThatWillAffect = /* PreviousLastDamageHit > 0 && Damage > PreviousLastDamageHit ? PreviousLastDamageHit : */ Damage;
|
||||
|
||||
float skid = Out / (BuildingActor->GetMaxHealth() / DamageThatWillAffect);
|
||||
|
||||
|
||||
@@ -699,12 +699,21 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
}
|
||||
else
|
||||
{
|
||||
auto S19Patch = Memcury::Scanner::FindPattern("74 1A 48 8D 97 ? ? ? ? 49 8B CF E8 ? ? ? ? 88 87 ? ? ? ? E9").Get();
|
||||
auto S19Patch = Memcury::Scanner::FindPattern("74 1A 48 8D 97 ? ? ? ? 49 8B CF E8 ? ? ? ? 88 87 ? ? ? ? E9", false).Get();
|
||||
|
||||
if (S19Patch)
|
||||
{
|
||||
PatchByte(S19Patch, 0x75);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto S18Patch = Memcury::Scanner::FindPattern("75 02 33 F6 41 BE ? ? ? ? 48 85 F6 74 17 48 8D 93").Get();
|
||||
|
||||
if (S18Patch)
|
||||
{
|
||||
PatchByte(S18Patch, 0x74);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bEnableRebooting)
|
||||
@@ -776,7 +785,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
{
|
||||
auto CurrentRebootVan = (ABuildingGameplayActorSpawnMachine*)AllRebootVans.at(i);
|
||||
static auto FortPlayerStartClass = FindObject<UClass>(L"/Script/FortniteGame.FortPlayerStart");
|
||||
CurrentRebootVan->GetResurrectLocation() = CurrentRebootVan->GetClosestActor(FortPlayerStartClass, 300);
|
||||
CurrentRebootVan->GetResurrectLocation() = CurrentRebootVan->GetClosestActor(FortPlayerStartClass, 450);
|
||||
}
|
||||
|
||||
AllRebootVans.Free();
|
||||
|
||||
@@ -20,10 +20,16 @@ uint8 AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook(AFortGameS
|
||||
if (!PlayerState)
|
||||
continue;
|
||||
|
||||
// return PlayerState->GetTeamIndex() - NumToSubtractFromSquadId;
|
||||
|
||||
static auto UniqueIdOffset = PlayerState->GetOffset("UniqueId");
|
||||
|
||||
if (IsBadReadPtr(PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)))
|
||||
continue;
|
||||
|
||||
if (PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->IsIdentical((FUniqueNetIdRepl*)&UniqueId))
|
||||
{
|
||||
LOG_INFO(LogDev, "Found!");
|
||||
return PlayerState->GetTeamIndex() - NumToSubtractFromSquadId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ bool UFortKismetLibrary::PickLootDropsHook(UObject* Context, FFrame& Stack, bool
|
||||
|
||||
LOG_INFO(LogDev, "Picking loot for {}.", TierGroupName.ComparisonIndex.Value ? TierGroupName.ToString() : "InvalidName");
|
||||
|
||||
auto LootDrops = PickLootDrops(TierGroupName, GameState->GetWorldLevel(), -1, true);
|
||||
auto LootDrops = PickLootDrops(TierGroupName, WorldLevel, ForcedLootTier);
|
||||
|
||||
for (int i = 0; i < LootDrops.size(); i++)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ struct FUniqueNetIdRepl // : public FUniqueNetIdWrapper
|
||||
{
|
||||
static UStruct* GetStruct()
|
||||
{
|
||||
static auto Struct = FindObject<UStruct>("/Script/Engine.UniqueNetIdRepl");
|
||||
static auto Struct = FindObject<UStruct>(L"/Script/Engine.UniqueNetIdRepl");
|
||||
return Struct;
|
||||
}
|
||||
|
||||
@@ -30,17 +30,21 @@ struct FUniqueNetIdRepl // : public FUniqueNetIdWrapper
|
||||
|
||||
bool bTest = true;
|
||||
|
||||
if (this->GetReplicationBytes().Num() > this->GetReplicationBytes().Num()) // != ?
|
||||
bTest = false;
|
||||
|
||||
for (int i = 0; i < this->GetReplicationBytes().Num(); i++)
|
||||
if (this->GetReplicationBytes().Num() >= OtherUniqueId->GetReplicationBytes().Num())
|
||||
{
|
||||
if (this->GetReplicationBytes().at(i) != OtherUniqueId->GetReplicationBytes().at(i))
|
||||
for (int i = 0; i < this->GetReplicationBytes().Num(); i++)
|
||||
{
|
||||
bTest = false;
|
||||
break;
|
||||
if (this->GetReplicationBytes().at(i) != OtherUniqueId->GetReplicationBytes().at(i))
|
||||
{
|
||||
bTest = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bTest = false;
|
||||
}
|
||||
|
||||
// LOG_INFO(LogDev, "btest: {}", bTest);
|
||||
|
||||
|
||||
@@ -367,6 +367,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
|
||||
Addresses::SetupVersion();
|
||||
|
||||
NumToSubtractFromSquadId = Engine_Version >= 424 ? 2 : 3; // TODO: check this
|
||||
NumElementsPerChunk = std::floor(Fortnite_Version) >= 5 && Fortnite_Version <= 6 ? 0x10400 : 0x10000; // Idk what version tbh
|
||||
|
||||
Offsets::FindAll(); // We have to do this before because FindCantBuild uses FortAIController.CreateBuildingActor
|
||||
|
||||
@@ -9,7 +9,7 @@ uint64 FindGetPlayerViewpoint()
|
||||
|
||||
uint64 FailedToSpawnPawnAddr = 0;
|
||||
|
||||
auto FailedToSpawnPawnStrRefAddr = Memcury::Scanner::FindStringRef(L"%s failed to spawn a pawn", true, 0, Fortnite_Version >= 18).Get();
|
||||
auto FailedToSpawnPawnStrRefAddr = Memcury::Scanner::FindStringRef(L"%s failed to spawn a pawn", true, 0, Fortnite_Version >= 19).Get();
|
||||
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
|
||||
@@ -220,7 +220,7 @@ static inline uint64 FindRebootingDelegate()
|
||||
if (Fortnite_Version < 8.3)
|
||||
return 0;
|
||||
|
||||
auto ServerOnAttemptInteractAddr = Memcury::Scanner::FindStringRef(L"[SCM] ABuildingGameplayActorSpawnMachine::ServerOnAttemptInteract - Start Rebooting").Get();
|
||||
auto ServerOnAttemptInteractAddr = Memcury::Scanner::FindStringRef(L"[SCM] ABuildingGameplayActorSpawnMachine::ServerOnAttemptInteract - Start Rebooting", true, 0, Fortnite_Version >= 16).Get();
|
||||
|
||||
for (int i = 0; i < 10000; i++)
|
||||
{
|
||||
|
||||
@@ -367,7 +367,14 @@ namespace Hooking
|
||||
static inline void ChangeBytesThing(uint8_t* instrAddr, uint8_t* DetourAddr, int Offset)
|
||||
{
|
||||
int64_t delta = DetourAddr - (instrAddr + Offset + 4);
|
||||
*(int32_t*)(instrAddr + Offset) = static_cast<int32_t>(delta);
|
||||
auto addr = (int32_t*)(instrAddr + Offset);
|
||||
DWORD dwProtection;
|
||||
VirtualProtect((PVOID)addr, 4, PAGE_EXECUTE_READWRITE, &dwProtection);
|
||||
|
||||
*addr = static_cast<int32_t>(delta);
|
||||
|
||||
DWORD dwTemp;
|
||||
VirtualProtect((PVOID)addr, 1, dwProtection, &dwTemp);
|
||||
}
|
||||
|
||||
enum ERelativeOffsets
|
||||
|
||||
Reference in New Issue
Block a user