forked from Public-Mirror/Textractor
hopefully remove dependency on vcredist for good
This commit is contained in:
parent
febff243d3
commit
e83579ed7c
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "texthook/minhook"]
|
||||
path = texthook/minhook
|
||||
url = https://github.com/TsudaKageyu/minhook.git
|
@ -18,11 +18,11 @@ add_compile_options(
|
||||
)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
link_directories(x64libs)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x64)
|
||||
link_directories(x64libs)
|
||||
else()
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
link_directories(x86libs)
|
||||
set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/builds/${CMAKE_BUILD_TYPE}_x86)
|
||||
link_directories(x86libs)
|
||||
endif()
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY $<1:${CMAKE_FINAL_OUTPUT_DIRECTORY}>)
|
||||
@ -44,6 +44,6 @@ add_subdirectory(texthook)
|
||||
add_subdirectory(extensions)
|
||||
add_subdirectory(test)
|
||||
if (DEFINED VERSION)
|
||||
add_subdirectory(GUI/host)
|
||||
add_subdirectory(GUI/host)
|
||||
endif()
|
||||
#add_subdirectory(GUI/host)
|
||||
|
@ -1,32 +1,50 @@
|
||||
include_directories(. util)
|
||||
include_directories(. util minhook/include)
|
||||
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(texthook_src
|
||||
main.cc
|
||||
texthook.cc
|
||||
hookfinder.cc
|
||||
engine/match.cc
|
||||
engine/match64.cc
|
||||
engine/native/pchooks.cc
|
||||
util/ithsys/ithsys.cc
|
||||
util/util.cc
|
||||
)
|
||||
set(minhook_src
|
||||
minhook/src/buffer.c
|
||||
minhook/src/hook.c
|
||||
minhook/src/trampoline.c
|
||||
minhook/src/hde/hde64.c
|
||||
)
|
||||
set(texthook_src
|
||||
main.cc
|
||||
texthook.cc
|
||||
hookfinder.cc
|
||||
engine/match.cc
|
||||
engine/match64.cc
|
||||
engine/native/pchooks.cc
|
||||
util/ithsys/ithsys.cc
|
||||
util/util.cc
|
||||
)
|
||||
else()
|
||||
set(texthook_src
|
||||
main.cc
|
||||
texthook.cc
|
||||
hookfinder.cc
|
||||
engine/engine.cc
|
||||
engine/match.cc
|
||||
engine/match32.cc
|
||||
engine/native/pchooks.cc
|
||||
util/util.cc
|
||||
util/ithsys/ithsys.cc
|
||||
util/disasm/disasm.cc
|
||||
util/memdbg/memsearch.cc
|
||||
)
|
||||
set(minhook_src
|
||||
minhook/src/buffer.c
|
||||
minhook/src/hook.c
|
||||
minhook/src/trampoline.c
|
||||
minhook/src/hde/hde32.c
|
||||
)
|
||||
set(texthook_src
|
||||
main.cc
|
||||
texthook.cc
|
||||
hookfinder.cc
|
||||
engine/engine.cc
|
||||
engine/match.cc
|
||||
engine/match32.cc
|
||||
engine/native/pchooks.cc
|
||||
util/util.cc
|
||||
util/ithsys/ithsys.cc
|
||||
util/disasm/disasm.cc
|
||||
util/memdbg/memsearch.cc
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(minhook ${minhook_src})
|
||||
add_library(texthook MODULE ${texthook_src})
|
||||
target_precompile_headers(texthook REUSE_FROM pch)
|
||||
target_precompile_headers(texthook PRIVATE ../include/common.h)
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||
target_compile_options(minhook PRIVATE /MT)
|
||||
target_compile_options(texthook PRIVATE /MT)
|
||||
target_link_options(texthook PRIVATE /NODEFAULTLIB:MSVCRT)
|
||||
endif()
|
||||
target_link_libraries(texthook minhook)
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "defs.h"
|
||||
#include "main.h"
|
||||
#include "util.h"
|
||||
#include "MinHook.h"
|
||||
|
||||
extern const char* HOOK_SEARCH_STARTING;
|
||||
extern const char* HOOK_SEARCH_INITIALIZING;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "texthook.h"
|
||||
#include "hookfinder.h"
|
||||
#include "util.h"
|
||||
#include "MinHook.h"
|
||||
|
||||
extern const char* PIPE_CONNECTED;
|
||||
extern const char* INSERTING_HOOK;
|
||||
|
@ -15,49 +15,6 @@ void RemoveHook(uint64_t addr, int maxOffset = 9);
|
||||
|
||||
inline SearchParam spDefault;
|
||||
|
||||
extern "C" // minhook library
|
||||
{
|
||||
enum MH_STATUS
|
||||
{
|
||||
MH_OK,
|
||||
MH_ERROR_ALREADY_INITIALIZED,
|
||||
MH_ERROR_NOT_INITIALIZED,
|
||||
MH_ERROR_ALREADY_CREATED,
|
||||
MH_ERROR_NOT_CREATED,
|
||||
MH_ERROR_ENABLED,
|
||||
MH_ERROR_DISABLED,
|
||||
MH_ERROR_NOT_EXECUTABLE,
|
||||
MH_ERROR_UNSUPPORTED_FUNCTION,
|
||||
MH_ERROR_MEMORY_ALLOC,
|
||||
MH_ERROR_MEMORY_PROTECT,
|
||||
MH_ERROR_MODULE_NOT_FOUND,
|
||||
MH_ERROR_FUNCTION_NOT_FOUND
|
||||
};
|
||||
|
||||
MH_STATUS WINAPI MH_Initialize(VOID);
|
||||
MH_STATUS WINAPI MH_Uninitialize(VOID);
|
||||
|
||||
// Creates a Hook for the specified target function, in disabled state.
|
||||
// Parameters:
|
||||
// pTarget [in] A pointer to the target function, which will be
|
||||
// overridden by the detour function.
|
||||
// pDetour [in] A pointer to the detour function, which will override
|
||||
// the target function.
|
||||
// ppOriginal [out] A pointer to the trampoline function, which will be
|
||||
// used to call the original target function.
|
||||
// This parameter can be NULL.
|
||||
MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);
|
||||
MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
|
||||
MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
|
||||
MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);
|
||||
MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);
|
||||
MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);
|
||||
MH_STATUS WINAPI MH_ApplyQueued(VOID);
|
||||
const char* WINAPI MH_StatusToString(MH_STATUS status);
|
||||
}
|
||||
|
||||
#define MH_ALL_HOOKS NULL
|
||||
|
||||
#define ITH_RAISE (*(int*)0 = 0) // raise C000005, for debugging only
|
||||
#define ITH_TRY __try
|
||||
#define ITH_EXCEPT __except(EXCEPTION_EXECUTE_HANDLER)
|
||||
|
1
texthook/minhook
Submodule
1
texthook/minhook
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 8fda4f5481fed5797dc2651cd91e238e9b3928c6
|
@ -6,6 +6,7 @@
|
||||
#include "texthook.h"
|
||||
#include "main.h"
|
||||
#include "ithsys/ithsys.h"
|
||||
#include "MinHook.h"
|
||||
|
||||
extern const char* FUNC_MISSING;
|
||||
extern const char* MODULE_MISSING;
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user