From 15db478e62eb955d2299484dbf2c9c7e707bb4cb Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 13 Nov 2021 13:38:32 -0700 Subject: [PATCH] rearrange build for less confusion and to build CLI faster --- CMakeLists.txt | 7 ++----- CREDITS.md | 2 +- GUI/CMakeLists.txt | 6 +----- GUI/mainwindow.cpp | 4 ++-- README.md | 9 ++++----- README_ID.md | 2 +- README_IT.md | 2 +- README_KR.md | 2 +- README_PT.md | 2 +- README_RU.md | 2 +- README_SC.md | 2 +- README_TH.md | 2 +- host/CMakeLists.txt | 9 +++++++++ {GUI/host => host/cli}/CMakeLists.txt | 9 ++------- GUI/host/cli.cpp => host/cli/main.cpp | 4 ++-- {GUI/host => host}/exception.cpp | 0 {GUI/host => host}/hookcode.cpp | 0 {GUI/host => host}/hookcode.h | 0 {GUI/host => host}/host.cpp | 0 {GUI/host => host}/host.h | 0 {GUI/host => host}/textthread.cpp | 0 {GUI/host => host}/textthread.h | 0 22 files changed, 30 insertions(+), 34 deletions(-) create mode 100644 host/CMakeLists.txt rename {GUI/host => host/cli}/CMakeLists.txt (65%) rename GUI/host/cli.cpp => host/cli/main.cpp (96%) rename {GUI/host => host}/exception.cpp (100%) rename {GUI/host => host}/hookcode.cpp (100%) rename {GUI/host => host}/hookcode.h (100%) rename {GUI/host => host}/host.cpp (100%) rename {GUI/host => host}/host.h (100%) rename {GUI/host => host}/textthread.cpp (100%) rename {GUI/host => host}/textthread.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6973450..6d2f709 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,11 +39,8 @@ add_library(text text.cpp) target_compile_definitions(text PRIVATE ${TEXT_LANGUAGE}) link_libraries(text) -add_subdirectory(GUI) +add_subdirectory(host) add_subdirectory(texthook) +add_subdirectory(GUI) add_subdirectory(extensions) add_subdirectory(test) -if (DEFINED VERSION) - add_subdirectory(GUI/host) -endif() -#add_subdirectory(GUI/host) diff --git a/CREDITS.md b/CREDITS.md index 97dc7dc..2342c42 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -23,7 +23,7 @@ If you're on this list and want your link changed let me know. - Korean translation by [O SK](mailto:afkl11@outlook.kr) - Italian translation by [StarFang208](https://github.com/StarFang208) - ITHVNR updated by [mireado](https://github.com/mireado), [Eguni](https://github.com/Eguni), and [IJEMIN](https://github.com/IJEMIN) -- ITHVNR originally made by [Stomp](https://web.archive.org/web/20160202084144/http://www.hongfire.com/forum/showthread.php/438331-ITHVNR-ITH-with-the-VNR-engine) +- ITHVNR originally made by [Stomp](mailto:zorkzero@hotmail.com) - VNR engine made by [jichi](https://github.com/jichifly) - ITH updated by [Andys](https://github.com/AndyScull) - ITH originally made by [kaosu](https://code.google.com/archive/p/interactive-text-hooker) diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index 54eafae..3353fb3 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -7,15 +7,11 @@ add_executable(Textractor WIN32 mainwindow.cpp extenwindow.cpp attachprocessdialog.cpp - host/exception.cpp - host/host.cpp - host/textthread.cpp - host/hookcode.cpp Textractor.rc Textractor.ico ) target_precompile_headers(Textractor REUSE_FROM pch) -target_link_libraries(Textractor Qt5::Widgets Qt5::WinExtras shell32 winhttp) +target_link_libraries(Textractor host Qt5::Widgets Qt5::WinExtras shell32 winhttp) if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Core.dll AND NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5Cored.dll) add_custom_command(TARGET Textractor diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 1f0437d..d95af3c 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -3,8 +3,8 @@ #include "defs.h" #include "module.h" #include "extenwindow.h" -#include "host/host.h" -#include "host/hookcode.h" +#include "../host/host.h" +#include "../host/hookcode.h" #include "attachprocessdialog.h" #include #include diff --git a/README.md b/README.md index 206af03..b67f346 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [English](README.md) ● [Español](README_ES.md) ● [简体中文](README_SC.md) ● [Русский](README_RU.md) ● [한국어](README_KR.md) ● [ภาษาไทย](README_TH.md) ● [Français](README_FR.md) ● [Italiano](README_IT.md) ● [日本語](README_JP.md) ● [Bahasa](README_ID.md) ● [Português](README_PT.md) -**Textractor** (a.k.a. NextHooker) is an open-source x86/x64 video game text hooker for Windows/Wine based off of [ITHVNR](https://web.archive.org/web/20160202084144/http://www.hongfire.com/forum/showthread.php/438331-ITHVNR-ITH-with-the-VNR-engine).
+**Textractor** (a.k.a. NextHooker) is an open-source x86/x64 video game text hooker for Windows 7+ (and Wine) based off of [ITHVNR](https://web.archive.org/web/20160202084144/http://www.hongfire.com/forum/showthread.php/438331-ITHVNR-ITH-with-the-VNR-engine).
Watch the [tutorial video](https://tinyurl.com/textractor-tutorial) for a quick rundown on using it. ## Download @@ -23,8 +23,8 @@ Try running vcredist if you get an error when starting Textractor or if nothing ## Support -Please let me know of any bugs, games that Textractor has trouble hooking, feature requests, or other suggestions.
-If you have trouble hooking a game, give me a place where I can freely download it, or gift it to me on [Steam](https://steamcommunity.com/profiles/76561198097566313/). +Let me know of any bugs, games that Textractor has trouble hooking, feature requests, or other suggestions by posting an issue.
+If you have trouble hooking a game, please show me a way to freely download it or gift it to me on [Steam](https://steamcommunity.com/profiles/76561198097566313/). ## Extensions @@ -44,8 +44,7 @@ You should then be able to just open the source folder in Visual Studio and buil ## Project Architecture -The host (see GUI/host folder) injects texthook.dll (created from the texthook folder) into the target process and connects to it via 2 pipe files.
-Host writes to hostPipe, texthook writes to hookPipe.
+The host injects texthook into the target process and connects to it via 2 pipe files. texthook waits for the pipe to be connected, then injects a few instructions into any text outputting functions (e.g. TextOut, GetGlyphOutline) that cause their input to be sent through the pipe.
Additional information about hooks is exchanged via shared memory.
The text that the host receives through the pipe is then processed a little before being dispatched back to the GUI.
diff --git a/README_ID.md b/README_ID.md index d50d952..c6ba1c9 100644 --- a/README_ID.md +++ b/README_ID.md @@ -47,7 +47,7 @@ Lalu kamu dapat membuka folder di Visual Studio, dan build. Run Textractor.exe. ## Arsitektur Project -Host (lihat folder GUI/host) menginject texthook.dll (dibuat dari folder texthook) kedalam target process dan disambungkan lewat 2 file pipe.
+Host (lihat folder host) menginject texthook.dll (dibuat dari folder texthook) kedalam target process dan disambungkan lewat 2 file pipe.
Host menulis ke hostPipe, texthook menulis ke hookPipe.
texthook menunggu pipe tersambung, lalu menginject beberapa instruksi ke teks yang menghasilkan fungsi (contoh: TextOut, GetGlyphOutline) yang membuat input dikirim melewati pipa.
Informasi tambahan tentang hook dipindahkan melewati shared memory.
diff --git a/README_IT.md b/README_IT.md index 5ea23dc..e4c713a 100644 --- a/README_IT.md +++ b/README_IT.md @@ -43,7 +43,7 @@ Dovresti essere in grado di aprire la cartella in Visual Studio, e costruire. Av ## Architettura del progetto -L'host (guarda la cartella GUI/host) innietta texthook.dll (creato dalla cartella texthook) nel processo e lo connette attraverso due file pipe.
+L'host (guarda la cartella host) innietta texthook.dll (creato dalla cartella texthook) nel processo e lo connette attraverso due file pipe.
L'host scrive a hostPipe, texthook scrive a hookPipe.
Texthook aspetta per il pipe di essere connesso, poi innietta alcune istruzione in qualunque funzione di immissione del testo (es. TextOut, GetGlyphOutline) che causa il loro input di essere inviato attraverso il pipe.
Informazioni aggiuntive sui ganci soo scambiati attraverso la memorio condivisa.
diff --git a/README_KR.md b/README_KR.md index 9955f6b..7402100 100644 --- a/README_KR.md +++ b/README_KR.md @@ -41,7 +41,7 @@ Textractor 실행오류를 겪는다면 vcredist를 실행해 보시기 바랍 ## 프로젝트 아키텍쳐 -The host (see GUI/host folder) injects texthook.dll (created from the texthook folder) into the target process and connects to it via 2 pipe files.
+The host (see host folder) injects texthook.dll (created from the texthook folder) into the target process and connects to it via 2 pipe files.
Host writes to hostPipe, texthook writes to hookPipe.
texthook waits for the pipe to be connected, then injects a few instructions into any text outputting functions (e.g. TextOut, GetGlyphOutline) that cause their input to be sent through the pipe.
Additional information about hooks is exchanged via shared memory.
diff --git a/README_PT.md b/README_PT.md index 07a0e0d..b84cdec 100644 --- a/README_PT.md +++ b/README_PT.md @@ -43,7 +43,7 @@ Você deverá então ser capaz de simplesmente abrir uma pasta no Visual Studio ## Arquitetura do Projeto -O host (veja a pasta GUI/host) injeta o texthook.dll (criado a partir da pasta texthook) dentro do processo-alvo e se conecta a ele por meio de 2 arquivos pipe.
+O host (veja a pasta host) injeta o texthook.dll (criado a partir da pasta texthook) dentro do processo-alvo e se conecta a ele por meio de 2 arquivos pipe.
O Host escreve para hostPipe, o texthook escreve para hookPipe.
O texthook espera pelo pipe estar conectado e então injeta algumas intruções dentro de quaisquer funções que produzam texto (por exemplo: TextOut, GetGlyphOutline) o que faz com que seu produto seja mandado por meio do pipe.
Informação adicional sobre os hooks é trocada por meio da memória compartilhada.
diff --git a/README_RU.md b/README_RU.md index 09f8994..14859a2 100644 --- a/README_RU.md +++ b/README_RU.md @@ -43,7 +43,7 @@ ## Архитектура проекта -Хост (смотрите папку GUI/host) внедряет texthook.dll (созданной из папки texthook) в целевой процесс и подключается к нему через два файла-канала (pipe).
+Хост (смотрите папку host) внедряет texthook.dll (созданной из папки texthook) в целевой процесс и подключается к нему через два файла-канала (pipe).
Хост пишет в hostPipe, texthook пишет в hookPipe.
texthook ждет присоединения канала, тогда внедряет некоторые инструкции в любые выводящие текст функции (такие как TextOut, GetGlyphOutline), что вызывает пересылку поступающего в них текста через канал.
Дополнительная информация о хуках размещена через файл просмотра (a.k.a. section object), который сопоставлен с ссылкой на класс TextHook.
diff --git a/README_SC.md b/README_SC.md index 514cd91..cf396fa 100644 --- a/README_SC.md +++ b/README_SC.md @@ -39,7 +39,7 @@ Textractor 的发行版可以在[这里](https://github.com/Artikash/Textractor/ ## 项目架构 -宿主 (位于 GUI/host 文件夹) 向目标进程注入 texthook.dll (由 texthook 文件夹创建) 并通过两个管道文件互联.
+宿主 (位于 host 文件夹) 向目标进程注入 texthook.dll (由 texthook 文件夹创建) 并通过两个管道文件互联.
宿主向 hostPipe 写入, texthook 向 hookPipe 写入.
texthook 等待管道连接, 之后向一些文本输出函数 (如 TextOut, GetGlyphOutline) 注入一系列指令, 使得它们的输入被沿着管道发送.
其它关于钩子的信息通过一个被 TextHook 类保有引用的文件视图 (曾用名: 段对象) 共享.
diff --git a/README_TH.md b/README_TH.md index 15fff6c..60ce9f3 100644 --- a/README_TH.md +++ b/README_TH.md @@ -38,7 +38,7 @@ ITHVNR รุ่นสุดท้ายสามารถดาวน์โห ## โครงสร้างโปรแกรม -ฐานของโปรแกรม (โฟลเดอร์ GUI/host) ส่งข้อมูลจาก texthook.dll (ที่ถูกสร้างจาก texthook โฟลเดอร์) ไปยังเกมเป้าหมาย และ เชื่อมทั่งสองอย่างเข้าด้วยกัน
+ฐานของโปรแกรม (โฟลเดอร์ host) ส่งข้อมูลจาก texthook.dll (ที่ถูกสร้างจาก texthook โฟลเดอร์) ไปยังเกมเป้าหมาย และ เชื่อมทั่งสองอย่างเข้าด้วยกัน
ฐานโปรแกรมเขียนผ่านฝั่ง hostPipe(ท่อเชื่อมฝั่งฐานข้อมูล) ในขณะที่ตัวดึงตัวอักษรที่ทางฝั่ง hookPipe(ท่อเชื่อมฝั่งดึงข้อมูล).
ตัวดึงตัวอักษรรอการเชื่อมเข้ากับของทั่งสองท่อ หลังจากนั่นส่งคำสั่งไปยังข้อมูลนั่น (เช่น แสดงผลข้อมูล เป็นต้น) และทำให้ข้อมูลส่งผ่านต่อมาออกมาได้ถูกต้อง
ข้อมูลบางอย่างเกี่ยวกับการเชื่อมจะถูกแลกเปลี่ยนผ่านความทรงจำของระบบ (shared memory) diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt new file mode 100644 index 0000000..842994b --- /dev/null +++ b/host/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library(host + exception.cpp + host.cpp + textthread.cpp + hookcode.cpp +) +target_precompile_headers(host REUSE_FROM pch) + +add_subdirectory(cli) diff --git a/GUI/host/CMakeLists.txt b/host/cli/CMakeLists.txt similarity index 65% rename from GUI/host/CMakeLists.txt rename to host/cli/CMakeLists.txt index c8ee81d..43698c8 100644 --- a/GUI/host/CMakeLists.txt +++ b/host/cli/CMakeLists.txt @@ -1,9 +1,4 @@ # The CLI isn't used by Textractor itself, but is here for other people that want to build projects on top of Textractor -add_executable(TextractorCLI - cli.cpp - exception.cpp - host.cpp - textthread.cpp - hookcode.cpp -) +add_executable(TextractorCLI main.cpp) target_precompile_headers(TextractorCLI REUSE_FROM pch) +target_link_libraries(TextractorCLI host) diff --git a/GUI/host/cli.cpp b/host/cli/main.cpp similarity index 96% rename from GUI/host/cli.cpp rename to host/cli/main.cpp index 63fc38a..f0469c0 100644 --- a/GUI/host/cli.cpp +++ b/host/cli/main.cpp @@ -1,5 +1,5 @@ -#include "host.h" -#include "hookcode.h" +#include "../host.h" +#include "../hookcode.h" #include #include #include diff --git a/GUI/host/exception.cpp b/host/exception.cpp similarity index 100% rename from GUI/host/exception.cpp rename to host/exception.cpp diff --git a/GUI/host/hookcode.cpp b/host/hookcode.cpp similarity index 100% rename from GUI/host/hookcode.cpp rename to host/hookcode.cpp diff --git a/GUI/host/hookcode.h b/host/hookcode.h similarity index 100% rename from GUI/host/hookcode.h rename to host/hookcode.h diff --git a/GUI/host/host.cpp b/host/host.cpp similarity index 100% rename from GUI/host/host.cpp rename to host/host.cpp diff --git a/GUI/host/host.h b/host/host.h similarity index 100% rename from GUI/host/host.h rename to host/host.h diff --git a/GUI/host/textthread.cpp b/host/textthread.cpp similarity index 100% rename from GUI/host/textthread.cpp rename to host/textthread.cpp diff --git a/GUI/host/textthread.h b/host/textthread.h similarity index 100% rename from GUI/host/textthread.h rename to host/textthread.h