From 4a320a3659b95b421a1ca90234c0f21555e8cc86 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 30 Mar 2020 13:19:35 -0600 Subject: [PATCH] use bottom 16 bits of ctx (deals with aslr) --- CMakeLists.txt | 5 +++-- GUI/mainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e7eaf3..5968dd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(Textractor) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -36,5 +36,6 @@ add_subdirectory(texthook) add_subdirectory(extensions) add_subdirectory(test) if (DEFINED VERSION) - add_subdirectory(GUI/host) # uncomment to build CLI + add_subdirectory(GUI/host) endif() +#add_subdirectory(GUI/host) diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 04d719f..275cfba 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -530,7 +530,7 @@ namespace void ThreadAdded(TextThread& thread) { std::wstring threadCode = HookCode::Generate(thread.hp, thread.tp.processId); - bool savedMatch = savedThreadCtx == thread.tp.ctx && savedThreadCtx2 == thread.tp.ctx2 && savedThreadCode == threadCode; + bool savedMatch = (savedThreadCtx & 0xFFFF) == (thread.tp.ctx & 0xFFFF) && savedThreadCtx2 == thread.tp.ctx2 && savedThreadCode == threadCode; if (savedMatch) { savedThreadCtx = savedThreadCtx2 = savedThreadCode[0] = 0;