From 762e26df834aa5dc23922ad1f356bf30d2ba275d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 29 Jul 2022 15:49:19 +0200 Subject: [PATCH] Windows: Add a simple window message to get the base pointer. Can be useful for various cheat program hackery. Requested by several, most recently NABN00B. --- Windows/MainWindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index 5850a8b855..e9d578752e 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -87,6 +87,8 @@ int verysleepy__useSendMessage = 1; const UINT WM_VERYSLEEPY_MSG = WM_APP + 0x3117; +const UINT WM_USER_GET_BASE_POINTER = WM_APP + 0x3118; // 0xB118 + // Respond TRUE to a message with this param value to indicate support. const WPARAM VERYSLEEPY_WPARAM_SUPPORTED = 0; // Respond TRUE to a message wit this param value after filling in the addr name. @@ -736,6 +738,17 @@ namespace MainWindow } break; + case WM_USER_GET_BASE_POINTER: + switch (lParam) { + case 0: + return (u32)(u64)Memory::base; + case 1: + return (u32)((u64)Memory::base >> 32); + default: + return 0; + } + break; + case WM_GETMINMAXINFO: { MINMAXINFO *minmax = reinterpret_cast(lParam);