From a290c36b521bc4122ec610c45ef2ab78ec20b32d Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 20 Jul 2018 17:21:35 -0400 Subject: [PATCH 1/5] remove extension code from host --- gui/window.cpp | 3 ++- vnr/extensions/Extensions.cpp | 36 --------------------------- vnr/extensions/Extensions.h | 6 ----- vnr/texthook/CMakeLists.txt | 4 +-- vnr/texthook/hookman.cc | 2 +- vnr/texthook/host.cc | 2 -- vnr/texthook/textthread.cc | 7 +++--- vnr/texthook/textthread.h | 2 +- vnr/{winmutex => texthook}/winmutex.h | 0 9 files changed, 8 insertions(+), 54 deletions(-) delete mode 100644 vnr/extensions/Extensions.cpp delete mode 100644 vnr/extensions/Extensions.h rename vnr/{winmutex => texthook}/winmutex.h (100%) diff --git a/gui/window.cpp b/gui/window.cpp index ba0c222..81d9a5e 100644 --- a/gui/window.cpp +++ b/gui/window.cpp @@ -347,9 +347,10 @@ void ClickButton(HWND hWnd, HWND h) } } -void ThreadOutput(TextThread* thread, std::wstring output) +std::wstring ThreadOutput(TextThread* thread, std::wstring output) { if (thread->Status() & CURRENT_SELECT) texts->AddText(output, false); + return output; } bool GetHookParam(DWORD pid, DWORD hook_addr, HookParam& hp) diff --git a/vnr/extensions/Extensions.cpp b/vnr/extensions/Extensions.cpp deleted file mode 100644 index aa22733..0000000 --- a/vnr/extensions/Extensions.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Extensions.h" -#include -#include -#include - -std::map extensionFunctions; - -void LoadExtensions() -{ - wchar_t path[MAX_PATH]; - wchar_t* end = path + GetModuleFileNameW(nullptr, path, MAX_PATH); - while (*(--end) != L'\\'); - *(end + 1) = L'*'; - *(end + 2) = L'\0'; - WIN32_FIND_DATAW fileData; - HANDLE file = FindFirstFileW(path, &fileData); - do - { - if (!(fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - if (wcsstr(fileData.cFileName, L"_nexthooker_extension.dll")) - { - extensionFunctions[wcstoul(fileData.cFileName, nullptr, 10)] = (ExtensionFunction)GetProcAddress(LoadLibraryW(fileData.cFileName), "NewSentence"); - } - } - } while (FindNextFileW(file, &fileData) != 0); -} - -std::wstring DispatchSentenceToExtensions(std::wstring sentence, DWORD64 info) -{ - for (auto extension : extensionFunctions) - { - sentence = extension.second(sentence, info); - } - return sentence; -} \ No newline at end of file diff --git a/vnr/extensions/Extensions.h b/vnr/extensions/Extensions.h deleted file mode 100644 index 4a08691..0000000 --- a/vnr/extensions/Extensions.h +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include - -typedef std::wstring (*ExtensionFunction)(std::wstring, DWORD64); -void LoadExtensions(); -std::wstring DispatchSentenceToExtensions(std::wstring sentence, DWORD64 info); \ No newline at end of file diff --git a/vnr/texthook/CMakeLists.txt b/vnr/texthook/CMakeLists.txt index d577ea8..ffeaeeb 100644 --- a/vnr/texthook/CMakeLists.txt +++ b/vnr/texthook/CMakeLists.txt @@ -11,13 +11,11 @@ set(vnrhost_src host.h pipe.h textthread.h + winmutex.h hookman.cc host.cc pipe.cc textthread.cc - ${PROJECT_SOURCE_DIR}/winmutex/winmutex.h - ${PROJECT_SOURCE_DIR}/extensions/Extensions.cpp - ${PROJECT_SOURCE_DIR}/extensions/Extensions.h ) add_library(vnrhost SHARED ${vnrhost_src}) diff --git a/vnr/texthook/hookman.cc b/vnr/texthook/hookman.cc index 53e71fd..7566695 100644 --- a/vnr/texthook/hookman.cc +++ b/vnr/texthook/hookman.cc @@ -12,7 +12,7 @@ #include "vnrhook/include/const.h" #include "vnrhook/include/defs.h" #include "vnrhook/include/types.h" -#include "winmutex/winmutex.h" +#include "winmutex.h" #include #define HM_LOCK CriticalSectionLocker hmLocker(hmCs) // Synchronized scope for accessing private data diff --git a/vnr/texthook/host.cc b/vnr/texthook/host.cc index 71c73fc..74e6cc1 100644 --- a/vnr/texthook/host.cc +++ b/vnr/texthook/host.cc @@ -7,7 +7,6 @@ #include "vnrhook/include/const.h" #include "vnrhook/include/defs.h" #include "vnrhook/include/types.h" -#include "extensions/Extensions.h" HANDLE preventDuplicationMutex; @@ -58,7 +57,6 @@ DLLEXPORT bool StartHost() } else { - LoadExtensions(); ::running = true; ::man = new HookManager; return true; diff --git a/vnr/texthook/textthread.cc b/vnr/texthook/textthread.cc index ed35928..7481d5c 100644 --- a/vnr/texthook/textthread.cc +++ b/vnr/texthook/textthread.cc @@ -8,8 +8,7 @@ #include "host.h" #include "textthread.h" #include "vnrhook/include/const.h" -#include "extensions/Extensions.h" -#include "winmutex/winmutex.h" +#include "winmutex.h" extern HookManager* man; extern HWND dummyWindow; @@ -54,7 +53,7 @@ void TextThread::AddSentence() sentence = std::wstring(converted, MultiByteToWideChar(932, 0, sentenceBuffer.data(), sentenceBuffer.size(), converted, sentenceBuffer.size())); delete[] converted; } - AddSentence(DispatchSentenceToExtensions(sentence, status)); + AddSentence(sentence); sentenceBuffer.clear(); } @@ -62,7 +61,7 @@ void TextThread::AddSentence(std::wstring sentence) { TT_LOCK; sentence.append(L"\r\n"); - if (output) output(this, sentence); + if (output) sentence = output(this, sentence); storage.append(sentence); } diff --git a/vnr/texthook/textthread.h b/vnr/texthook/textthread.h index 4409d7d..be7857e 100644 --- a/vnr/texthook/textthread.h +++ b/vnr/texthook/textthread.h @@ -25,7 +25,7 @@ struct ThreadParameter #define CURRENT_SELECT 0x1000 class TextThread; -typedef void(*ThreadOutputCallback)(TextThread*, std::wstring data); +typedef std::wstring(*ThreadOutputCallback)(TextThread*, std::wstring data); //extern DWORD split_time,repeat_count,global_filter,cyclic_remove; diff --git a/vnr/winmutex/winmutex.h b/vnr/texthook/winmutex.h similarity index 100% rename from vnr/winmutex/winmutex.h rename to vnr/texthook/winmutex.h From 9dfebf7eac492ee3bae0b12c4654a19a7081b6d4 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 20 Jul 2018 17:36:58 -0400 Subject: [PATCH 2/5] minor fixes --- vnr/texthook/CMakeLists.txt | 2 ++ vnr/texthook/winmutex.h | 42 +++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/vnr/texthook/CMakeLists.txt b/vnr/texthook/CMakeLists.txt index ffeaeeb..cc6aeb4 100644 --- a/vnr/texthook/CMakeLists.txt +++ b/vnr/texthook/CMakeLists.txt @@ -18,6 +18,8 @@ set(vnrhost_src textthread.cc ) +include_directories(../) + add_library(vnrhost SHARED ${vnrhost_src}) set_target_properties(vnrhost PROPERTIES LINK_FLAGS /SUBSYSTEM:WINDOWS) diff --git a/vnr/texthook/winmutex.h b/vnr/texthook/winmutex.h index 78dfd10..a3b79b9 100644 --- a/vnr/texthook/winmutex.h +++ b/vnr/texthook/winmutex.h @@ -8,26 +8,28 @@ # pragma warning(disable:4800) // C4800: forcing value to bool #endif // _MSC_VER - class MutexLocker - { - HANDLE m; - public: - explicit MutexLocker(HANDLE mutex) : m(mutex) - { - WaitForSingleObject(m, 0); - } - ~MutexLocker() { if (m != INVALID_HANDLE_VALUE && m != nullptr) ReleaseMutex(m); } - }; +// Artikash 7/20/2018: these are similar to std::lock guard but use Winapi objects - class CriticalSectionLocker - { - CRITICAL_SECTION cs; - public: - explicit CriticalSectionLocker(CRITICAL_SECTION cs) : cs(cs) - { - EnterCriticalSection(&cs); - } - ~CriticalSectionLocker() { LeaveCriticalSection(&cs); } - }; +class MutexLocker +{ + HANDLE m; +public: + explicit MutexLocker(HANDLE mutex) : m(mutex) + { + WaitForSingleObject(m, 0); + } + ~MutexLocker() { if (m != INVALID_HANDLE_VALUE && m != nullptr) ReleaseMutex(m); } +}; + +class CriticalSectionLocker +{ + CRITICAL_SECTION cs; +public: + explicit CriticalSectionLocker(CRITICAL_SECTION cs) : cs(cs) + { + EnterCriticalSection(&cs); + } + ~CriticalSectionLocker() { LeaveCriticalSection(&cs); } +}; // EOF From f132e01b7a29d806f0778c22dcaf8dfe7dc62045 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 20 Jul 2018 17:50:19 -0400 Subject: [PATCH 3/5] move stuff only used by vnrhook into vnrhook --- vnr/CMakeLists.txt | 2 +- vnr/vnrhook/CMakeLists.txt | 16 +++++++++------- vnr/{ => vnrhook/src/util}/cpputil/cppcstring.h | 0 vnr/{ => vnrhook/src/util}/disasm/disasm.cc | 0 vnr/{ => vnrhook/src/util}/disasm/disasm.h | 0 vnr/{ => vnrhook/src/util}/ithsys/ithsys.cc | 0 vnr/{ => vnrhook/src/util}/ithsys/ithsys.h | 0 vnr/{ => vnrhook/src/util}/memdbg/memdbg.h | 0 vnr/{ => vnrhook/src/util}/memdbg/memsearch.cc | 0 vnr/{ => vnrhook/src/util}/memdbg/memsearch.h | 0 vnr/{ => vnrhook/src/util}/mono/monoobject.h | 0 vnr/{ => vnrhook/src/util}/mono/monotype.h | 0 vnr/{ => vnrhook/src/util}/ntdll/ntdll.h | 0 13 files changed, 10 insertions(+), 8 deletions(-) rename vnr/{ => vnrhook/src/util}/cpputil/cppcstring.h (100%) rename vnr/{ => vnrhook/src/util}/disasm/disasm.cc (100%) rename vnr/{ => vnrhook/src/util}/disasm/disasm.h (100%) rename vnr/{ => vnrhook/src/util}/ithsys/ithsys.cc (100%) rename vnr/{ => vnrhook/src/util}/ithsys/ithsys.h (100%) rename vnr/{ => vnrhook/src/util}/memdbg/memdbg.h (100%) rename vnr/{ => vnrhook/src/util}/memdbg/memsearch.cc (100%) rename vnr/{ => vnrhook/src/util}/memdbg/memsearch.h (100%) rename vnr/{ => vnrhook/src/util}/mono/monoobject.h (100%) rename vnr/{ => vnrhook/src/util}/mono/monotype.h (100%) rename vnr/{ => vnrhook/src/util}/ntdll/ntdll.h (100%) diff --git a/vnr/CMakeLists.txt b/vnr/CMakeLists.txt index ca0cdf5..891acb0 100644 --- a/vnr/CMakeLists.txt +++ b/vnr/CMakeLists.txt @@ -20,7 +20,7 @@ add_definitions( include_directories( ${PROJECT_SOURCE_DIR} - ${PROJECT_SOURCE_DIR}/texthook + #${PROJECT_SOURCE_DIR}/texthook ) add_subdirectory(vnrhook) diff --git a/vnr/vnrhook/CMakeLists.txt b/vnr/vnrhook/CMakeLists.txt index 1100fb9..e8a770a 100644 --- a/vnr/vnrhook/CMakeLists.txt +++ b/vnr/vnrhook/CMakeLists.txt @@ -42,15 +42,17 @@ set(vnrhook_src src/util/growl.h src/util/util.cc src/util/util.h - ${PROJECT_SOURCE_DIR}/ithsys/ithsys.cc - ${PROJECT_SOURCE_DIR}/disasm/disasm.cc - ${PROJECT_SOURCE_DIR}/memdbg/memdbg.h - ${PROJECT_SOURCE_DIR}/memdbg/memsearch.cc - ${PROJECT_SOURCE_DIR}/memdbg/memsearch.h - ${PROJECT_SOURCE_DIR}/mono/monoobject.h - ${PROJECT_SOURCE_DIR}/mono/monotype.h + src/util/ithsys/ithsys.cc + src/util/disasm/disasm.cc + src/util/memdbg/memdbg.h + src/util/memdbg/memsearch.cc + src/util/memdbg/memsearch.h + src/util/mono/monoobject.h + src/util/mono/monotype.h ) +include_directories(src/util) + add_library(vnrhook SHARED ${vnrhook_src}) enable_language(ASM_MASM) diff --git a/vnr/cpputil/cppcstring.h b/vnr/vnrhook/src/util/cpputil/cppcstring.h similarity index 100% rename from vnr/cpputil/cppcstring.h rename to vnr/vnrhook/src/util/cpputil/cppcstring.h diff --git a/vnr/disasm/disasm.cc b/vnr/vnrhook/src/util/disasm/disasm.cc similarity index 100% rename from vnr/disasm/disasm.cc rename to vnr/vnrhook/src/util/disasm/disasm.cc diff --git a/vnr/disasm/disasm.h b/vnr/vnrhook/src/util/disasm/disasm.h similarity index 100% rename from vnr/disasm/disasm.h rename to vnr/vnrhook/src/util/disasm/disasm.h diff --git a/vnr/ithsys/ithsys.cc b/vnr/vnrhook/src/util/ithsys/ithsys.cc similarity index 100% rename from vnr/ithsys/ithsys.cc rename to vnr/vnrhook/src/util/ithsys/ithsys.cc diff --git a/vnr/ithsys/ithsys.h b/vnr/vnrhook/src/util/ithsys/ithsys.h similarity index 100% rename from vnr/ithsys/ithsys.h rename to vnr/vnrhook/src/util/ithsys/ithsys.h diff --git a/vnr/memdbg/memdbg.h b/vnr/vnrhook/src/util/memdbg/memdbg.h similarity index 100% rename from vnr/memdbg/memdbg.h rename to vnr/vnrhook/src/util/memdbg/memdbg.h diff --git a/vnr/memdbg/memsearch.cc b/vnr/vnrhook/src/util/memdbg/memsearch.cc similarity index 100% rename from vnr/memdbg/memsearch.cc rename to vnr/vnrhook/src/util/memdbg/memsearch.cc diff --git a/vnr/memdbg/memsearch.h b/vnr/vnrhook/src/util/memdbg/memsearch.h similarity index 100% rename from vnr/memdbg/memsearch.h rename to vnr/vnrhook/src/util/memdbg/memsearch.h diff --git a/vnr/mono/monoobject.h b/vnr/vnrhook/src/util/mono/monoobject.h similarity index 100% rename from vnr/mono/monoobject.h rename to vnr/vnrhook/src/util/mono/monoobject.h diff --git a/vnr/mono/monotype.h b/vnr/vnrhook/src/util/mono/monotype.h similarity index 100% rename from vnr/mono/monotype.h rename to vnr/vnrhook/src/util/mono/monotype.h diff --git a/vnr/ntdll/ntdll.h b/vnr/vnrhook/src/util/ntdll/ntdll.h similarity index 100% rename from vnr/ntdll/ntdll.h rename to vnr/vnrhook/src/util/ntdll/ntdll.h From 61ca07d29b1076794d2199fa3ffaa7cd82942667 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 20 Jul 2018 14:55:58 -0400 Subject: [PATCH 4/5] move profile stuff into gui --- CMakeLists.txt | 11 +++++++++-- {vnr => gui}/profile/Profile.cpp | 0 {vnr => gui}/profile/Profile.h | 0 {vnr => gui}/profile/misc.cpp | 0 {vnr => gui}/profile/misc.h | 0 {vnr => gui}/profile/pugiconfig.h | 0 {vnr => gui}/profile/pugixml.cpp | 0 {vnr => gui}/profile/pugixml.h | 0 vnr/CMakeLists.txt | 1 - vnr/profile/CMakeLists.txt | 23 ----------------------- 10 files changed, 9 insertions(+), 26 deletions(-) rename {vnr => gui}/profile/Profile.cpp (100%) rename {vnr => gui}/profile/Profile.h (100%) rename {vnr => gui}/profile/misc.cpp (100%) rename {vnr => gui}/profile/misc.h (100%) rename {vnr => gui}/profile/pugiconfig.h (100%) rename {vnr => gui}/profile/pugixml.cpp (100%) rename {vnr => gui}/profile/pugixml.h (100%) delete mode 100644 vnr/profile/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e045ae..9d0c4fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,13 @@ set(nexthooker_src gui/window.h gui/TextBuffer.cpp gui/TextBuffer.h + gui/profile/Profile.h + gui/profile/Profile.cpp + gui/profile/pugiconfig.h + gui/profile/pugixml.cpp + gui/profile/pugixml.h + gui/profile/misc.h + gui/profile/misc.cpp ${resource_src} ) @@ -83,7 +90,7 @@ source_group("Resource Files" FILES ${resource_src}) add_executable(${PROJECT_NAME} ${nexthooker_src}) -add_subdirectory(vnr) + add_subdirectory(vnr) # add_subdirectory(profile) set_target_properties(${PROJECT_NAME} PROPERTIES @@ -97,7 +104,7 @@ target_compile_definitions(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - profile + #profile vnrhost #ithsys #${WDK_HOME}/lib/wxp/i386/ntdll.lib diff --git a/vnr/profile/Profile.cpp b/gui/profile/Profile.cpp similarity index 100% rename from vnr/profile/Profile.cpp rename to gui/profile/Profile.cpp diff --git a/vnr/profile/Profile.h b/gui/profile/Profile.h similarity index 100% rename from vnr/profile/Profile.h rename to gui/profile/Profile.h diff --git a/vnr/profile/misc.cpp b/gui/profile/misc.cpp similarity index 100% rename from vnr/profile/misc.cpp rename to gui/profile/misc.cpp diff --git a/vnr/profile/misc.h b/gui/profile/misc.h similarity index 100% rename from vnr/profile/misc.h rename to gui/profile/misc.h diff --git a/vnr/profile/pugiconfig.h b/gui/profile/pugiconfig.h similarity index 100% rename from vnr/profile/pugiconfig.h rename to gui/profile/pugiconfig.h diff --git a/vnr/profile/pugixml.cpp b/gui/profile/pugixml.cpp similarity index 100% rename from vnr/profile/pugixml.cpp rename to gui/profile/pugixml.cpp diff --git a/vnr/profile/pugixml.h b/gui/profile/pugixml.h similarity index 100% rename from vnr/profile/pugixml.h rename to gui/profile/pugixml.h diff --git a/vnr/CMakeLists.txt b/vnr/CMakeLists.txt index 891acb0..016681f 100644 --- a/vnr/CMakeLists.txt +++ b/vnr/CMakeLists.txt @@ -25,4 +25,3 @@ include_directories( add_subdirectory(vnrhook) add_subdirectory(texthook) -add_subdirectory(profile) diff --git a/vnr/profile/CMakeLists.txt b/vnr/profile/CMakeLists.txt deleted file mode 100644 index a69f2b1..0000000 --- a/vnr/profile/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -set(profile_src - Profile.h - Profile.cpp - pugiconfig.h - pugixml.cpp - pugixml.h - misc.h - misc.cpp -) - -add_library(profile STATIC ${profile_src}) - -target_compile_options(profile PRIVATE - $<$:> - $<$:> -) - -#target_link_libraries(profile comctl32.lib) - -#target_compile_definitions(profile -# PRIVATE -# _CRT_NON_CONFORMING_SWPRINTFS -#) From b7bf5b91f0dce983b02e5868d203ef01bd84f54a Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 20 Jul 2018 15:10:34 -0400 Subject: [PATCH 5/5] move folders into root --- CMakeLists.txt | 7 ++--- {vnr/texthook => texthook}/CMakeLists.txt | 2 ++ {vnr/texthook => texthook}/hookman.cc | 0 {vnr/texthook => texthook}/hookman.h | 0 {vnr/texthook => texthook}/host.cc | 0 {vnr/texthook => texthook}/host.h | 0 {vnr/texthook => texthook}/pipe.cc | 0 {vnr/texthook => texthook}/pipe.h | 0 {vnr/texthook => texthook}/textthread.cc | 0 {vnr/texthook => texthook}/textthread.h | 0 {vnr/texthook => texthook}/winmutex.h | 0 vnr/CMakeLists.txt | 27 ------------------- {vnr/vnrhook => vnrhook}/CMakeLists.txt | 2 ++ {vnr/vnrhook => vnrhook}/include/const.h | 0 {vnr/vnrhook => vnrhook}/include/defs.h | 0 {vnr/vnrhook => vnrhook}/include/types.h | 0 {vnr/vnrhook => vnrhook}/src/engine/engine.cc | 0 {vnr/vnrhook => vnrhook}/src/engine/engine.h | 0 .../vnrhook => vnrhook}/src/engine/hookdefs.h | 0 {vnr/vnrhook => vnrhook}/src/engine/match.cc | 0 {vnr/vnrhook => vnrhook}/src/engine/match.h | 0 .../src/engine/mono/funcinfo.h | 0 .../src/engine/mono/types.h | 0 .../vnrhook => vnrhook}/src/engine/pchooks.cc | 0 {vnr/vnrhook => vnrhook}/src/engine/pchooks.h | 0 .../src/engine/ppsspp/funcinfo.h | 0 {vnr/vnrhook => vnrhook}/src/except.h | 0 .../src/hijack/texthook.cc | 0 .../vnrhook => vnrhook}/src/hijack/texthook.h | 0 {vnr/vnrhook => vnrhook}/src/main.cc | 0 {vnr/vnrhook => vnrhook}/src/main.h | 0 {vnr/vnrhook => vnrhook}/src/pipe.cc | 0 .../src/util/cpputil/cppcstring.h | 0 .../src/util/disasm/disasm.cc | 0 .../src/util/disasm/disasm.h | 0 {vnr/vnrhook => vnrhook}/src/util/growl.h | 0 .../src/util/ithsys/ithsys.cc | 0 .../src/util/ithsys/ithsys.h | 0 .../src/util/memdbg/memdbg.h | 0 .../src/util/memdbg/memsearch.cc | 0 .../src/util/memdbg/memsearch.h | 0 .../src/util/mono/monoobject.h | 0 .../src/util/mono/monotype.h | 0 .../src/util/ntdll/ntdll.h | 0 {vnr/vnrhook => vnrhook}/src/util/util.cc | 0 {vnr/vnrhook => vnrhook}/src/util/util.h | 0 46 files changed, 8 insertions(+), 30 deletions(-) rename {vnr/texthook => texthook}/CMakeLists.txt (98%) rename {vnr/texthook => texthook}/hookman.cc (100%) rename {vnr/texthook => texthook}/hookman.h (100%) rename {vnr/texthook => texthook}/host.cc (100%) rename {vnr/texthook => texthook}/host.h (100%) rename {vnr/texthook => texthook}/pipe.cc (100%) rename {vnr/texthook => texthook}/pipe.h (100%) rename {vnr/texthook => texthook}/textthread.cc (100%) rename {vnr/texthook => texthook}/textthread.h (100%) rename {vnr/texthook => texthook}/winmutex.h (100%) delete mode 100644 vnr/CMakeLists.txt rename {vnr/vnrhook => vnrhook}/CMakeLists.txt (99%) rename {vnr/vnrhook => vnrhook}/include/const.h (100%) rename {vnr/vnrhook => vnrhook}/include/defs.h (100%) rename {vnr/vnrhook => vnrhook}/include/types.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/engine.cc (100%) rename {vnr/vnrhook => vnrhook}/src/engine/engine.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/hookdefs.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/match.cc (100%) rename {vnr/vnrhook => vnrhook}/src/engine/match.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/mono/funcinfo.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/mono/types.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/pchooks.cc (100%) rename {vnr/vnrhook => vnrhook}/src/engine/pchooks.h (100%) rename {vnr/vnrhook => vnrhook}/src/engine/ppsspp/funcinfo.h (100%) rename {vnr/vnrhook => vnrhook}/src/except.h (100%) rename {vnr/vnrhook => vnrhook}/src/hijack/texthook.cc (100%) rename {vnr/vnrhook => vnrhook}/src/hijack/texthook.h (100%) rename {vnr/vnrhook => vnrhook}/src/main.cc (100%) rename {vnr/vnrhook => vnrhook}/src/main.h (100%) rename {vnr/vnrhook => vnrhook}/src/pipe.cc (100%) rename {vnr/vnrhook => vnrhook}/src/util/cpputil/cppcstring.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/disasm/disasm.cc (100%) rename {vnr/vnrhook => vnrhook}/src/util/disasm/disasm.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/growl.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/ithsys/ithsys.cc (100%) rename {vnr/vnrhook => vnrhook}/src/util/ithsys/ithsys.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/memdbg/memdbg.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/memdbg/memsearch.cc (100%) rename {vnr/vnrhook => vnrhook}/src/util/memdbg/memsearch.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/mono/monoobject.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/mono/monotype.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/ntdll/ntdll.h (100%) rename {vnr/vnrhook => vnrhook}/src/util/util.cc (100%) rename {vnr/vnrhook => vnrhook}/src/util/util.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d0c4fa..d8650f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,8 @@ add_definitions( include_directories( . - vnr - vnr/texthook + + texthook ${CMAKE_BINARY_DIR}/gui ) @@ -90,7 +90,8 @@ source_group("Resource Files" FILES ${resource_src}) add_executable(${PROJECT_NAME} ${nexthooker_src}) - add_subdirectory(vnr) +add_subdirectory(texthook) +add_subdirectory(vnrhook) # add_subdirectory(profile) set_target_properties(${PROJECT_NAME} PROPERTIES diff --git a/vnr/texthook/CMakeLists.txt b/texthook/CMakeLists.txt similarity index 98% rename from vnr/texthook/CMakeLists.txt rename to texthook/CMakeLists.txt index cc6aeb4..0982464 100644 --- a/vnr/texthook/CMakeLists.txt +++ b/texthook/CMakeLists.txt @@ -6,6 +6,8 @@ # # TODO: Get rid of dependence on msvc's swprintf # DEFINES += _CRT_NON_CONFORMING_SWPRINTFS +project(host) + set(vnrhost_src hookman.h host.h diff --git a/vnr/texthook/hookman.cc b/texthook/hookman.cc similarity index 100% rename from vnr/texthook/hookman.cc rename to texthook/hookman.cc diff --git a/vnr/texthook/hookman.h b/texthook/hookman.h similarity index 100% rename from vnr/texthook/hookman.h rename to texthook/hookman.h diff --git a/vnr/texthook/host.cc b/texthook/host.cc similarity index 100% rename from vnr/texthook/host.cc rename to texthook/host.cc diff --git a/vnr/texthook/host.h b/texthook/host.h similarity index 100% rename from vnr/texthook/host.h rename to texthook/host.h diff --git a/vnr/texthook/pipe.cc b/texthook/pipe.cc similarity index 100% rename from vnr/texthook/pipe.cc rename to texthook/pipe.cc diff --git a/vnr/texthook/pipe.h b/texthook/pipe.h similarity index 100% rename from vnr/texthook/pipe.h rename to texthook/pipe.h diff --git a/vnr/texthook/textthread.cc b/texthook/textthread.cc similarity index 100% rename from vnr/texthook/textthread.cc rename to texthook/textthread.cc diff --git a/vnr/texthook/textthread.h b/texthook/textthread.h similarity index 100% rename from vnr/texthook/textthread.h rename to texthook/textthread.h diff --git a/vnr/texthook/winmutex.h b/texthook/winmutex.h similarity index 100% rename from vnr/texthook/winmutex.h rename to texthook/winmutex.h diff --git a/vnr/CMakeLists.txt b/vnr/CMakeLists.txt deleted file mode 100644 index 016681f..0000000 --- a/vnr/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# config.pri -# DEFINES += _SECURE_SCL=0 _SCL_SECURE_NO_WARNINGS -# DEFINES += _CRT_SECURE_NO_WARNINGS - -cmake_minimum_required(VERSION 2.8) - -set(CMAKE_CONFIGURATION_TYPES Debug Release) - -project(vnr) - -set(WDK_HOME "C:\\WinDDK\\7600.16385.1" CACHE FILEPATH "Windows Driver Kit path") - -add_definitions( - /DUNICODE - /D_UNICODE - /D_SECURE_SCL=0 - /D_SCL_SECURE_NO_WARNINGS - /D_CRT_SECURE_NO_WARNINGS -) - -include_directories( - ${PROJECT_SOURCE_DIR} - #${PROJECT_SOURCE_DIR}/texthook -) - -add_subdirectory(vnrhook) -add_subdirectory(texthook) diff --git a/vnr/vnrhook/CMakeLists.txt b/vnrhook/CMakeLists.txt similarity index 99% rename from vnr/vnrhook/CMakeLists.txt rename to vnrhook/CMakeLists.txt index e8a770a..9efcc1d 100644 --- a/vnr/vnrhook/CMakeLists.txt +++ b/vnrhook/CMakeLists.txt @@ -17,6 +17,8 @@ # QMAKE_CXXFLAGS_EXCEPTIONS_ON += /EHa # } +project(engine) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(vnrhook_src diff --git a/vnr/vnrhook/include/const.h b/vnrhook/include/const.h similarity index 100% rename from vnr/vnrhook/include/const.h rename to vnrhook/include/const.h diff --git a/vnr/vnrhook/include/defs.h b/vnrhook/include/defs.h similarity index 100% rename from vnr/vnrhook/include/defs.h rename to vnrhook/include/defs.h diff --git a/vnr/vnrhook/include/types.h b/vnrhook/include/types.h similarity index 100% rename from vnr/vnrhook/include/types.h rename to vnrhook/include/types.h diff --git a/vnr/vnrhook/src/engine/engine.cc b/vnrhook/src/engine/engine.cc similarity index 100% rename from vnr/vnrhook/src/engine/engine.cc rename to vnrhook/src/engine/engine.cc diff --git a/vnr/vnrhook/src/engine/engine.h b/vnrhook/src/engine/engine.h similarity index 100% rename from vnr/vnrhook/src/engine/engine.h rename to vnrhook/src/engine/engine.h diff --git a/vnr/vnrhook/src/engine/hookdefs.h b/vnrhook/src/engine/hookdefs.h similarity index 100% rename from vnr/vnrhook/src/engine/hookdefs.h rename to vnrhook/src/engine/hookdefs.h diff --git a/vnr/vnrhook/src/engine/match.cc b/vnrhook/src/engine/match.cc similarity index 100% rename from vnr/vnrhook/src/engine/match.cc rename to vnrhook/src/engine/match.cc diff --git a/vnr/vnrhook/src/engine/match.h b/vnrhook/src/engine/match.h similarity index 100% rename from vnr/vnrhook/src/engine/match.h rename to vnrhook/src/engine/match.h diff --git a/vnr/vnrhook/src/engine/mono/funcinfo.h b/vnrhook/src/engine/mono/funcinfo.h similarity index 100% rename from vnr/vnrhook/src/engine/mono/funcinfo.h rename to vnrhook/src/engine/mono/funcinfo.h diff --git a/vnr/vnrhook/src/engine/mono/types.h b/vnrhook/src/engine/mono/types.h similarity index 100% rename from vnr/vnrhook/src/engine/mono/types.h rename to vnrhook/src/engine/mono/types.h diff --git a/vnr/vnrhook/src/engine/pchooks.cc b/vnrhook/src/engine/pchooks.cc similarity index 100% rename from vnr/vnrhook/src/engine/pchooks.cc rename to vnrhook/src/engine/pchooks.cc diff --git a/vnr/vnrhook/src/engine/pchooks.h b/vnrhook/src/engine/pchooks.h similarity index 100% rename from vnr/vnrhook/src/engine/pchooks.h rename to vnrhook/src/engine/pchooks.h diff --git a/vnr/vnrhook/src/engine/ppsspp/funcinfo.h b/vnrhook/src/engine/ppsspp/funcinfo.h similarity index 100% rename from vnr/vnrhook/src/engine/ppsspp/funcinfo.h rename to vnrhook/src/engine/ppsspp/funcinfo.h diff --git a/vnr/vnrhook/src/except.h b/vnrhook/src/except.h similarity index 100% rename from vnr/vnrhook/src/except.h rename to vnrhook/src/except.h diff --git a/vnr/vnrhook/src/hijack/texthook.cc b/vnrhook/src/hijack/texthook.cc similarity index 100% rename from vnr/vnrhook/src/hijack/texthook.cc rename to vnrhook/src/hijack/texthook.cc diff --git a/vnr/vnrhook/src/hijack/texthook.h b/vnrhook/src/hijack/texthook.h similarity index 100% rename from vnr/vnrhook/src/hijack/texthook.h rename to vnrhook/src/hijack/texthook.h diff --git a/vnr/vnrhook/src/main.cc b/vnrhook/src/main.cc similarity index 100% rename from vnr/vnrhook/src/main.cc rename to vnrhook/src/main.cc diff --git a/vnr/vnrhook/src/main.h b/vnrhook/src/main.h similarity index 100% rename from vnr/vnrhook/src/main.h rename to vnrhook/src/main.h diff --git a/vnr/vnrhook/src/pipe.cc b/vnrhook/src/pipe.cc similarity index 100% rename from vnr/vnrhook/src/pipe.cc rename to vnrhook/src/pipe.cc diff --git a/vnr/vnrhook/src/util/cpputil/cppcstring.h b/vnrhook/src/util/cpputil/cppcstring.h similarity index 100% rename from vnr/vnrhook/src/util/cpputil/cppcstring.h rename to vnrhook/src/util/cpputil/cppcstring.h diff --git a/vnr/vnrhook/src/util/disasm/disasm.cc b/vnrhook/src/util/disasm/disasm.cc similarity index 100% rename from vnr/vnrhook/src/util/disasm/disasm.cc rename to vnrhook/src/util/disasm/disasm.cc diff --git a/vnr/vnrhook/src/util/disasm/disasm.h b/vnrhook/src/util/disasm/disasm.h similarity index 100% rename from vnr/vnrhook/src/util/disasm/disasm.h rename to vnrhook/src/util/disasm/disasm.h diff --git a/vnr/vnrhook/src/util/growl.h b/vnrhook/src/util/growl.h similarity index 100% rename from vnr/vnrhook/src/util/growl.h rename to vnrhook/src/util/growl.h diff --git a/vnr/vnrhook/src/util/ithsys/ithsys.cc b/vnrhook/src/util/ithsys/ithsys.cc similarity index 100% rename from vnr/vnrhook/src/util/ithsys/ithsys.cc rename to vnrhook/src/util/ithsys/ithsys.cc diff --git a/vnr/vnrhook/src/util/ithsys/ithsys.h b/vnrhook/src/util/ithsys/ithsys.h similarity index 100% rename from vnr/vnrhook/src/util/ithsys/ithsys.h rename to vnrhook/src/util/ithsys/ithsys.h diff --git a/vnr/vnrhook/src/util/memdbg/memdbg.h b/vnrhook/src/util/memdbg/memdbg.h similarity index 100% rename from vnr/vnrhook/src/util/memdbg/memdbg.h rename to vnrhook/src/util/memdbg/memdbg.h diff --git a/vnr/vnrhook/src/util/memdbg/memsearch.cc b/vnrhook/src/util/memdbg/memsearch.cc similarity index 100% rename from vnr/vnrhook/src/util/memdbg/memsearch.cc rename to vnrhook/src/util/memdbg/memsearch.cc diff --git a/vnr/vnrhook/src/util/memdbg/memsearch.h b/vnrhook/src/util/memdbg/memsearch.h similarity index 100% rename from vnr/vnrhook/src/util/memdbg/memsearch.h rename to vnrhook/src/util/memdbg/memsearch.h diff --git a/vnr/vnrhook/src/util/mono/monoobject.h b/vnrhook/src/util/mono/monoobject.h similarity index 100% rename from vnr/vnrhook/src/util/mono/monoobject.h rename to vnrhook/src/util/mono/monoobject.h diff --git a/vnr/vnrhook/src/util/mono/monotype.h b/vnrhook/src/util/mono/monotype.h similarity index 100% rename from vnr/vnrhook/src/util/mono/monotype.h rename to vnrhook/src/util/mono/monotype.h diff --git a/vnr/vnrhook/src/util/ntdll/ntdll.h b/vnrhook/src/util/ntdll/ntdll.h similarity index 100% rename from vnr/vnrhook/src/util/ntdll/ntdll.h rename to vnrhook/src/util/ntdll/ntdll.h diff --git a/vnr/vnrhook/src/util/util.cc b/vnrhook/src/util/util.cc similarity index 100% rename from vnr/vnrhook/src/util/util.cc rename to vnrhook/src/util/util.cc diff --git a/vnr/vnrhook/src/util/util.h b/vnrhook/src/util/util.h similarity index 100% rename from vnr/vnrhook/src/util/util.h rename to vnrhook/src/util/util.h