use bottom 16 bits of ctx (deals with aslr)

This commit is contained in:
Akash Mozumdar 2020-03-30 13:19:35 -06:00
parent 26960cf099
commit 4a320a3659
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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;