From 635fe1bb009c2c2421edb09f9499815ed34954ca Mon Sep 17 00:00:00 2001
From: matcool <26722564+matcool@users.noreply.github.com>
Date: Thu, 11 Jan 2024 12:55:54 -0300
Subject: [PATCH] works on 2.203

---
 CMakeLists.txt                        |  2 +-
 loader/launcher/windows/proxyLoader.c | 10 ++++++++--
 loader/src/platform/windows/main.cpp  |  2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa36c2d4..433f3104 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()
diff --git a/loader/launcher/windows/proxyLoader.c b/loader/launcher/windows/proxyLoader.c
index 6380f6cb..a5370af2 100644
--- a/loader/launcher/windows/proxyLoader.c
+++ b/loader/launcher/windows/proxyLoader.c
@@ -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);
         }
     }
 
diff --git a/loader/src/platform/windows/main.cpp b/loader/src/platform/windows/main.cpp
index d1afb002..526982b1 100644
--- a/loader/src/platform/windows/main.cpp
+++ b/loader/src/platform/windows/main.cpp
@@ -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;