mirror of
https://github.com/ApfelTeeSaft/Starfall.git
synced 2026-08-26 19:33:39 +00:00
yellow meowchi meme is massive
This commit is contained in:
@@ -26,9 +26,7 @@ namespace Starfall {
|
||||
}
|
||||
|
||||
buf = *(void**)(__readgsqword(0x60) + 0x10);
|
||||
EOSBuf = GetModuleHandleA("EOSSDK-Win64-Shipping.dll");
|
||||
if (!EOSBuf)
|
||||
EOSBuf = LoadLibraryA("EOSSDK-Win64-Shipping.dll");
|
||||
EOSBuf = LoadLibraryA("EOSSDK-Win64-Shipping");
|
||||
|
||||
{
|
||||
auto section = pe_get_section((char*)buf, ".text");
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ namespace Starfall {
|
||||
patch8
|
||||
};
|
||||
|
||||
constexpr static struct pf_patchset_t patchset2 = pf_construct_patchset(patches2, sizeof(patches2) / sizeof(struct pf_patch_t), (bool (*)(void*, size_t, pf_patchset_t))pf_find_maskmatch);
|
||||
constexpr static struct pf_patchset_t patchset2 = pf_construct_patchset(patches2, sizeof(patches2) / sizeof(struct pf_patch_t));
|
||||
|
||||
pf_patchset_emit(tbuf, tsize, patchset2);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace Starfall {
|
||||
patch4
|
||||
};
|
||||
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t), (bool (*)(void*, size_t, pf_patchset_t))pf_find_maskmatch);
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t));
|
||||
|
||||
pf_patchset_emit(tbuf, tsize, patchset);
|
||||
//AsmHook((void*)(uint64_t(buf) + 0x221a404), Hooks::RequestExitWithStatusHook);
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace Starfall {
|
||||
L"ol.epicgames.com",
|
||||
L"ol.epicgames.net",
|
||||
//L".akamaized.net", // if you have your own blurl
|
||||
//L"cdn2.unrealengine.com", // only needed if you have fixed friend images in friends list
|
||||
L"on.epicgames.com",
|
||||
L"game-social.epicgames.com",
|
||||
L"ak.epicgames.com",
|
||||
L"epicgames.dev"
|
||||
//L"cdn2.unrealengine.com" // only needed if you have fixed friend images in friends list
|
||||
};
|
||||
|
||||
for (int i = 0; i < sizeof(redirectedUrls) / sizeof(wchar_t *); i++) {
|
||||
|
||||
+30
-55
@@ -17,7 +17,7 @@ namespace Unreal {
|
||||
return ((FString&(*)(FCurlHttpRequest*, FString)) VTable[0])(this, FString());
|
||||
}
|
||||
|
||||
void FCurlHttpRequest::SetURL(URL& URL)
|
||||
__forceinline void FCurlHttpRequest::SetURL(URL& URL)
|
||||
{
|
||||
FString str = URL;
|
||||
((void (*)(FCurlHttpRequest*, FString)) VTable[SetURLIdx])(this, str);
|
||||
@@ -62,7 +62,7 @@ def:
|
||||
ml_patch
|
||||
};
|
||||
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t), (bool (*)(void*, size_t, pf_patchset_t))pf_find_maskmatch);
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t));
|
||||
|
||||
pf_patchset_emit(tbuf, tsize, patchset);
|
||||
setupMemLeak = true;
|
||||
@@ -133,87 +133,62 @@ def:
|
||||
};
|
||||
|
||||
|
||||
void* checkStream(void *stream) {
|
||||
__forceinline void* checkStream(void *stream) {
|
||||
for (int i = 0; i < 2048; i++) {
|
||||
if (CheckBytes<0x4C, 0x8B, 0xDC>(stream, i, true)) {
|
||||
Log(Display, "Found using 4.25 & 4.26 method\n");
|
||||
Log(Display, "Found with 4C 8B DC\n");
|
||||
goto setStream;
|
||||
}
|
||||
else if (CheckBytes<0x48, 0x8B, 0xC4>(stream, i, true)) {
|
||||
Log(Display, "Found using UE 4.27 - 5.3 method\n");
|
||||
Log(Display, "Found with 48 8B C4\n");
|
||||
setStream:
|
||||
return (uint8_t*)stream - i;
|
||||
}
|
||||
else if (CheckBytes<0x48, 0x81, 0xEC>(stream, i, true) || CheckBytes<0x48, 0x83, 0xEC>(stream, i, true)) {
|
||||
for (int x = 0; x < 50; x++) {
|
||||
if (CheckBytes<0x40>(stream, i + x, true)) {
|
||||
Log(Display, "Found using UE 4.16 - 4.26 & 5.4+ method\n");
|
||||
Log(Display, "Found with 40\n");
|
||||
return (uint8_t*)stream - i - x;
|
||||
}
|
||||
else if (CheckBytes<0x4C, 0x8B, 0xDC>(stream, i + x, true) || CheckBytes<0x48, 0x8B, 0xC4>(stream, i + x, true))
|
||||
else if (CheckBytes<0x4C, 0x8B, 0xDC>(stream, i + x, true) || CheckBytes<0x48, 0x8B, 0xC4>(stream, i + x, true) || CheckBytes<0x48, 0x89, 0x5C>(stream, i + x, true))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (CheckBytes<0x48, 0x89, 0x5C>(stream, i, true)) {
|
||||
Log(Display, "Found with 49 89 5C\n");
|
||||
goto setStream;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
bool StringCallback(struct pf_patch_t* patch, void* stream) {
|
||||
|
||||
bool InternalCallback(void* stream, void* rbuf, size_t rsize, bool (*callback)(pf_patch_t*, void*)) {
|
||||
void* saddr = (void*)((__int64(stream) + 7) + *(int32_t*)(__int64(stream) + 3));
|
||||
void* newStream = nullptr;
|
||||
if (__int64(saddr) >= __int64(rbuf) && __int64(saddr) < (__int64(rbuf) + (int64_t)rsize)) {
|
||||
if (wcscmp((wchar_t*)saddr, L"%p: request (easy handle:%p) has been added to threaded queue for processing") == 0) {
|
||||
newStream = checkStream(stream);
|
||||
}
|
||||
else if (wcscmp((wchar_t*)saddr, L"STAT_FCurlHttpRequest_ProcessRequest") == 0) {
|
||||
newStream = checkStream(stream);
|
||||
}
|
||||
}
|
||||
if (newStream) {
|
||||
Log(Display, "ProcessRequest: 0x%llx\n", __int64(newStream) - __int64(buf));
|
||||
char* ptrMatches = (char*)&newStream;
|
||||
|
||||
auto patch2 = pf_construct_patch(ptrMatches, (void*)ptrMasks, 8, PtrCallback);
|
||||
|
||||
struct pf_patch_t patches2[] = {
|
||||
patch2
|
||||
};
|
||||
|
||||
struct pf_patchset_t patchset2 = pf_construct_patchset(patches2, sizeof(patches2) / sizeof(struct pf_patch_t), (bool (*)(void*, size_t, pf_patchset_t))pf_find_maskmatch);
|
||||
while (!pf_patchset_emit(rbuf, rsize, patchset2));
|
||||
return true;
|
||||
}
|
||||
if (__int64(saddr) >= __int64(rbuf) && __int64(saddr) < (__int64(rbuf) + (int64_t)rsize))
|
||||
if (wcscmp((wchar_t*)saddr, L"STAT_FCurlHttpRequest_ProcessRequest") == 0 || wcscmp((wchar_t*)saddr, L"%p: request (easy handle:%p) has been added to threaded queue for processing") == 0)
|
||||
if (newStream = checkStream(stream)) goto Out;
|
||||
return false;
|
||||
}
|
||||
Out:
|
||||
char* ptrMatches = (char*)&newStream;
|
||||
|
||||
bool EOSStringCallback(struct pf_patch_t* patch, void* stream) {
|
||||
void* saddr = (void*)((__int64(stream) + 7) + *(int32_t*)(__int64(stream) + 3));
|
||||
if (__int64(saddr) >= __int64(EOSRDataBuf) && __int64(saddr) < (__int64(EOSRDataBuf) + (int64_t)EOSRDataSize)) {
|
||||
if (wcscmp((wchar_t*)saddr, L"%p: request (easy handle:%p) has been added to threaded queue for processing") == 0) {
|
||||
for (int i = 0; i < 2048; i++) {
|
||||
if (CheckBytes<0x48, 0x89, 0x5C>(stream, i, true)) {
|
||||
Log(Display, "Found EOS ProcessRequest\n");
|
||||
stream = (uint8_t*)stream - i;
|
||||
goto HookVT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
HookVT:
|
||||
Log(Display, "EOS ProcessRequest: 0x%llx\n", __int64(stream) - __int64(EOSBuf));
|
||||
|
||||
char* ptrMatches = (char*)&stream;
|
||||
|
||||
auto patch2 = pf_construct_patch(ptrMatches, (void*)ptrMasks, 8, EOSPtrCallback);
|
||||
auto patch2 = pf_construct_patch(ptrMatches, (void*)ptrMasks, 8, callback);
|
||||
|
||||
struct pf_patch_t patches2[] = {
|
||||
patch2
|
||||
};
|
||||
|
||||
struct pf_patchset_t patchset2 = pf_construct_patchset(patches2, sizeof(patches2) / sizeof(struct pf_patch_t), (bool (*)(void*, size_t, pf_patchset_t))pf_find_maskmatch);
|
||||
while (!pf_patchset_emit(EOSRDataBuf, EOSRDataSize, patchset2));
|
||||
struct pf_patchset_t patchset2 = pf_construct_patchset(patches2, sizeof(patches2) / sizeof(struct pf_patch_t));
|
||||
while (!pf_patchset_emit(rbuf, rsize, patchset2));
|
||||
return true;
|
||||
}
|
||||
bool StringCallback(struct pf_patch_t* patch, void* stream) {
|
||||
return InternalCallback(stream, rbuf, rsize, PtrCallback);
|
||||
}
|
||||
|
||||
bool EOSStringCallback(struct pf_patch_t* patch, void* stream) {
|
||||
return InternalCallback(stream, EOSRDataBuf, EOSRDataSize, EOSPtrCallback);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Finders {
|
||||
@@ -233,7 +208,7 @@ def:
|
||||
patch
|
||||
};
|
||||
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t), pf_find_maskmatch);
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t));
|
||||
|
||||
while (!pf_patchset_emit(tbuf, tsize, patchset));
|
||||
}
|
||||
@@ -246,7 +221,7 @@ def:
|
||||
patch
|
||||
};
|
||||
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t), pf_find_maskmatch);
|
||||
constexpr static struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t));
|
||||
|
||||
while (!pf_patchset_emit(EOSTextBuf, EOSTextSize, patchset));
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ struct pf_patch_t {
|
||||
struct pf_patchset_t {
|
||||
struct pf_patch_t *patches;
|
||||
uint32_t count;
|
||||
bool (*handler)(void *buf, size_t size, struct pf_patchset_t patch);
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
@@ -60,22 +59,21 @@ constexpr pf_patch_t pf_construct_patch_dynmatch(void* masks, uint32_t count, bo
|
||||
return patch;
|
||||
}
|
||||
|
||||
constexpr struct pf_patchset_t pf_construct_patchset(struct pf_patch_t* patches, uint32_t count, bool (*handler)(void *buf, size_t size, struct pf_patchset_t patchset)) {
|
||||
constexpr struct pf_patchset_t pf_construct_patchset(struct pf_patch_t* patches, uint32_t count) {
|
||||
struct pf_patchset_t patchset;
|
||||
|
||||
patchset.patches = patches;
|
||||
patchset.count = count;
|
||||
patchset.handler = handler;
|
||||
|
||||
return patchset;
|
||||
}
|
||||
|
||||
__forceinline constexpr struct pf_patchset_t pf_construct_patchset(const struct pf_patch_t* patches, uint32_t count, bool (*handler)(void* buf, size_t size, struct pf_patchset_t patchset)) {
|
||||
return pf_construct_patchset((struct pf_patch_t*)patches, count, handler);
|
||||
__forceinline constexpr struct pf_patchset_t pf_construct_patchset(const struct pf_patch_t* patches, uint32_t count) {
|
||||
return pf_construct_patchset((struct pf_patch_t*)patches, count);
|
||||
}
|
||||
#else
|
||||
PF_C struct pf_patch_t pf_construct_patch(void *matches, void *masks, uint32_t count, bool (*callback)(struct pf_patch_t *patch, void *stream));
|
||||
PF_C struct pf_patchset_t pf_construct_patchset(struct pf_patch_t* patches, uint32_t count, bool (*handler)(void* buf, size_t size, struct pf_patchset_t patchset));
|
||||
PF_C struct pf_patchset_t pf_construct_patchset(struct pf_patch_t* patches, uint32_t count);
|
||||
#endif
|
||||
PF_C bool pf_patchset_emit(void *buf, size_t size, struct pf_patchset_t patchset);
|
||||
PF_C void pf_disable_patch(struct pf_patch_t *patch);
|
||||
|
||||
@@ -22,7 +22,6 @@ struct pf_patch8_t {
|
||||
struct pf_patchset8_t {
|
||||
struct pf_patch8_t *patches;
|
||||
uint32_t count;
|
||||
bool (*handler)(void *buf, size_t size, struct pf_patchset8_t patch);
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
|
||||
@@ -24,18 +24,17 @@ struct pf_patch_t pf_construct_patch(void *matches, void *masks, uint32_t count,
|
||||
return patch;
|
||||
}
|
||||
|
||||
struct pf_patchset_t pf_construct_patchset(struct pf_patch_t *patches, uint32_t count, bool (*handler)(void *buf, size_t size, struct pf_patchset_t patchset)) {
|
||||
struct pf_patchset_t pf_construct_patchset(struct pf_patch_t *patches, uint32_t count) {
|
||||
struct pf_patchset_t patchset;
|
||||
|
||||
patchset.patches = patches;
|
||||
patchset.count = count;
|
||||
patchset.handler = handler;
|
||||
|
||||
return patchset;
|
||||
}
|
||||
|
||||
bool pf_patchset_emit(void *buf, size_t size, struct pf_patchset_t patchset) {
|
||||
return patchset.handler(buf, size, patchset);
|
||||
return pf_find_maskmatch(buf, size, patchset);
|
||||
}
|
||||
|
||||
void pf_disable_patch(struct pf_patch_t *patch) {
|
||||
@@ -133,7 +132,7 @@ void *pf_find_zero_buf(void *buf, size_t size, size_t shc_count) {
|
||||
patch
|
||||
};
|
||||
|
||||
struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t), (bool (*)(void *, size_t, struct pf_patchset_t)) pf_find_maskmatch);
|
||||
struct pf_patchset_t patchset = pf_construct_patchset(patches, sizeof(patches) / sizeof(struct pf_patch_t));
|
||||
|
||||
pf_patchset_emit(buf, size, patchset);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ bool pf_maskmatch(uint8_t insn, uint8_t match, uint8_t mask) {
|
||||
return (insn & mask) == match;
|
||||
}
|
||||
|
||||
bool pf_find_maskmatch(void *buf, size_t size, struct pf_patchset_t patchset) {
|
||||
__declspec(noinline) bool pf_find_maskmatch(void *buf, size_t size, struct pf_patchset_t patchset) {
|
||||
uint8_t *stream = buf;
|
||||
|
||||
for (uint64_t i = 0; i < size; i++) {
|
||||
@@ -27,23 +27,7 @@ bool pf_find_maskmatch(void *buf, size_t size, struct pf_patchset_t patchset) {
|
||||
|
||||
if (x == patch->count) {
|
||||
if (patch->callback(patch, stream + i)) {
|
||||
uint32_t disabled = 0;
|
||||
for (uint32_t p = 0; p < patchset.count; p++) {
|
||||
struct pf_patch8_t* pt = (struct pf_patch8_t *) patchset.patches + p;
|
||||
if (pt->disabled) {
|
||||
disabled++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (patch->callback == pt->callback) {
|
||||
DWORD og;
|
||||
VirtualProtect(pt + offsetof(struct pf_patch8_t, disabled), sizeof(bool), PAGE_READWRITE, &og); // this is only needed bc constexpr lmao
|
||||
pt->disabled = true; // disable patches that have already been found
|
||||
VirtualProtect(pt + offsetof(struct pf_patch8_t, disabled), sizeof(bool), og, &og);
|
||||
disabled++;
|
||||
}
|
||||
}
|
||||
if (disabled == patchset.count) return true; // if all are done, return
|
||||
return true; // if all are done, return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user