diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 9d5dfc4..5b1dc47 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -1002,6 +1002,30 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x41624C8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF79E3E24C8 } + if (std::floor(Fortnite_Version) == 4) + { + auto RetrieveCharacterPartsAddr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 48 83 EC 20 48 8B 01 0F B6 FA 48 8B D9 FF 90 ? ? ? ? 48 8B C8 E8 ? ? ? ? 84 C0 74 0D 33 C0 48 8B 5C 24 ? 48 83 C4 20 5F").Get(); + + LOG_INFO(LogDev, "RetrieveCharacterPartsAddr: {}", RetrieveCharacterPartsAddr); + + for (int i = 0; i < 400; i++) + { + if (*(uint8_t*)(RetrieveCharacterPartsAddr + i) == 0x74) // jz + { + DWORD dwProtection; + VirtualProtect((PVOID)(RetrieveCharacterPartsAddr + i), 1, PAGE_EXECUTE_READWRITE, &dwProtection); + + *(uint8_t*)(RetrieveCharacterPartsAddr + i) = 0x75; // jnz + + DWORD dwTemp; + VirtualProtect((PVOID)(RetrieveCharacterPartsAddr + i), 1, dwProtection, &dwTemp); + + LOG_INFO(LogDev, "Applied RetrieveCharacterParts patch!"); + break; + } + } + } + if (Globals::bGoingToPlayEvent) { if (Fortnite_Version >= 17.30) diff --git a/Project Reboot 3.0/finder.cpp b/Project Reboot 3.0/finder.cpp index dc897ef..3073bd8 100644 --- a/Project Reboot 3.0/finder.cpp +++ b/Project Reboot 3.0/finder.cpp @@ -54,12 +54,12 @@ uint64 FindGIsClient() {0x88, 0x05}, // 20.40 21.00 {0xC6, 0x05}, // mov cs X // Checked on 1.11, 12.41 {0x88, 0x1D}, // mov cs bl // Checked on 17.50, 19.10 - {0x44, 0x88} // IDK WHAT VERSION This for but it scuffs older builds + {0x44, 0x88} // 4.5 }; - int Skip = 2; // Skip GIsServer and some variable i forgot + int Skip = 2; - uint64 Addy; + uint64 Addy = 0; for (int i = 0; i < 50; i++) // we should subtract from skip if go up { @@ -87,16 +87,25 @@ uint64 FindGIsClient() } if (Found) { - int Relative = Bytes[0] == 0x44 ? 3 : 2; + bool bIsScuffedByte = Bytes[0] == 0x44; + int Relative = bIsScuffedByte ? 3 : 2; auto current = Memcury::Scanner(Addr.Get() - i); // LOG_INFO(LogDev, "[{}] No Rel 0x{:x} Rel: 0x{:x}", Skip, current.Get() - __int64(GetModuleHandleW(0)), Memcury::Scanner(Addr.Get() - i).RelativeOffset(Relative).Get() - __int64(GetModuleHandleW(0))); + if (bIsScuffedByte) + { + if (Bytes[2] == 0x74) // DIE 4.5 (todo check length of entire instruction) + continue; + } + if (Skip > 0) { Skip--; continue; } + LOG_INFO(LogDev, "Found GIsClient with byte 0x{:x}", Bytes[0]); + Addy = Bytes[0] == 0xC6 ? current.RelativeOffset(Relative, 1).Get() // If mov cs then we add 1 because the last byte is the value and makes whole instructions 1 byte longer : current.RelativeOffset(Relative).Get(); diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 7a5ee01..e6c787f 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -515,9 +515,9 @@ static inline uint64 FindFree() { uint64 addr = 0; - if (Fortnite_Version <= 3.3) // todo check 3.4 + if (Engine_Version <= 420) // 3.3, 4.1, 4.5 addr = Memcury::Scanner::FindPattern("48 85 C9 74 1D 4C 8B 05 ? ? ? ? 4D 85 C0 0F 84").Get(); - else if (Engine_Version >= 420 && Engine_Version <= 426) + else if (Engine_Version >= 421 && Engine_Version <= 426) addr = Memcury::Scanner::FindPattern("48 85 C9 74 2E 53 48 83 EC 20 48 8B D9").Get(); else if (Engine_Version >= 427) addr = Memcury::Scanner::FindPattern("48 85 C9 0F 84 ? ? ? ? 53 48 83 EC 20 48 89 7C 24 ? 48 8B D9 48 8B 3D").Get(); @@ -1529,8 +1529,8 @@ static inline uint64 FindGetNetMode() static inline uint64 FindApplyCharacterCustomization() { - if (std::floor(Fortnite_Version) == 4) // RetrieveCharacterParts return null if dedicated server????? - return 0; + // if (std::floor(Fortnite_Version) == 4) // RetrieveCharacterParts return null if dedicated server????? + // return 0; auto Addrr = Memcury::Scanner::FindStringRef(L"AFortPlayerState::ApplyCharacterCustomization - Failed initialization, using default parts. Player Controller: %s PlayerState: %s, HeroId: %s", false, 0, Fortnite_Version >= 20, true).Get();