works on 2.203

This commit is contained in:
matcool 2024-01-11 12:55:54 -03:00
parent 9b22d48352
commit 635fe1bb00
3 changed files with 10 additions and 4 deletions
CMakeLists.txt
loader
launcher/windows
src/platform/windows

View file

@ -78,7 +78,7 @@ include(cmake/CPM.cmake)
if (NOT DEFINED GEODE_GD_VERSION)
if (${GEODE_TARGET_PLATFORM} STREQUAL "Win32")
set(GEODE_GD_VERSION 2.202)
set(GEODE_GD_VERSION 2.203)
else()
set(GEODE_GD_VERSION 2.200)
endif()

View file

@ -1,5 +1,7 @@
#include <Windows.h>
#include <Xinput.h>
#include <stdio.h>
#include <inttypes.h>
#ifndef MAX_PATH
#define MAX_PATH 260
@ -86,6 +88,7 @@ BOOL fileExists(char const* path) {
#define TIMESTAMP_FOR_2_200 1702921605
#define TIMESTAMP_FOR_2_201 1704582672
#define TIMESTAMP_FOR_2_202 1704601266
#define TIMESTAMP_FOR_2_203 1704948277
#define GEODE_WRAPPER_CONCAT(x, y) x##y
#define GEODE_CONCAT(x, y) GEODE_WRAPPER_CONCAT(x, y)
@ -100,12 +103,15 @@ BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID _) {
DisableThreadLibraryCalls(module);
if (fileExists("Geode.dll")) {
if (getExeTimestamp() == TIMESTAMP) {
unsigned int timestamp = getExeTimestamp();
if (timestamp == TIMESTAMP) {
// somehow, this works fine inside of dllmain :-)
// yes, even on wine.
LoadLibraryA("Geode.dll");
} else {
MessageBoxA(NULL, "GD version mismatch, not loading Geode.", "Unable to load Geode!", MB_OK | MB_ICONWARNING);
char buffer[128];
sprintf_s(buffer, sizeof(buffer), "GD version mismatch, not loading Geode. (%" PRIu32 ")", timestamp);
MessageBoxA(NULL, buffer, "Unable to load Geode!", MB_OK | MB_ICONWARNING);
}
}

View file

@ -50,7 +50,7 @@ std::string loadGeode() {
MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE
);
static constexpr uintptr_t MAIN_OFFSET = 0x3bdfd0;
static constexpr uintptr_t MAIN_OFFSET = 0x3c0a00;
auto patchAddr = geode::base::get() + MAIN_OFFSET;
constexpr size_t patchSize = 6;