dispatch request

This commit is contained in:
Milxnor
2023-03-08 01:39:09 -05:00
parent eb3685c070
commit 1fd8f0f93f
43 changed files with 1048 additions and 224 deletions

View File

@@ -226,6 +226,15 @@ static inline uint64 FindStaticLoadObject()
static inline uint64 FindNoMCP()
{
auto fn = FindObject<UFunction>("/Script/FortniteGame.FortKismetLibrary.IsRunningNoMCP");
LOG_INFO(LogDev, "fn: {}", __int64(fn));
if (!fn)
return 0;
auto noMcpIthink = GetFunctionIdxOrPtr(fn);
return noMcpIthink;
if (Fortnite_Version == 4)
return Memcury::Scanner::FindPattern("E8 ? ? ? ? 83 A7 ? ? ? ? ? 83 E0 01").RelativeOffset(1).Get();
@@ -282,6 +291,9 @@ static inline uint64 FindActorGetNetMode()
static inline uint64 FindTickFlush()
{
// auto add = Memcury::Scanner::FindStringRef(L"UDemoNetDriver::TickFlush: ReplayStreamer ERROR: %s");
// return Memcury::Scanner(FindBytes(add, { 0xE8 }, 500, 0, true, 1)).RelativeOffset(1).Get();
if (Engine_Version == 427)
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 18 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 B8 0F 29 78 A8 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 8A").Get();
@@ -289,10 +301,38 @@ static inline uint64 FindTickFlush()
return FindBytes(Addr, (Fortnite_Version < 18 ? std::vector<uint8_t>{ 0x4C, 0x8B } : std::vector<uint8_t>{ 0x48, 0x8B, 0xC4 }), 1000, 0, true);
}
static inline uint64 FindAddNavigationSystemToWorld()
{
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 33 ED 41").Get();
}
static inline uint64 FindNavSystemCleanUp()
{
auto Addr = Memcury::Scanner::FindStringRef(L"UNavigationSystemV1::CleanUp", false);
if (!Addr.Get())
return 0;
return FindBytes(Addr, { 0x48, 0x89, 0x5C }, 500, 0, true);
}
static inline uint64 FindLoadPlayset()
{
auto StringRef = Memcury::Scanner::FindStringRef(L"UPlaysetLevelStreamComponent::LoadPlayset Error: no owner for %s", Fortnite_Version >= 7);
if (!StringRef.Get())
return 0;
return FindBytes(StringRef, { 0x48, 0x89, 0x5C }, 1000, 0, true);
}
static inline uint64 FindGIsServer()
{
if (Fortnite_Version == 19.10)
return __int64(GetModuleHandleW(0)) + 0xB30CF9D;
// auto add = Memcury::Scanner::FindStringRef(L"STAT_UpdateLevelStreaming");
// return Memcury::Scanner(FindBytes(add, { 0x80, 0x3D }, 100, 0, true, 1)).RelativeOffset(2).Get();
// if (Fortnite_Version == 19.10)
// return __int64(GetModuleHandleW(0)) + 0xB30CF9D;
if (Fortnite_Version == 17.30)
return __int64(GetModuleHandleW(0)) + 0x973E499;
@@ -300,8 +340,64 @@ static inline uint64 FindGIsServer()
return 0;
auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering");
auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, 1);
Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, 1);
std::vector<std::vector<uint8_t>> BytesArray = { { 0xC6, 0x05 }, { 0x88, 0x1D } };
int Skip = 1;
uint64 Addy;
for (int i = 0; i < 50; i++) // we should subtract from skip if goup
{
auto CurrentByte = *(Memcury::ASM::MNEMONIC*)(Addr.Get() - i);
// if (bPrint)
// std::cout << "CurrentByte: " << std::hex << (int)CurrentByte << '\n';
bool ShouldBreak = false;
for (auto& Bytes : BytesArray)
{
if (CurrentByte == Bytes[0])
{
bool Found = true;
for (int j = 1; j < Bytes.size(); j++)
{
if (*(Memcury::ASM::MNEMONIC*)(Addr.Get() - i + j) != Bytes[j])
{
Found = false;
break;
}
}
if (Found)
{
LOG_INFO(LogDev, "[{}] Skip: 0x{:x}", Skip, Memcury::Scanner(Addr.Get() - i).RelativeOffset(2).Get() - __int64(GetModuleHandleW(0)));
if (Skip > 0)
{
Skip--;
continue;
}
Addy = Addr.Get() - i;
ShouldBreak = true;
break;
}
}
}
if (ShouldBreak)
break;
// std::cout << std::format("CurrentByte: 0x{:x}\n", (uint8_t)CurrentByte);
}
/* int Skip = 2;
auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x88, 0x1D }, 50, 0, true, Skip); */
LOG_INFO(LogDev, "Addy: 0x{:x}", Addy - __int64(GetModuleHandleW(0)));
return Memcury::Scanner(Addy).RelativeOffset(2).Get();
}
@@ -323,6 +419,12 @@ static inline uint64 FindChangeGameSessionId()
return FindBytes(Addr, { 0x40, 0x55 }, 2000, 0, true);
}
static inline uint64 FindDispatchRequest()
{
auto Addr = Memcury::Scanner::FindStringRef(L"MCP-Profile: Dispatching request to %s", true, 0, Fortnite_Version >= 18); // todo check s18
return FindBytes(Addr, { 0x48, 0x89, 0x5C }, 300, 0, true);
}
static inline uint64 FindGIsClient()
{
if (Fortnite_Version == 17.30)
@@ -331,10 +433,76 @@ static inline uint64 FindGIsClient()
return 0;
auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering");
auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, 2);
Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, 2);
std::vector<std::vector<uint8_t>> BytesArray = { { 0xC6, 0x05 }, { 0x88, 0x1D } };
int Skip = 2;
uint64 Addy;
for (int i = 0; i < 50; i++) // we should subtract from skip if goup
{
auto CurrentByte = *(Memcury::ASM::MNEMONIC*)(Addr.Get() - i);
// if (bPrint)
// std::cout << "CurrentByte: " << std::hex << (int)CurrentByte << '\n';
bool ShouldBreak = false;
for (auto& Bytes : BytesArray)
{
if (CurrentByte == Bytes[0])
{
bool Found = true;
for (int j = 1; j < Bytes.size(); j++)
{
if (*(Memcury::ASM::MNEMONIC*)(Addr.Get() - i + j) != Bytes[j])
{
Found = false;
break;
}
}
if (Found)
{
LOG_INFO(LogDev, "[{}] Skip: 0x{:x}", Skip, Memcury::Scanner(Addr.Get() - i).RelativeOffset(2).Get() - __int64(GetModuleHandleW(0)));
if (Skip > 0)
{
Skip--;
continue;
}
Addy = Addr.Get() - i;
ShouldBreak = true;
break;
}
}
}
if (ShouldBreak)
break;
// std::cout << std::format("CurrentByte: 0x{:x}\n", (uint8_t)CurrentByte);
}
/* int Skip = 2;
auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x88, 0x1D }, 50, 0, true, Skip); */
LOG_INFO(LogDev, "Addy: 0x{:x}", Addy - __int64(GetModuleHandleW(0)));
return Memcury::Scanner(Addy).RelativeOffset(2).Get();
/*
auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering");
int Skip = 1;
auto Addy = FindBytes(Addr, { 0xC6, 0x05 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x44, 0x88 }, 50, 0, true, Skip);
Addy = Addy ? Addy : FindBytes(Addr, { 0x88, 0x1D }, 50, 0, true, Skip);
return Memcury::Scanner(Addy).RelativeOffset(2).Get();
*/
}
static inline uint64 FindGetNetMode()