From 8807005d452d392b6f346e4852b36a4ef29883d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Tue, 19 Nov 2024 16:00:45 +0800 Subject: [PATCH] . --- cpp/LunaHook/Lang/cht.h | 2 +- cpp/LunaHook/Lang/en.h | 2 +- cpp/LunaHook/Lang/ru.h | 2 +- cpp/LunaHook/Lang/zh.h | 2 +- cpp/LunaHook/LunaHook/CMakeLists.txt | 20 +-- cpp/LunaHook/LunaHook/embed_util.cc | 20 +-- cpp/LunaHook/LunaHook/engine32/5pb.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/A98SYS.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/AGE_System.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Anim.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/Aromarie.cpp | 80 ++++++++++++ cpp/LunaHook/LunaHook/engine32/Aromarie.h | 15 +++ cpp/LunaHook/LunaHook/engine32/Atelier.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/BGI.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/CMVS.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/CatSystem.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/Circus1.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Circus2.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/CodeX.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/Cotopha.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Debonosu.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/Elf.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/EntisGLS.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Escude.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/Eushully.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/FVP.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/GXP.cpp | 12 +- cpp/LunaHook/LunaHook/engine32/HorkEye.cpp | 10 +- cpp/LunaHook/LunaHook/engine32/KISS.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/KiriKiri.cpp | 12 +- cpp/LunaHook/LunaHook/engine32/LCScript.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/Leaf.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/LunaSoft.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Majiro.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Malie.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Minori.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/NeXAS.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/Nexton.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Ohgetsu.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Pal.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/Pensil.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/QLIE.cpp | 6 +- .../LunaHook/engine32/RPGMakerRGSS3.cpp | 12 +- cpp/LunaHook/LunaHook/engine32/Retouch.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/ScrPlayer.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/ShinaRio.cpp | 6 +- cpp/LunaHook/LunaHook/engine32/Siglus.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/Silkys.cpp | 12 +- cpp/LunaHook/LunaHook/engine32/System4x.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/SystemAoi.cpp | 8 +- cpp/LunaHook/LunaHook/engine32/Tanuki.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Taskforce2.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/Triangle.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/Unicorn.cpp | 12 +- cpp/LunaHook/LunaHook/engine32/Waffle.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/WillPlus.cpp | 18 +-- cpp/LunaHook/LunaHook/engine32/Wolf.cpp | 4 +- cpp/LunaHook/LunaHook/engine32/cef.cpp | 2 +- cpp/LunaHook/LunaHook/engine32/lucifen.cpp | 16 +-- .../LunaHook/engine32/utawarerumono.cpp | 4 +- cpp/LunaHook/LunaHook/engine64/CMVS.cpp | 2 +- cpp/LunaHook/LunaHook/engine64/LightVN.cpp | 2 +- .../LunaHook/engine64/UnrealEngine.cpp | 2 +- cpp/LunaHook/LunaHook/enginecollection32.cpp | 2 + .../LunaHook/engines/mono/monoil2cpp.cpp | 2 +- .../LunaHook/engines/mono/monoil2cpp.h | 2 +- .../LunaHook/engines/python/python.cpp | 14 +-- .../LunaHook/engines/python/python2.cpp | 2 +- .../LunaHook/engines/python/python3.cpp | 2 +- .../LunaHook/engines/v8/httpserver.cpp | 2 +- cpp/LunaHook/LunaHook/engines/v8/v8.cpp | 4 +- cpp/LunaHook/LunaHook/resource/lunajspatch.js | 2 +- .../LunaHook/resource/renpy_hook_font.py | 26 ++-- .../LunaHook/resource/renpy_hook_text.py | 28 ++--- cpp/LunaHook/LunaHook/texthook.cc | 20 +-- cpp/LunaHook/LunaHost/CMakeLists.txt | 2 +- cpp/LunaHook/include/const.h | 2 - cpp/LunaHook/include/hookcode.cpp | 2 +- cpp/LunaHook/include/types.h | 6 +- cpp/version.cmake | 16 ++- py/LunaTranslator/LunaTranslator_main.py | 24 ++-- py/LunaTranslator/gui/setting_cishu.py | 5 +- py/LunaTranslator/gui/setting_display.py | 21 ++-- py/LunaTranslator/gui/setting_display_text.py | 5 +- py/LunaTranslator/gui/setting_proxy.py | 117 +++++++++--------- py/LunaTranslator/gui/setting_textinput.py | 27 ++-- py/LunaTranslator/hiraparse/mecab.py | 11 +- py/generate_xp_code.py | 17 --- 88 files changed, 463 insertions(+), 329 deletions(-) create mode 100644 cpp/LunaHook/LunaHook/engine32/Aromarie.cpp create mode 100644 cpp/LunaHook/LunaHook/engine32/Aromarie.h diff --git a/cpp/LunaHook/Lang/cht.h b/cpp/LunaHook/Lang/cht.h index 3da6e2eb..3cc5197d 100644 --- a/cpp/LunaHook/Lang/cht.h +++ b/cpp/LunaHook/Lang/cht.h @@ -99,4 +99,4 @@ #define PROC_DISCONN L"處理程序已中斷連接 %d" #define COPYSELECTION L"自動將文字框中選取的文字複製到剪貼簿" #define FONTSELECT L"選擇字體" -#define UNMATCHABLEVERSION L"LunaHook 和 LunaHost 版本不匹配,可能無法正常運作!" \ No newline at end of file +#define UNMATCHABLEVERSION L"文件版本不匹配,可能無法正常運作,請重新下載!" \ No newline at end of file diff --git a/cpp/LunaHook/Lang/en.h b/cpp/LunaHook/Lang/en.h index dbde68d1..9ae6bbb1 100644 --- a/cpp/LunaHook/Lang/en.h +++ b/cpp/LunaHook/Lang/en.h @@ -99,4 +99,4 @@ #define PROC_DISCONN L"process disconnected %d" #define COPYSELECTION L"auto send selected text in textbox to clipboard" #define FONTSELECT L"Select Font" -#define UNMATCHABLEVERSION L"LunaHook and LunaHost versions do not match, may not work properly!" \ No newline at end of file +#define UNMATCHABLEVERSION L"The file version cannot be matched, may not work properly, please re-download again!" \ No newline at end of file diff --git a/cpp/LunaHook/Lang/ru.h b/cpp/LunaHook/Lang/ru.h index e647220b..231706b9 100644 --- a/cpp/LunaHook/Lang/ru.h +++ b/cpp/LunaHook/Lang/ru.h @@ -99,4 +99,4 @@ #define PROC_DISCONN L"Процесс отключен %d" #define COPYSELECTION L"Автоматически копировать выделенный текст в буфер обмена" #define FONTSELECT L"Выбрать шрифт" -#define UNMATCHABLEVERSION L"Версии LunaHook и LunaHost не совпадают и могут не работать должным образом!" \ No newline at end of file +#define UNMATCHABLEVERSION L"Версии файлов не совпадают и могут не работать должным образом, пожалуйста, загрузите их снова!" \ No newline at end of file diff --git a/cpp/LunaHook/Lang/zh.h b/cpp/LunaHook/Lang/zh.h index 9d7cf919..cd843294 100644 --- a/cpp/LunaHook/Lang/zh.h +++ b/cpp/LunaHook/Lang/zh.h @@ -99,4 +99,4 @@ #define PROC_DISCONN L"进程已断开连接 %d" #define COPYSELECTION L"自动将文本框中选取的文本复制到剪贴板" #define FONTSELECT L"选择字体" -#define UNMATCHABLEVERSION L"LunaHook和LunaHost版本无法匹配,可能无法正常工作!" \ No newline at end of file +#define UNMATCHABLEVERSION L"文件版本无法匹配,可能无法正常工作,请重新下载!" \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/CMakeLists.txt b/cpp/LunaHook/LunaHook/CMakeLists.txt index 581546b1..0172b64d 100644 --- a/cpp/LunaHook/LunaHook/CMakeLists.txt +++ b/cpp/LunaHook/LunaHook/CMakeLists.txt @@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) set(enginepath "engine64") set(collector "enginecollection64.cpp") else() - set(enginessrc Winters Cage AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft UnknownEngine TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT) + set(enginessrc Aromarie Winters Cage AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft UnknownEngine TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT) set(enginepath "engine32") set(collector "enginecollection32.cpp") endif() @@ -14,8 +14,17 @@ set(enginessrc "${enginepath}/${enginessrc}.cpp") message("${enginessrc}") set_source_files_properties(${enginessrc} PROPERTIES SOURCE_ENCODING "UTF-8") + +add_library(pchhook pchhook.cpp) +target_precompile_headers(pchhook PUBLIC pchhook.h) + + +add_library(hostmain main.cc) +target_link_libraries(hostmain VERSION_DEF minhook) +target_precompile_headers(hostmain REUSE_FROM pchhook) + + set(texthook_src - main.cc texthook.cc hookfinder.cc ${enginessrc} @@ -26,11 +35,6 @@ set(texthook_src veh_hook.cpp ) - -add_library(pchhook pchhook.cpp) -target_precompile_headers(pchhook PUBLIC pchhook.h) - - add_subdirectory(util) add_subdirectory(engines) @@ -51,4 +55,4 @@ target_precompile_headers(LunaHook REUSE_FROM pchhook) set_target_properties(LunaHook PROPERTIES OUTPUT_NAME "LunaHook${bitappendix}") -target_link_libraries(LunaHook Version httpapi ws2_32 Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP}) \ No newline at end of file +target_link_libraries(LunaHook hostmain Version httpapi ws2_32 Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP}) \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/embed_util.cc b/cpp/LunaHook/LunaHook/embed_util.cc index 9674e60e..b5795f6d 100644 --- a/cpp/LunaHook/LunaHook/embed_util.cc +++ b/cpp/LunaHook/LunaHook/embed_util.cc @@ -116,13 +116,13 @@ void detachall() } void solvefont(HookParam hp) { - if (hp.hook_font) + if (hp.embed_hook_font) { - attachFunction(hp.hook_font); + attachFunction(hp.embed_hook_font); } - if (hp.hook_font & F_MultiByteToWideChar) + if (hp.embed_hook_font & F_MultiByteToWideChar) disable_mbwc = true; - if (hp.hook_font & F_WideCharToMultiByte) + if (hp.embed_hook_font & F_WideCharToMultiByte) disable_wcmb = true; if (auto current_patch_fun = patch_fun.exchange(nullptr)) @@ -208,12 +208,12 @@ bool waitforevent(UINT32 timems, const ThreadParam &tp, const std::wstring &orig void TextHook::parsenewlineseperator(TextBuffer *buff) { - if (!(hp.newlineseperator)) + if (!(hp.lineSeparator)) return; if (hp.type & CODEC_UTF16) { - StringCharReplacer(buff, hp.newlineseperator, wcslen(hp.newlineseperator), L'\n'); + StringCharReplacer(buff, hp.lineSeparator, wcslen(hp.lineSeparator), L'\n'); } else if (hp.type & CODEC_UTF32) return; @@ -221,8 +221,8 @@ void TextHook::parsenewlineseperator(TextBuffer *buff) { // ansi/utf8,newlineseperator都是简单字符 std::string newlineseperatorA; - for (int i = 0; i < wcslen(hp.newlineseperator); i++) - newlineseperatorA += (char)hp.newlineseperator[i]; + for (int i = 0; i < wcslen(hp.lineSeparator); i++) + newlineseperatorA += (char)hp.lineSeparator[i]; StringCharReplacer(buff, newlineseperatorA.c_str(), newlineseperatorA.size(), '\n'); } } @@ -267,8 +267,8 @@ bool TextHook::waitfornotify(TextBuffer *buff, ThreadParam tp) return false; translatecache.insert(std::make_pair(hash, translate)); } - if (hp.newlineseperator) - strReplace(translate, L"\n", hp.newlineseperator); + if (hp.lineSeparator) + strReplace(translate, L"\n", hp.lineSeparator); translate = adjustSpacesSTD(translate, hp); if (commonsharedmem->keeprawtext) translate = origin + L" " + translate; diff --git a/cpp/LunaHook/LunaHook/engine32/5pb.cpp b/cpp/LunaHook/LunaHook/engine32/5pb.cpp index 7f8e2472..724bb926 100644 --- a/cpp/LunaHook/LunaHook/engine32/5pb.cpp +++ b/cpp/LunaHook/LunaHook/engine32/5pb.cpp @@ -605,7 +605,7 @@ namespace hp.address = addr; hp.offset = get_stack(1); hp.type = USING_STRING | CODEC_UTF8 | EMBED_ABLE | EMBED_AFTER_NEW; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; return NewHook(hp, "5bp"); } bool __() @@ -699,7 +699,7 @@ namespace xx = std::regex_replace(xx, std::wregex(L"\\\\x%l(.*?);(.*?);(.*?);#;"), L"$1"); buffer->from(xx); }; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; return NewHook(hp, "5bp"); } diff --git a/cpp/LunaHook/LunaHook/engine32/A98SYS.cpp b/cpp/LunaHook/LunaHook/engine32/A98SYS.cpp index ea7504dd..08b0de4b 100644 --- a/cpp/LunaHook/LunaHook/engine32/A98SYS.cpp +++ b/cpp/LunaHook/LunaHook/engine32/A98SYS.cpp @@ -23,7 +23,7 @@ bool A98SYS::attach_function() hp.address = addr; hp.offset = get_stack(1); hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; - hp.hook_font = F_ExtTextOutA; + hp.embed_hook_font = F_ExtTextOutA; return NewHook(hp, "A98SYS"); } \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/AGE_System.cpp b/cpp/LunaHook/LunaHook/engine32/AGE_System.cpp index d215102a..fd520bd4 100644 --- a/cpp/LunaHook/LunaHook/engine32/AGE_System.cpp +++ b/cpp/LunaHook/LunaHook/engine32/AGE_System.cpp @@ -52,6 +52,6 @@ bool AGE_System::attach_function() hp.address = addr21; hp.offset = get_stack(3); hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | EMBED_AFTER_NEW; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "AGE_System"); } \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/Anim.cpp b/cpp/LunaHook/LunaHook/engine32/Anim.cpp index 6d7bcf9e..86be8207 100644 --- a/cpp/LunaHook/LunaHook/engine32/Anim.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Anim.cpp @@ -14,7 +14,7 @@ bool InsertAnimHook() myhp.address = addr + 10; myhp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS; // /HQ 不使用上下文区分 把所有线程的文本都提取 - myhp.hook_font = F_GetGlyphOutlineA; + myhp.embed_hook_font = F_GetGlyphOutlineA; // data_offset myhp.offset = get_reg(regs::ecx); char nameForUser[HOOK_NAME_SIZE] = "Anim"; @@ -34,7 +34,7 @@ bool InsertAnim2Hook() } HookParam myhp; myhp.address = addr + 10; - myhp.hook_font = F_GetGlyphOutlineA; + myhp.embed_hook_font = F_GetGlyphOutlineA; // メスつまみ3 // そんな俺に声をかけてきたのは、近所のスーパーで働いている主婦の、@n『@[赤羽:あかばね]@[千晶:ちあき]』さんだ。 myhp.filter_fun = [](TextBuffer *buffer, HookParam *hp) @@ -43,7 +43,7 @@ bool InsertAnim2Hook() result = std::regex_replace(result, std::regex("@\\[(.*?):(.*?)\\]", std::regex_constants::icase), "$1"); buffer->from(result); }; - myhp.newlineseperator = L"@n"; + myhp.lineSeparator = L"@n"; myhp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS; // 僕がいない間に変貌えられた妻の秘肉 ~ラブラブ新婚妻は他の男に抱かれ淫らに喘ぐ夢を見るか~ 体験版 diff --git a/cpp/LunaHook/LunaHook/engine32/Aromarie.cpp b/cpp/LunaHook/LunaHook/engine32/Aromarie.cpp new file mode 100644 index 00000000..b4179357 --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/Aromarie.cpp @@ -0,0 +1,80 @@ +#include "Aromarie.h" + +// https://vndb.org/v2330 +// 月ノ光太陽ノ影 + +bool Aromarie::attach_function() +{ + auto name = []() + { + char aSelectNameVoic[] = "select name,voiceBase,soundMode from envCharacter where name=?;"; + auto paSelectNameVoic = MemDbg::findBytes(aSelectNameVoic, sizeof(aSelectNameVoic), processStartAddress, processStopAddress); + if (!paSelectNameVoic) + return false; + auto push = MemDbg::findPushAddress(paSelectNameVoic, processStartAddress, processStopAddress); + if (!push) + return false; + auto addr = MemDbg::findEnclosingAlignedFunction(push); + if (!addr) + return false; + auto checks = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8); + if (!checks.size()) + return false; + auto last = checks[checks.size() - 1]; + addr = MemDbg::findEnclosingAlignedFunction(last); + if (!addr) + return false; + HookParam hp; + hp.address = addr; + hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_OVERWRITE | EMBED_DYNA_SJIS | NO_CONTEXT; + hp.offset = get_stack(1); + return NewHook(hp, "AromarieName"); + }(); + auto text = []() + { + BYTE sig[] = { + // if ( (unsigned __int8)((v6 ^ 0x20) + 95) < 0x3Cu ) + /* + .text:0040799E mov cl, al + .text:004079A0 xor ecx, 20h + .text:004079A3 add ecx, 5Fh ; '_' + .text:004079A6 and ecx, 0FFh + .text:004079AC cmp ecx, 3Ch ; '<' + .text:004079AF jl loc_407C13 + .text:004079B5 cmp al, 5Ch ; '\' + */ + 0x8A, 0xC8, + 0x83, 0xF1, 0x20, + 0x83, 0xC1, 0x5F, + 0x81, 0xE1, 0xFF, 0x00, 0x00, 0x00, + 0x83, 0xF9, 0x3C, + 0x0F, XX, XX4, + 0x3C, 0x5C}; + auto check = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress); + if (!check) + return false; + auto addr = MemDbg::findEnclosingAlignedFunction(check); + if (!addr) + return false; + auto checks = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8); + if (!checks.size()) + return false; + auto last = checks[checks.size() - 1]; + addr = MemDbg::findEnclosingAlignedFunction(last); + if (!addr) + return false; + HookParam hp; + hp.address = addr; + hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS | NO_CONTEXT; + hp.offset = get_stack(1); + hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) + { + auto s = buffer->strA(); + s = std::regex_replace(s, std::regex(R"(\\\w)"), ""); + s = std::regex_replace(s, std::regex(R"(%.*?%)"), ""); + buffer->from(s); + }; + return NewHook(hp, "AromarieText"); + }(); + return name && text; +} \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/Aromarie.h b/cpp/LunaHook/LunaHook/engine32/Aromarie.h new file mode 100644 index 00000000..cfd45d10 --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/Aromarie.h @@ -0,0 +1,15 @@ + +// https://vndb.org/v2330 +// 月ノ光太陽ノ影 + +class Aromarie : public ENGINE +{ +public: + Aromarie() + { + check_by = CHECK_BY::FILE_ALL; + check_by_target = check_by_list{L"scene.db", L"script.axr", L"se.axr", L"system.db", L"user.db", L"koe.axr", L"cg.axr", L"bgm.axr"}; + is_engine_certain = false; + }; + bool attach_function(); +}; \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/Atelier.cpp b/cpp/LunaHook/LunaHook/engine32/Atelier.cpp index 5fe05fe8..8e4982cd 100644 --- a/cpp/LunaHook/LunaHook/engine32/Atelier.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Atelier.cpp @@ -75,7 +75,7 @@ bool InsertAtelierKaguya2Hook() hp.address = addr; hp.offset = get_reg(regs::eax); hp.type = USING_STRING | EMBED_AFTER_OVERWRITE | EMBED_ABLE | EMBED_DYNA_SJIS; - hp.hook_font = F_TextOutA; + hp.embed_hook_font = F_TextOutA; hp.filter_fun = NewLineCharToSpaceFilterA; ConsoleOutput("INSERT Atelier KAGUYA2"); diff --git a/cpp/LunaHook/LunaHook/engine32/BGI.cpp b/cpp/LunaHook/LunaHook/engine32/BGI.cpp index ea17d447..550df862 100644 --- a/cpp/LunaHook/LunaHook/engine32/BGI.cpp +++ b/cpp/LunaHook/LunaHook/engine32/BGI.cpp @@ -1190,14 +1190,14 @@ bool InsertBGIDynamicHook(LPVOID addr, DWORD frame, DWORD stack) */ ULONG addr, funaddr; HookParam hp; - hp.hook_font = F_TextOutA | F_TextOutW; + hp.embed_hook_font = F_TextOutA | F_TextOutW; if (addr = search_bgi3(processStartAddress, processStopAddress)) { // 有乱码,无法处理。 Private::textIndex_ = 3; hp.offset = get_stack(Private::textIndex_); Private::type_ = Private::Type_BGI3; - hp.hook_font |= F_GetTextExtentPoint32W; + hp.embed_hook_font |= F_GetTextExtentPoint32W; if (addr - processStartAddress == 0x3B860) //[220729][1171051][きゃべつそふと] ジュエリー・ハーツ・アカデミア -We will wing wonder world-,无法处理的乱码,不知道怎么回事。 addr = 0; } @@ -1594,7 +1594,7 @@ bool InsertBGI4Hook() } }; hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_AFTER_OVERWRITE; - hp.hook_font = F_TextOutW | F_GetTextExtentPoint32W; + hp.embed_hook_font = F_TextOutW | F_GetTextExtentPoint32W; hp.filter_fun = BGI7Filter; hp.offset = get_stack(2); ConsoleOutput("BGI4"); diff --git a/cpp/LunaHook/LunaHook/engine32/CMVS.cpp b/cpp/LunaHook/LunaHook/engine32/CMVS.cpp index bc929b41..954f8810 100644 --- a/cpp/LunaHook/LunaHook/engine32/CMVS.cpp +++ b/cpp/LunaHook/LunaHook/engine32/CMVS.cpp @@ -1194,7 +1194,7 @@ namespace hp.address = addr; hp.offset = get_stack(1); hp.type = EMBED_ABLE | USING_STRING | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { std::string str = buffer->strA(); diff --git a/cpp/LunaHook/LunaHook/engine32/CatSystem.cpp b/cpp/LunaHook/LunaHook/engine32/CatSystem.cpp index 4573523f..97c11301 100644 --- a/cpp/LunaHook/LunaHook/engine32/CatSystem.cpp +++ b/cpp/LunaHook/LunaHook/engine32/CatSystem.cpp @@ -241,7 +241,7 @@ bool InsertCatSystem2Hook() auto _ = std::regex_replace(buffer->strA(), std::regex(R"(\[(.+?)/.+\])"), "$1"); buffer->from(_); }; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; return NewHook(hp, "CatSystem2new"); } namespace @@ -831,8 +831,8 @@ namespace else hp.type |= EMBED_DYNA_SJIS; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(std::regex_replace(buffer->strA(), std::regex(R"(\[(.+?)/.+\])"), "$1")); @@ -843,7 +843,7 @@ namespace if (p) { hp.type |= EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; patch_fun = []() { if (*(WORD *)p == 0xc985) diff --git a/cpp/LunaHook/LunaHook/engine32/Circus1.cpp b/cpp/LunaHook/LunaHook/engine32/Circus1.cpp index 102cf722..4b4cd772 100644 --- a/cpp/LunaHook/LunaHook/engine32/Circus1.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Circus1.cpp @@ -72,7 +72,7 @@ namespace{ hp.address =addr; hp.offset=get_stack(2); hp.type = USING_STRING|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; return NewHook(hp, "Circus1"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/Circus2.cpp b/cpp/LunaHook/LunaHook/engine32/Circus2.cpp index b9cfc608..87990451 100644 --- a/cpp/LunaHook/LunaHook/engine32/Circus2.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Circus2.cpp @@ -85,7 +85,7 @@ namespace hp.address = funcaddr; hp.offset = get_stack(2); hp.type = USING_STRING; //|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - // hp.hook_font=F_GetGlyphOutlineA; + // hp.embed_hook_font=F_GetGlyphOutlineA; // it will split a long to many lines hp.filter_fun = filter; @@ -321,8 +321,8 @@ namespace hp.address = addr; hp.filter_fun = filter; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.type = USING_STRING | EMBED_ABLE | NO_CONTEXT | EMBED_DYNA_SJIS; return NewHook(hp, "EmbedCircus"); diff --git a/cpp/LunaHook/LunaHook/engine32/CodeX.cpp b/cpp/LunaHook/LunaHook/engine32/CodeX.cpp index b11be3ab..626b1b09 100644 --- a/cpp/LunaHook/LunaHook/engine32/CodeX.cpp +++ b/cpp/LunaHook/LunaHook/engine32/CodeX.cpp @@ -44,7 +44,7 @@ bool InsertCodeXHook() hp.offset = get_reg(regs::eax); hp.index = 0; hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_OVERWRITE | NO_CONTEXT; // 无法解决中文乱码 - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = CodeXFilter; ConsoleOutput("INSERT CodeX"); @@ -136,7 +136,7 @@ namespace hp.offset = get_stack(1); hp.split = get_stack(2); hp.type = USING_STRING | FULL_STRING | NO_CONTEXT | USING_SPLIT | EMBED_ABLE | EMBED_AFTER_OVERWRITE; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = CodeXFilter; return NewHook(hp, "CodeX2"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Cotopha.cpp b/cpp/LunaHook/LunaHook/engine32/Cotopha.cpp index 9ed466f4..56933d26 100644 --- a/cpp/LunaHook/LunaHook/engine32/Cotopha.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Cotopha.cpp @@ -777,7 +777,7 @@ namespace hp.address = addr; hp.offset = get_stack(3); hp.type = CODEC_UTF16 | USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_hook_font = F_GetGlyphOutlineW; return NewHook(hp, "Cotopha5"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp b/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp index 9f17787d..d1c00352 100644 --- a/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp @@ -21,7 +21,7 @@ namespace *split = FIXED_SPLIT_VALUE; buffer->from_cs((char *)*(DWORD *)(stack->base + hp->offset)); } - void hook_after(hook_stack *s, TextBuffer buffer) + void embed_fun(hook_stack *s, TextBuffer buffer) { static std::string ts; ts = buffer.viewA(); @@ -60,8 +60,8 @@ namespace hp.address = hook_addr; hp.text_fun = SpecialHookDebonosuScenario; // hp.type = USING_STRING; - hp.hook_after = hook_after; - hp.hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A; + hp.embed_fun = embed_fun; + hp.embed_hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A; hp.type = USING_STRING | NO_CONTEXT | USING_SPLIT | FIXING_SPLIT | EMBED_ABLE | EMBED_DYNA_SJIS; // there is only one thread hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { diff --git a/cpp/LunaHook/LunaHook/engine32/Elf.cpp b/cpp/LunaHook/LunaHook/engine32/Elf.cpp index dff05d34..1228c5f3 100644 --- a/cpp/LunaHook/LunaHook/engine32/Elf.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Elf.cpp @@ -333,9 +333,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter1; + hp.embed_fun = Private::hookafter1; hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.hook_font = F_TextOutA; + hp.embed_hook_font = F_TextOutA; succ |= NewHook(hp, "EmbedElf"); hp.address = addr + 5; hp.text_fun = Private::hookAfter; diff --git a/cpp/LunaHook/LunaHook/engine32/EntisGLS.cpp b/cpp/LunaHook/LunaHook/engine32/EntisGLS.cpp index e744be8e..9c918372 100644 --- a/cpp/LunaHook/LunaHook/engine32/EntisGLS.cpp +++ b/cpp/LunaHook/LunaHook/engine32/EntisGLS.cpp @@ -24,7 +24,7 @@ bool EntisGLS::attach_function() { HookParam hp; hp.address = addr ; hp.offset=get_stack(1); - hp.hook_font=F_GetGlyphOutlineW; + hp.embed_hook_font=F_GetGlyphOutlineW; hp.type = USING_STRING|CODEC_UTF16|EMBED_ABLE|EMBED_AFTER_NEW; return NewHook(hp, "EntisGLS"); diff --git a/cpp/LunaHook/LunaHook/engine32/Escude.cpp b/cpp/LunaHook/LunaHook/engine32/Escude.cpp index 26c6a63e..2f5c4531 100644 --- a/cpp/LunaHook/LunaHook/engine32/Escude.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Escude.cpp @@ -216,7 +216,7 @@ namespace *role = arg->role(); buffer->from_cs(trimmedText); } - void hook_after(hook_stack *s, TextBuffer buffer) + void embed_fun(hook_stack *s, TextBuffer buffer) { static std::string data_; data_ = buffer.strA(); @@ -249,12 +249,12 @@ bool InsertEscudeHook() HookParam hp; hp.address = addr; hp.text_fun = hook_before; - hp.hook_after = hook_after; - hp.hook_font = F_TextOutA | F_GetTextExtentPoint32A; + hp.embed_fun = embed_fun; + hp.embed_hook_font = F_TextOutA | F_GetTextExtentPoint32A; hp.text_fun = SpecialHookEscude; hp.filter_fun = EscudeFilter; hp.type = USING_STRING | USING_SPLIT | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS; // NO_CONTEXT as this function is only called by one caller anyway - hp.newlineseperator = L""; + hp.lineSeparator = L""; ConsoleOutput("INSERT Escude"); return NewHook(hp, "Escude"); diff --git a/cpp/LunaHook/LunaHook/engine32/Eushully.cpp b/cpp/LunaHook/LunaHook/engine32/Eushully.cpp index 286110a5..4a24871b 100644 --- a/cpp/LunaHook/LunaHook/engine32/Eushully.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Eushully.cpp @@ -519,7 +519,7 @@ bool InsertEushullyHook() hp.address = lastCaller; hp.type = USING_STRING | FIXING_SPLIT | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; // merging all threads hp.offset = arg2_lpString; // arg2 = 0x4 * 2 - hp.hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A | F_GetGlyphOutlineA | F_CreateFontA; + hp.embed_hook_font = F_MultiByteToWideChar | F_GetTextExtentPoint32A | F_GetGlyphOutlineA | F_CreateFontA; ConsoleOutput("INSERT Eushully"); bool succ = NewHook(hp, "ARCGameEngine"); if (thisCaller) diff --git a/cpp/LunaHook/LunaHook/engine32/FVP.cpp b/cpp/LunaHook/LunaHook/engine32/FVP.cpp index 9b789eb2..fdca5d40 100644 --- a/cpp/LunaHook/LunaHook/engine32/FVP.cpp +++ b/cpp/LunaHook/LunaHook/engine32/FVP.cpp @@ -476,7 +476,7 @@ namespace hp.address = addr; hp.offset = get_stack(1); hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; - hp.hook_font = F_DrawTextA | F_GetGlyphOutlineA; + hp.embed_hook_font = F_DrawTextA | F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(std::regex_replace(buffer->strA(), std::regex("\\[.+\\|(.+?)\\]"), "$1")); diff --git a/cpp/LunaHook/LunaHook/engine32/GXP.cpp b/cpp/LunaHook/LunaHook/engine32/GXP.cpp index 1a28dda9..0e88ec95 100644 --- a/cpp/LunaHook/LunaHook/engine32/GXP.cpp +++ b/cpp/LunaHook/LunaHook/engine32/GXP.cpp @@ -412,10 +412,10 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hook2a; + hp.embed_fun = Private::hook2a; hp.type = EMBED_ABLE | CODEC_UTF16 | USING_STRING | NO_CONTEXT; - hp.newlineseperator = L"%r"; - hp.hook_font = F_GetGlyphOutlineW; + hp.lineSeparator = L"%r"; + hp.embed_hook_font = F_GetGlyphOutlineW; bool succ = NewHook(hp, "EmbedGXP"); hp.address = addr + 5; hp.text_fun = Private::hookAfter; @@ -493,10 +493,10 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hook2a; + hp.embed_fun = Private::hook2a; hp.type = EMBED_ABLE | CODEC_UTF16 | USING_STRING | NO_CONTEXT; - hp.newlineseperator = L"%r"; - hp.hook_font = F_GetGlyphOutlineW; + hp.lineSeparator = L"%r"; + hp.embed_hook_font = F_GetGlyphOutlineW; bool succ = NewHook(hp, "EmbedGXP2"); hp.address = addr + 5; hp.text_fun = Private::hookAfter; diff --git a/cpp/LunaHook/LunaHook/engine32/HorkEye.cpp b/cpp/LunaHook/LunaHook/engine32/HorkEye.cpp index fdc3b0e6..b3526dd2 100644 --- a/cpp/LunaHook/LunaHook/engine32/HorkEye.cpp +++ b/cpp/LunaHook/LunaHook/engine32/HorkEye.cpp @@ -256,9 +256,9 @@ bool InsertHorkEyeHook() hp.offset = get_reg(regs::ebx); hp.type = USING_STRING | NO_CONTEXT | FIXING_SPLIT | EMBED_ABLE | EMBED_DYNA_SJIS; hp.text_fun = hookBefore<-4 - 1>; - hp.hook_after = hookafter<-4 - 1>; + hp.embed_fun = hookafter<-4 - 1>; hp.filter_fun = HorkEyeFilter; - hp.newlineseperator = L"[n]"; + hp.lineSeparator = L"[n]"; ConsoleOutput("INSERT HorkEye"); return NewHook(hp, "HorkEye"); @@ -282,7 +282,7 @@ bool InsertHorkEyeHook() hp.offset = get_stack(1); hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = hookBefore<1>; - hp.hook_after = hookafter<1>; + hp.embed_fun = hookafter<1>; return NewHook(hp, "HorkEye2"); } @@ -325,7 +325,7 @@ bool InsertHorkEye3Hook() hp.offset = get_stack(1); hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = hookBefore<1>; - hp.hook_after = hookafter<1>; + hp.embed_fun = hookafter<1>; return NewHook(hp, "HorkEye3"); } @@ -359,7 +359,7 @@ bool InsertHorkEye4Hook() hp.offset = get_reg(regs::eax); hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS; hp.text_fun = hookBefore<-1 - 1>; - hp.hook_after = hookafter<-1 - 1>; + hp.embed_fun = hookafter<-1 - 1>; return NewHook(hp, "HorkEye4"); } diff --git a/cpp/LunaHook/LunaHook/engine32/KISS.cpp b/cpp/LunaHook/LunaHook/engine32/KISS.cpp index 64124e0e..c3a88c89 100644 --- a/cpp/LunaHook/LunaHook/engine32/KISS.cpp +++ b/cpp/LunaHook/LunaHook/engine32/KISS.cpp @@ -29,7 +29,7 @@ bool InsertKissHook() { hp.address = addr; hp.offset=get_reg(regs::esi); hp.type = USING_STRING | NO_CONTEXT|EMBED_DYNA_SJIS|EMBED_ABLE|EMBED_AFTER_NEW; - hp.hook_font=F_GetTextExtentPoint32A|F_ExtTextOutA; + hp.embed_hook_font=F_GetTextExtentPoint32A|F_ExtTextOutA; ConsoleOutput("INSERT Kiss"); return NewHook(hp, "Kiss"); } diff --git a/cpp/LunaHook/LunaHook/engine32/KiriKiri.cpp b/cpp/LunaHook/LunaHook/engine32/KiriKiri.cpp index bf9b0032..67d56558 100644 --- a/cpp/LunaHook/LunaHook/engine32/KiriKiri.cpp +++ b/cpp/LunaHook/LunaHook/engine32/KiriKiri.cpp @@ -1417,7 +1417,7 @@ namespace hp.address = addr; hp.type = EMBED_ABLE | CODEC_UTF16 | NO_CONTEXT; hp.text_fun = hookBefore; - hp.hook_after = hookafter; + hp.embed_fun = hookafter; return NewHook(hp, "EmbedKrkr2"); } @@ -1609,9 +1609,9 @@ dl 16 hp.address = addr; hp.type = EMBED_ABLE | CODEC_UTF8 | NO_CONTEXT | USING_STRING; hp.text_fun = hookBeforez; - hp.hook_after = after; - hp.newlineseperator = L"\\n"; - hp.hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW; + hp.embed_fun = after; + hp.lineSeparator = L"\\n"; + hp.embed_hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW; succ |= NewHook(hp, "EmbedKrkrZ"); // return true; } @@ -1682,7 +1682,7 @@ namespace return buffer->clear(); buffer->from(t); }; - hp.hook_after = [](hook_stack *s, TextBuffer buffer) + hp.embed_fun = [](hook_stack *s, TextBuffer buffer) { auto t = std::wstring((wchar_t *)s->stack[off / 4]); auto newText = buffer.strW(); @@ -1692,7 +1692,7 @@ namespace newText = newText + L"[r]"; // 揺り籠より天使まで wcscpy((wchar_t *)s->stack[off / 4], newText.c_str()); }; - hp.hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW; + hp.embed_hook_font = F_GetTextExtentPoint32W | F_GetGlyphOutlineW; return NewHook(hp, "Krkr2wcs"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/LCScript.cpp b/cpp/LunaHook/LunaHook/engine32/LCScript.cpp index c36e3089..e02f8a92 100644 --- a/cpp/LunaHook/LunaHook/engine32/LCScript.cpp +++ b/cpp/LunaHook/LunaHook/engine32/LCScript.cpp @@ -676,16 +676,16 @@ namespace HookParam hp; hp.address = addr1; hp.text_fun = Private::hook1; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.type = EMBED_ABLE | NO_CONTEXT; - hp.newlineseperator = L"\x01"; - hp.hook_font = F_GetGlyphOutlineA; + hp.lineSeparator = L"\x01"; + hp.embed_hook_font = F_GetGlyphOutlineA; if (dyna) { static ULONG dynas; dynas = dyna; hp.type |= EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; patch_fun = []() { ReplaceFunction((PVOID)dynas, (PVOID)(ULONG)isLeadByteChar); diff --git a/cpp/LunaHook/LunaHook/engine32/Leaf.cpp b/cpp/LunaHook/LunaHook/engine32/Leaf.cpp index 4a906a09..3ad5050c 100644 --- a/cpp/LunaHook/LunaHook/engine32/Leaf.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Leaf.cpp @@ -455,14 +455,14 @@ bool InsertLeafHook() // 这个会卡死,无解 // hp.address=addr1+7; // hp.hook_before=Private::hook1; - // hp.hook_after=Private::hookafterbf; + // hp.embed_fun=Private::hookafterbf; // hp.type=EMBED_ABLE; // NewHook(hp,"EmbedLeaf"); hp1.address = addr2 + 7; hp1.text_fun = hook2; - hp1.hook_after = hook2a; + hp1.embed_fun = hook2a; hp1.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp1.newlineseperator = L"\\n"; + hp1.lineSeparator = L"\\n"; succ |= NewHook(hp1, "EmbedLeaf"); return succ; } @@ -770,7 +770,7 @@ namespace hp.address = addr; hp.offset = get_stack(1); hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS | EMBED_AFTER_NEW; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.filter_fun = AquaplusFilter; return NewHook(hp, "wa2special"); } diff --git a/cpp/LunaHook/LunaHook/engine32/LunaSoft.cpp b/cpp/LunaHook/LunaHook/engine32/LunaSoft.cpp index 9604151e..131db7fc 100644 --- a/cpp/LunaHook/LunaHook/engine32/LunaSoft.cpp +++ b/cpp/LunaHook/LunaHook/engine32/LunaSoft.cpp @@ -506,7 +506,7 @@ namespace HookParam hp; hp.address = addr1; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter1; + hp.embed_fun = Private::hookafter1; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; auto succ = NewHook(hp, "EMBEDLUNA"); hp.address = addr2; diff --git a/cpp/LunaHook/LunaHook/engine32/Majiro.cpp b/cpp/LunaHook/LunaHook/engine32/Majiro.cpp index 23df5cee..964b4d52 100644 --- a/cpp/LunaHook/LunaHook/engine32/Majiro.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Majiro.cpp @@ -233,7 +233,7 @@ bool InsertMajiroHook3x() { hp.offset=get_reg(regs::ecx); hp.type = USING_STRING | NO_CONTEXT;//|EMBED_ABLE|EMBED_AFTER_OVERWRITE|EMBED_DYNA_SJIS; //可以内嵌,但是必须保持「」,且DynamicEncoding编码的文字会被自动替换成引擎内的某的字符,导致可读性低。 - //hp.hook_font=F_TextOutA|F_GetTextExtentPoint32A; + //hp.embed_hook_font=F_TextOutA|F_GetTextExtentPoint32A; //https://vndb.org/v17376 //私が好きなら「好き」って言って! hp.text_fun= [](hook_stack *stack, HookParam *hp, TextBuffer *buffer, uintptr_t *split){ diff --git a/cpp/LunaHook/LunaHook/engine32/Malie.cpp b/cpp/LunaHook/LunaHook/engine32/Malie.cpp index 73a4ab2b..f0db5f4a 100644 --- a/cpp/LunaHook/LunaHook/engine32/Malie.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Malie.cpp @@ -1473,7 +1473,7 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.type = CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT; return NewHook(hp, "EmbedMalie"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Minori.cpp b/cpp/LunaHook/LunaHook/engine32/Minori.cpp index 85b53524..a544656a 100644 --- a/cpp/LunaHook/LunaHook/engine32/Minori.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Minori.cpp @@ -665,9 +665,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBeforehookBefore; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.type = EMBED_ABLE | USING_STRING | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(std::regex_replace(buffer->strA(), std::regex("\\{.*?\\}"), "")); @@ -678,7 +678,7 @@ namespace HookParam hp; hp.address = addr + 5; hp.text_fun = Private::hookAfter; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; count |= NewHook(hp, "EmbedMinori"); } return true; // replace all functions diff --git a/cpp/LunaHook/LunaHook/engine32/NeXAS.cpp b/cpp/LunaHook/LunaHook/engine32/NeXAS.cpp index 06d2adf9..e2c59286 100644 --- a/cpp/LunaHook/LunaHook/engine32/NeXAS.cpp +++ b/cpp/LunaHook/LunaHook/engine32/NeXAS.cpp @@ -310,7 +310,7 @@ bool InsertNeXASHookA() hp.address = addrx + sizeof(sig2) - 5; hp.offset = get_reg(regs::eax); hp.type = USING_STRING; - hp.newlineseperator = L"@n"; + hp.lineSeparator = L"@n"; hp.filter_fun = [](TextBuffer *buffer, HookParam *) { auto s = buffer->strA(); @@ -483,7 +483,7 @@ namespace } } }; - hp.newlineseperator = L"@n"; + hp.lineSeparator = L"@n"; return NewHook(hp, "NeXAS3"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/Nexton.cpp b/cpp/LunaHook/LunaHook/engine32/Nexton.cpp index cecc1042..f76ec2db 100644 --- a/cpp/LunaHook/LunaHook/engine32/Nexton.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Nexton.cpp @@ -757,7 +757,7 @@ bool attach(ULONG startAddress, ULONG stopAddress) // attach scenario hp.type=USING_STRING|EMBED_ABLE|EMBED_AFTER_NEW| EMBED_DYNA_SJIS|NO_CONTEXT; hp.offset=get_stack(1); hp.text_fun=Private::hookBefore; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; return NewHook(hp,"EmbedNexton"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Ohgetsu.cpp b/cpp/LunaHook/LunaHook/engine32/Ohgetsu.cpp index 36a150ff..55d11bee 100644 --- a/cpp/LunaHook/LunaHook/engine32/Ohgetsu.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Ohgetsu.cpp @@ -133,7 +133,7 @@ namespace hp.address = addr; hp.offset = get_stack(2); hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "Basil2"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/Pal.cpp b/cpp/LunaHook/LunaHook/engine32/Pal.cpp index 488ea7bb..a77bb499 100644 --- a/cpp/LunaHook/LunaHook/engine32/Pal.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Pal.cpp @@ -177,12 +177,12 @@ static bool InsertNewPal1Hook() hp.offset = get_stack(2); // arg2 hp.type = USING_STRING | EMBED_ABLE | NO_CONTEXT; hp.text_fun = before; - hp.hook_after = after; + hp.embed_fun = after; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(rubyRemove(buffer->strA())); }; - hp.hook_font = F_CreateFontIndirectA | F_CreateFontA; + hp.embed_hook_font = F_CreateFontIndirectA | F_CreateFontA; ConsoleOutput("INSERT Pal1"); return NewHook(hp, "Pal"); } @@ -239,7 +239,7 @@ namespace hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW; // 无法编码的字符无法显示,若开启dyna则会直接略过这个字,还不如不开。 //[230929] [ユニゾンシフト] 恋とHしかしていない! - hp.newlineseperator = L"
"; + hp.lineSeparator = L"
"; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(rubyRemove(buffer->strA())); diff --git a/cpp/LunaHook/LunaHook/engine32/Pensil.cpp b/cpp/LunaHook/LunaHook/engine32/Pensil.cpp index 3da595c9..2ad067c7 100644 --- a/cpp/LunaHook/LunaHook/engine32/Pensil.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Pensil.cpp @@ -665,7 +665,7 @@ namespace hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; hp.offset = get_stack(2); hp.filter_fun = pensilfilter; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "EmbedPensil"); }; if (addr && _do(addr)) @@ -702,7 +702,7 @@ namespace hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; hp.offset = get_stack(1); hp.filter_fun = pensilfilter; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "EmbedPensilChoice"); } diff --git a/cpp/LunaHook/LunaHook/engine32/QLIE.cpp b/cpp/LunaHook/LunaHook/engine32/QLIE.cpp index fcf3cfb2..a41e3a38 100644 --- a/cpp/LunaHook/LunaHook/engine32/QLIE.cpp +++ b/cpp/LunaHook/LunaHook/engine32/QLIE.cpp @@ -1014,10 +1014,10 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.newlineseperator = L"[n]"; + hp.embed_fun = Private::hookafter; + hp.lineSeparator = L"[n]"; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | USING_STRING | NO_CONTEXT; - hp.hook_font = F_ExtTextOutA | F_GetTextExtentPoint32A; + hp.embed_hook_font = F_ExtTextOutA | F_GetTextExtentPoint32A; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(std::regex_replace(buffer->strA(), std::regex("\\[rb,(.*?),.+\\]"), "$1")); diff --git a/cpp/LunaHook/LunaHook/engine32/RPGMakerRGSS3.cpp b/cpp/LunaHook/LunaHook/engine32/RPGMakerRGSS3.cpp index 54edc7a9..97ade024 100644 --- a/cpp/LunaHook/LunaHook/engine32/RPGMakerRGSS3.cpp +++ b/cpp/LunaHook/LunaHook/engine32/RPGMakerRGSS3.cpp @@ -725,9 +725,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_hook_font = F_GetGlyphOutlineW; auto succ = NewHook(hp, "EmbedRGSS3"); hp.address = addr + 5; hp.text_fun = Private::hookAfter; @@ -890,9 +890,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_hook_font = F_GetGlyphOutlineW; functionAddress = addr; return NewHook(hp, "EmbedRGSS3Choice"); @@ -1348,9 +1348,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | NO_CONTEXT; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_hook_font = F_GetGlyphOutlineW; return NewHook(hp, "EmbedRGSS3Other"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Retouch.cpp b/cpp/LunaHook/LunaHook/engine32/Retouch.cpp index b3c5ab41..23a9c8bd 100644 --- a/cpp/LunaHook/LunaHook/engine32/Retouch.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Retouch.cpp @@ -31,7 +31,7 @@ bool InsertRetouch1Hook() hp.address = addr; hp.offset=get_stack(1); hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; hp.text_fun = SpecialHookRetouch1; ConsoleOutput("INSERT Retouch"); return NewHook(hp, "Retouch"); @@ -56,7 +56,7 @@ bool InsertRetouch2Hook() hp.address = addr; hp.offset=get_stack(1); hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; ConsoleOutput("INSERT Retouch"); return NewHook(hp, "Retouch"); } @@ -87,7 +87,7 @@ bool attach() // attach scenario hp.address = addr; hp.offset=get_stack(1); hp.type = USING_STRING|NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; return NewHook(hp, "RetouchHistory"); } diff --git a/cpp/LunaHook/LunaHook/engine32/ScrPlayer.cpp b/cpp/LunaHook/LunaHook/engine32/ScrPlayer.cpp index f03ba9fb..3d7fe1e9 100644 --- a/cpp/LunaHook/LunaHook/engine32/ScrPlayer.cpp +++ b/cpp/LunaHook/LunaHook/engine32/ScrPlayer.cpp @@ -24,7 +24,7 @@ bool ScrPlayer_attach_function1() hp.offset = get_stack(5); // 会把多行分开导致翻译不对。 hp.type = USING_STRING; //|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - // hp.hook_font=F_GetGlyphOutlineA; + // hp.embed_hook_font=F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *) { static int idx = 0; diff --git a/cpp/LunaHook/LunaHook/engine32/ShinaRio.cpp b/cpp/LunaHook/LunaHook/engine32/ShinaRio.cpp index be107e0c..86d60147 100644 --- a/cpp/LunaHook/LunaHook/engine32/ShinaRio.cpp +++ b/cpp/LunaHook/LunaHook/engine32/ShinaRio.cpp @@ -974,10 +974,10 @@ namespace HookParam hp; hp.address = (ULONG)::GetTextExtentPoint32A; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.newlineseperator = L"_r"; - hp.hook_font = F_GetGlyphOutlineA; + hp.lineSeparator = L"_r"; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { buffer->from(std::regex_replace(buffer->strA(), std::regex("_t!.*?[/>]"), "")); diff --git a/cpp/LunaHook/LunaHook/engine32/Siglus.cpp b/cpp/LunaHook/LunaHook/engine32/Siglus.cpp index b8108a63..0a284e48 100644 --- a/cpp/LunaHook/LunaHook/engine32/Siglus.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Siglus.cpp @@ -1783,8 +1783,8 @@ namespace hp.address = addr; hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE | NO_CONTEXT; // 0x41 hp.text_fun = Private::text_fun; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineW; return NewHook(hp, "EmbedSiglus"); } } @@ -1872,8 +1872,8 @@ namespace OtherHook hp.address = addr; hp.type = EMBED_ABLE | CODEC_UTF16 | EMBED_INSERT_SPACE_AFTER_UNENCODABLE | NO_CONTEXT; // 0x41 hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; - hp.hook_font = F_GetGlyphOutlineW; + hp.embed_fun = Private::hookafter2; + hp.embed_hook_font = F_GetGlyphOutlineW; return NewHook(hp, "EmbedSiglus"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Silkys.cpp b/cpp/LunaHook/LunaHook/engine32/Silkys.cpp index 02b52d89..42e515ee 100644 --- a/cpp/LunaHook/LunaHook/engine32/Silkys.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Silkys.cpp @@ -313,8 +313,8 @@ bool InsertSilkysHook() hp.address = addr; hp.type = USING_STRING | NO_CONTEXT | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = hookBefore; - hp.hook_after = hookafter1; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_fun = hookafter1; + hp.embed_hook_font = F_GetGlyphOutlineA; succ_ |= NewHook(hp, "EmbedSilkys"); } { @@ -373,7 +373,7 @@ namespace HookParam hp; hp.address = addr; hp.offset = get_stack(1); - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW; return NewHook(hp, "EmbedSilkysX"); } @@ -650,7 +650,7 @@ bool Silkyssakura::attach_function() hp_embed.address = addr; hp_embed.offset = get_stack(2); hp_embed.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | CODEC_UTF16; - hp_embed.hook_font = F_GetGlyphOutlineW; + hp_embed.embed_hook_font = F_GetGlyphOutlineW; return NewHook(hp_embed, "embedSilkyssakura"); // 这个是分两层分别绘制文字和阴影,需要两个都内嵌。 } } @@ -688,7 +688,7 @@ namespace HookParam hp; hp.address = addr; hp.offset = get_reg(regs::ecx); - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; return NewHook(hp, "SilkysX"); } @@ -719,7 +719,7 @@ bool Silkysveryveryold_attach_function() HookParam hp; hp.address = addr; hp.offset = get_stack(1); - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.type = USING_STRING; return NewHook(hp, "SilkysX"); } diff --git a/cpp/LunaHook/LunaHook/engine32/System4x.cpp b/cpp/LunaHook/LunaHook/engine32/System4x.cpp index da92b9b6..b9aefac7 100644 --- a/cpp/LunaHook/LunaHook/engine32/System4x.cpp +++ b/cpp/LunaHook/LunaHook/engine32/System4x.cpp @@ -1423,7 +1423,7 @@ namespace hp.address = addr; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; auto succ = NewHook(hp, "EmbedSysmtem44"); hp.address = addr + 5; hp.text_fun = Private::hookAfter; diff --git a/cpp/LunaHook/LunaHook/engine32/SystemAoi.cpp b/cpp/LunaHook/LunaHook/engine32/SystemAoi.cpp index 89ddd26a..7491a166 100644 --- a/cpp/LunaHook/LunaHook/engine32/SystemAoi.cpp +++ b/cpp/LunaHook/LunaHook/engine32/SystemAoi.cpp @@ -762,7 +762,7 @@ namespace { hp.type |= CODEC_UTF16; hp.text_fun = beforeAgsSpriteCreateTextW; - hp.hook_after = afterAgsSpriteCreateTextW; + hp.embed_fun = afterAgsSpriteCreateTextW; succ |= NewHook(hp, "SystemAoiW"); ULONG addr = findAoiProc(hModule, "AgsSpriteCreateTextEx", 1); @@ -773,7 +773,7 @@ namespace hp.offset = get_stack(2); hp.type = CODEC_UTF16 | EMBED_ABLE; //|EMBED_AFTER_OVERWRITE; hp.text_fun = beforeAgsSpriteCreateTextExW; - hp.hook_after = afterAgsSpriteCreateTextExW; + hp.embed_fun = afterAgsSpriteCreateTextExW; succ |= NewHook(hp, "SystemAoiExW"); } @@ -782,8 +782,8 @@ namespace else { hp.text_fun = beforeAgsSpriteCreateTextA; - hp.hook_after = afterAgsSpriteCreateTextA; - hp.hook_font = F_DrawTextExA; + hp.embed_fun = afterAgsSpriteCreateTextA; + hp.embed_hook_font = F_DrawTextExA; if (AgsPatchA::attach(processStartAddress, processStopAddress) == false) hp.type |= EMBED_DYNA_SJIS; succ |= NewHook(hp, "SystemAoiA"); diff --git a/cpp/LunaHook/LunaHook/engine32/Tanuki.cpp b/cpp/LunaHook/LunaHook/engine32/Tanuki.cpp index c08c636a..4247484c 100644 --- a/cpp/LunaHook/LunaHook/engine32/Tanuki.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Tanuki.cpp @@ -29,7 +29,7 @@ bool InsertTanukiHook() hp.address = j; hp.offset=get_stack(1); hp.type = USING_STRING | NO_CONTEXT|EMBED_ABLE|EMBED_AFTER_NEW|EMBED_DYNA_SJIS; - hp.hook_font=F_GetGlyphOutlineA; + hp.embed_hook_font=F_GetGlyphOutlineA; ConsoleOutput("INSERT TanukiSoft"); return NewHook(hp, "TanukiSoft"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Taskforce2.cpp b/cpp/LunaHook/LunaHook/engine32/Taskforce2.cpp index 26d03cea..f6b8ebfb 100644 --- a/cpp/LunaHook/LunaHook/engine32/Taskforce2.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Taskforce2.cpp @@ -392,8 +392,8 @@ namespace HookParam hp; hp.address = addr + addr_offset; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA; hp.type = USING_STRING | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; return NewHook(hp, "EmbedTaskforce"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Triangle.cpp b/cpp/LunaHook/LunaHook/engine32/Triangle.cpp index 561b149b..7b5697e8 100644 --- a/cpp/LunaHook/LunaHook/engine32/Triangle.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Triangle.cpp @@ -56,7 +56,7 @@ bool Triangle::attach_function() hp.offset = get_stack(4); hp.split = get_stack(1); hp.type = USING_STRING | USING_SPLIT; - hp.hook_font = F_TextOutA; + hp.embed_hook_font = F_TextOutA; hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { // ▼ diff --git a/cpp/LunaHook/LunaHook/engine32/Unicorn.cpp b/cpp/LunaHook/LunaHook/engine32/Unicorn.cpp index a1e75ee5..f4353af8 100644 --- a/cpp/LunaHook/LunaHook/engine32/Unicorn.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Unicorn.cpp @@ -481,11 +481,11 @@ namespace HookParam hp; hp.address = beforeAddress; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; hp.offset = get_stack(1); - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; auto suc = NewHook(hp, "EMbedUnicorn"); hp.address = afterAddress; hp.text_fun = Private::hookAfter; @@ -784,10 +784,10 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.newlineseperator = L"\\n"; - hp.hook_font = F_GetGlyphOutlineA; + hp.lineSeparator = L"\\n"; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "EMbedUnicornOther"); } diff --git a/cpp/LunaHook/LunaHook/engine32/Waffle.cpp b/cpp/LunaHook/LunaHook/engine32/Waffle.cpp index 434023b2..8a883eae 100644 --- a/cpp/LunaHook/LunaHook/engine32/Waffle.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Waffle.cpp @@ -484,9 +484,9 @@ namespace HookParam hp; hp.address = addr; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; + hp.embed_fun = Private::hookafter; hp.index = 4; - hp.hook_font = F_TextOutA | F_GetTextExtentPoint32A; + hp.embed_hook_font = F_TextOutA | F_GetTextExtentPoint32A; hp.type = DATA_INDIRECT | USING_STRING | EMBED_ABLE | NO_CONTEXT | EMBED_DYNA_SJIS; if (role == Engine::NameRole) count += NewHook(hp, "EmbedWaffle_name"); diff --git a/cpp/LunaHook/LunaHook/engine32/WillPlus.cpp b/cpp/LunaHook/LunaHook/engine32/WillPlus.cpp index df5345ca..013408a3 100644 --- a/cpp/LunaHook/LunaHook/engine32/WillPlus.cpp +++ b/cpp/LunaHook/LunaHook/engine32/WillPlus.cpp @@ -601,8 +601,8 @@ bool InsertWillPlus4Hook() // hp.filter_fun = WillPlus_extra_filter; hp.type = USING_STRING | CODEC_UTF16 | EMBED_ABLE; hp.text_fun = will3::hookBefore; - hp.newlineseperator = L"\\n"; - hp.hook_after = will3::hookafter; + hp.lineSeparator = L"\\n"; + hp.embed_fun = will3::hookafter; return NewHook(hp, "EmbedWillplus3"); } bool InsertWillPlus5Hook() @@ -860,9 +860,9 @@ namespace savetyperef[_type] = _tinfo; hp.text_fun = hookBefore<_type>; hp.type = EMBED_ABLE | CODEC_UTF16 | NO_CONTEXT; - hp.newlineseperator = L"\\n"; - hp.hook_after = hookafter<_type>; - hp.hook_font = F_MultiByteToWideChar | F_GetGlyphOutlineW; + hp.lineSeparator = L"\\n"; + hp.embed_fun = hookafter<_type>; + hp.embed_hook_font = F_MultiByteToWideChar | F_GetGlyphOutlineW; char _[] = "EmbedWillplusW0"; _[sizeof(_) - 2] += _type; return NewHook(hp, _); @@ -1571,15 +1571,15 @@ namespace hp.text_fun = Private::hookBefore; hp.type = EMBED_ABLE | NO_CONTEXT; - hp.newlineseperator = L"\\n"; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA | F_TextOutA; + hp.lineSeparator = L"\\n"; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA | F_TextOutA; static ULONG paddr = (PatchA::patchEncoding(startAddress, stopAddress)); ConsoleOutput("%p", paddr); if (paddr) { hp.type |= EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA | F_TextOutA; + hp.embed_hook_font = F_GetGlyphOutlineA | F_TextOutA; patch_fun = []() { PatchA::replace_near_call(paddr + 5, (ULONG)PatchA::Private::isLeadByteChar); diff --git a/cpp/LunaHook/LunaHook/engine32/Wolf.cpp b/cpp/LunaHook/LunaHook/engine32/Wolf.cpp index 3733463b..1413e817 100644 --- a/cpp/LunaHook/LunaHook/engine32/Wolf.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Wolf.cpp @@ -871,9 +871,9 @@ namespace hp.offset = get_reg(regs::ecx); hp.index = 4; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter2; + hp.embed_fun = Private::hookafter2; hp.type = USING_STRING | DATA_INDIRECT | EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; return NewHook(hp, "EmbedWolf"); } diff --git a/cpp/LunaHook/LunaHook/engine32/cef.cpp b/cpp/LunaHook/LunaHook/engine32/cef.cpp index 64c83e88..738a1922 100644 --- a/cpp/LunaHook/LunaHook/engine32/cef.cpp +++ b/cpp/LunaHook/LunaHook/engine32/cef.cpp @@ -194,7 +194,7 @@ bool libcefhook(HMODULE module) hp.address = addr + 4; hp.offset = get_stack(1); hp.filter_fun = ceffileter; - hp.newlineseperator = L"
"; + hp.lineSeparator = L"
"; hp.length_offset = 2; hp.type = USING_STRING | CODEC_UTF16 | NO_CONTEXT; hp.user_value = (DWORD) new std::wstring; diff --git a/cpp/LunaHook/LunaHook/engine32/lucifen.cpp b/cpp/LunaHook/LunaHook/engine32/lucifen.cpp index a7a0ba70..08ba3473 100644 --- a/cpp/LunaHook/LunaHook/engine32/lucifen.cpp +++ b/cpp/LunaHook/LunaHook/engine32/lucifen.cpp @@ -147,8 +147,8 @@ bool attach_navel(ULONG startAddress, ULONG stopAddress) // attach scenario hp.address = addr; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = hookBefore_navel; - hp.hook_after = hookafter_navel; - hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; + hp.embed_fun = hookafter_navel; + hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; return NewHook(hp, "LucifenEmbed"); } namespace @@ -751,8 +751,8 @@ namespace hp.address = addr; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; return NewHook(hp, "EmbedLucifen"); } } // namespace ScenarioHook @@ -950,8 +950,8 @@ namespace hp.address = addr; hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; hp.text_fun = Private::hookBefore; - hp.hook_after = Private::hookafter; - hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; + hp.embed_fun = Private::hookafter; + hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; return NewHook(hp, "lucifen_choice"); } } // namespace ChoiceHook @@ -1016,9 +1016,9 @@ namespace hp.address = addr; hp.offset = get_stack(1); hp.type = EMBED_ABLE | EMBED_DYNA_SJIS | NO_CONTEXT; - hp.hook_after = hookafter; + hp.embed_fun = hookafter; hp.text_fun = hookBefore; - hp.hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; + hp.embed_hook_font = F_GetGlyphOutlineA | F_GetTextExtentPoint32A; return NewHook(hp, "Embedlucifen2"); } } diff --git a/cpp/LunaHook/LunaHook/engine32/utawarerumono.cpp b/cpp/LunaHook/LunaHook/engine32/utawarerumono.cpp index 2dd2647d..eeb5ef9b 100644 --- a/cpp/LunaHook/LunaHook/engine32/utawarerumono.cpp +++ b/cpp/LunaHook/LunaHook/engine32/utawarerumono.cpp @@ -24,7 +24,7 @@ bool utawarerumonoh() return false; HookParam hp; hp.address = addr; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; hp.offset = get_stack(1); hp.type = CODEC_UTF8 | USING_STRING | NO_CONTEXT; ConsoleOutput("utawarerumono"); @@ -46,7 +46,7 @@ bool utawarerumonoh2() hp.address = addr + 2; hp.offset = get_reg(regs::esi); hp.type = CODEC_UTF8 | USING_STRING | NO_CONTEXT; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; ConsoleOutput("utawarerumono %p", addr); succ |= NewHook(hp, "utawarerumono"); } diff --git a/cpp/LunaHook/LunaHook/engine64/CMVS.cpp b/cpp/LunaHook/LunaHook/engine64/CMVS.cpp index 6e715e30..42b60b5c 100644 --- a/cpp/LunaHook/LunaHook/engine64/CMVS.cpp +++ b/cpp/LunaHook/LunaHook/engine64/CMVS.cpp @@ -35,7 +35,7 @@ namespace hp.offset = get_reg(regs::rdx); hp.type = EMBED_ABLE | USING_STRING | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; - hp.hook_font = F_GetGlyphOutlineA; + hp.embed_hook_font = F_GetGlyphOutlineA; res |= NewHook(hp, "EmbedCMVS"); } return res; diff --git a/cpp/LunaHook/LunaHook/engine64/LightVN.cpp b/cpp/LunaHook/LunaHook/engine64/LightVN.cpp index 70e634c9..3a140725 100644 --- a/cpp/LunaHook/LunaHook/engine64/LightVN.cpp +++ b/cpp/LunaHook/LunaHook/engine64/LightVN.cpp @@ -136,7 +136,7 @@ namespace buffer->from(str); }; hp.filter_fun = commonfilter; - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; return NewHook(hp, "Light.VN.16"); } diff --git a/cpp/LunaHook/LunaHook/engine64/UnrealEngine.cpp b/cpp/LunaHook/LunaHook/engine64/UnrealEngine.cpp index 7c5c90d7..df4dff19 100644 --- a/cpp/LunaHook/LunaHook/engine64/UnrealEngine.cpp +++ b/cpp/LunaHook/LunaHook/engine64/UnrealEngine.cpp @@ -30,7 +30,7 @@ bool InsertENTERGRAM() hp.type = USING_STRING | CODEC_UTF16 | NO_CONTEXT; hp.filter_fun = ENTERGRAMfilter; hp.offset = get_reg(regs::rsi); - hp.newlineseperator = L"\\n"; + hp.lineSeparator = L"\\n"; return NewHook(hp, "UnrealEngine"); } bool UnrealEngine::attach_function() diff --git a/cpp/LunaHook/LunaHook/enginecollection32.cpp b/cpp/LunaHook/LunaHook/enginecollection32.cpp index 17b1ceb6..5db97098 100644 --- a/cpp/LunaHook/LunaHook/enginecollection32.cpp +++ b/cpp/LunaHook/LunaHook/enginecollection32.cpp @@ -23,6 +23,7 @@ #include "engine32/PONScripter.h" #include "engine32/Stronger.h" #include "engine32/Fizz.h" +#include "engine32/Aromarie.h" #include "engine32/Ruf.h" #include "engine32/SYSD.h" #include "engine32/Diskdream.h" @@ -412,5 +413,6 @@ std::vector check_engines() new AGE_System, new Cage, new Winters, + new Aromarie, }; } \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.cpp b/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.cpp index 46809dcb..8581e305 100644 --- a/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.cpp +++ b/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.cpp @@ -38,7 +38,7 @@ void commonsolvemonostring(uintptr_t offset, TextBuffer *buffer) buffer->from(sw.value()); } -void unity_ui_string_hook_after(uintptr_t *offset, TextBuffer buff) +void unity_ui_string_embed_fun(uintptr_t *offset, TextBuffer buff) { auto view = buff.viewW(); auto newstring = il2cppfunctions::create_string(view); diff --git a/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.h b/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.h index a233090e..42c0a763 100644 --- a/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.h +++ b/cpp/LunaHook/LunaHook/engines/mono/monoil2cpp.h @@ -1,6 +1,6 @@ #define RESOLVE_IMPORT(name) name = (decltype(name))(GetProcAddress(game_module, #name)) #pragma once void commonsolvemonostring(uintptr_t offset, TextBuffer *buffer); -void unity_ui_string_hook_after(uintptr_t *offset, TextBuffer buff); +void unity_ui_string_embed_fun(uintptr_t *offset, TextBuffer buff); uintptr_t tryfindmonoil2cpp(const char *_dll, const char *_namespace, const char *_class, const char *_method, int paramCoun, bool strict = false); \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engines/python/python.cpp b/cpp/LunaHook/LunaHook/engines/python/python.cpp index de6bed73..a4bab9c6 100644 --- a/cpp/LunaHook/LunaHook/engines/python/python.cpp +++ b/cpp/LunaHook/LunaHook/engines/python/python.cpp @@ -1,6 +1,6 @@ #include "python.h" #include -extern "C" __declspec(dllexport) const wchar_t *internal_renpy_call_host(const wchar_t *text, int split) +extern "C" __declspec(dllexport) const wchar_t *luna_internal_renpy_call_host(const wchar_t *text, int split) { return text; } @@ -21,9 +21,9 @@ bool Luna_checkisusingembed(uint64_t address, uint64_t ctx2, bool usingsplit) } return false; } -extern "C" __declspec(dllexport) bool internal_renpy_call_is_embed_using(int split, bool usingsplit) +extern "C" __declspec(dllexport) bool luna_internal_renpy_call_is_embed_using(int split, bool usingsplit) { - return Luna_checkisusingembed((uint64_t)internal_renpy_call_host, split, usingsplit); + return Luna_checkisusingembed((uint64_t)luna_internal_renpy_call_host, split, usingsplit); } namespace { @@ -62,11 +62,11 @@ namespace void hook_internal_renpy_call_host() { HookParam hp_internal; - hp_internal.address = (uintptr_t)internal_renpy_call_host; + hp_internal.address = (uintptr_t)luna_internal_renpy_call_host; hp_internal.offset = GETARG1; hp_internal.split = GETARG2; - hp_internal.type = USING_SPLIT | USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW | NO_CONTEXT; - NewHook(hp_internal, "internal_renpy_call_host"); + hp_internal.type = USING_SPLIT | USING_STRING | CODEC_UTF16 | EMBED_ABLE | EMBED_AFTER_NEW | NO_CONTEXT; + NewHook(hp_internal, "luna_internal_renpy_call_host"); PyRunScript(LoadResData(L"renpy_hook_text", L"PYSOURCE").c_str()); } @@ -268,7 +268,7 @@ namespace } } -extern "C" __declspec(dllexport) const wchar_t *internal_renpy_get_font() +extern "C" __declspec(dllexport) const wchar_t *luna_internal_renpy_get_font() { if (wcslen(commonsharedmem->fontFamily) == 0) return NULL; diff --git a/cpp/LunaHook/LunaHook/engines/python/python2.cpp b/cpp/LunaHook/LunaHook/engines/python/python2.cpp index 3d6a3662..fd0fc1cd 100644 --- a/cpp/LunaHook/LunaHook/engines/python/python2.cpp +++ b/cpp/LunaHook/LunaHook/engines/python/python2.cpp @@ -95,7 +95,7 @@ bool InsertRenpyHook() if (PyUnicode_FromUnicode) { hp.type |= EMBED_ABLE; - hp.hook_after = [](hook_stack *stack, TextBuffer buffer) + hp.embed_fun = [](hook_stack *stack, TextBuffer buffer) { auto format = (PyObject *)stack->ARG1; if (!format) diff --git a/cpp/LunaHook/LunaHook/engines/python/python3.cpp b/cpp/LunaHook/LunaHook/engines/python/python3.cpp index e558d608..349a0d51 100644 --- a/cpp/LunaHook/LunaHook/engines/python/python3.cpp +++ b/cpp/LunaHook/LunaHook/engines/python/python3.cpp @@ -179,7 +179,7 @@ bool InsertRenpy3Hook() if (PyUnicode_FromKindAndData) { hp.type |= EMBED_ABLE | EMBED_CODEC_UTF16; - hp.hook_after = [](hook_stack *stack, TextBuffer buffer) + hp.embed_fun = [](hook_stack *stack, TextBuffer buffer) { auto format = (PyObject *)stack->rcx; if (!format) diff --git a/cpp/LunaHook/LunaHook/engines/v8/httpserver.cpp b/cpp/LunaHook/LunaHook/engines/v8/httpserver.cpp index 6255108f..6edb6c7c 100644 --- a/cpp/LunaHook/LunaHook/engines/v8/httpserver.cpp +++ b/cpp/LunaHook/LunaHook/engines/v8/httpserver.cpp @@ -128,7 +128,7 @@ auto makeserveronce(int port) HTTP_BINDING_INFO BindingProperty; HTTP_TIMEOUT_LIMIT_INFO CGTimeout; - auto url = std::wstring(L"http://127.0.0.1:") + std::to_wstring(port) + L"/fuck"; + auto url = std::wstring(L"http://127.0.0.1:") + std::to_wstring(port) + L"/sakurakouji"; // // Initialize HTTP APIs. // diff --git a/cpp/LunaHook/LunaHook/engines/v8/v8.cpp b/cpp/LunaHook/LunaHook/engines/v8/v8.cpp index fd896beb..9b1d6f93 100644 --- a/cpp/LunaHook/LunaHook/engines/v8/v8.cpp +++ b/cpp/LunaHook/LunaHook/engines/v8/v8.cpp @@ -59,7 +59,7 @@ namespace parsebefore((wchar_t *)GlobalLock(hClipboardData), hp, split, buffer); GlobalUnlock(hClipboardData); }; - hp.hook_after = [](hook_stack *s, TextBuffer buffer) + hp.embed_fun = [](hook_stack *s, TextBuffer buffer) { std::wstring transwithfont = parseafter(buffer.viewW()); HGLOBAL hClipboardData = GlobalAlloc(GMEM_MOVEABLE, transwithfont.size() * 2 + 2); @@ -82,7 +82,7 @@ namespace { parsebefore((wchar_t *)stack->ARG1, hp, split, buffer); }; - hp.hook_after = [](hook_stack *s, TextBuffer buffer) + hp.embed_fun = [](hook_stack *s, TextBuffer buffer) { std::wstring transwithfont = parseafter(buffer.viewW()); s->ARG1 = (uintptr_t)allocateString(transwithfont); diff --git a/cpp/LunaHook/LunaHook/resource/lunajspatch.js b/cpp/LunaHook/LunaHook/resource/lunajspatch.js index 2f8fec08..078a9b4b 100644 --- a/cpp/LunaHook/LunaHook/resource/lunajspatch.js +++ b/cpp/LunaHook/LunaHook/resource/lunajspatch.js @@ -28,7 +28,7 @@ function cppjsio(name, s_raw, lpsplit, embedable) { s = magicsend + name + '\x03' + lpsplit.toString() + '\x04' + (embedable ? '1' : '0') + '\x02' + s_raw; if (internal_http_port) { var xhr = new XMLHttpRequest(); - var url = 'http://127.0.0.1:' + internal_http_port + '/fuck' + var url = 'http://127.0.0.1:' + internal_http_port + '/sakurakouji' xhr.open('POST', url, false); xhr.send(s); if (xhr.status === 200) { diff --git a/cpp/LunaHook/LunaHook/resource/renpy_hook_font.py b/cpp/LunaHook/LunaHook/resource/renpy_hook_font.py index fbd9b1e7..03e31f1f 100644 --- a/cpp/LunaHook/LunaHook/resource/renpy_hook_font.py +++ b/cpp/LunaHook/LunaHook/resource/renpy_hook_font.py @@ -3,11 +3,15 @@ def callLunaHostFont(): import ctypes try: - internal_renpy_get_font = ctypes.CDLL("LunaHook64").internal_renpy_get_font + luna_internal_renpy_get_font = ctypes.CDLL( + "LunaHook64" + ).luna_internal_renpy_get_font except: - internal_renpy_get_font = ctypes.CDLL("LunaHook32").internal_renpy_get_font - internal_renpy_get_font.restype = ctypes.c_wchar_p - return internal_renpy_get_font() + luna_internal_renpy_get_font = ctypes.CDLL( + "LunaHook32" + ).luna_internal_renpy_get_font + luna_internal_renpy_get_font.restype = ctypes.c_wchar_p + return luna_internal_renpy_get_font() except: return None @@ -17,17 +21,17 @@ def callLunaIsUsingEmbed_nosplit(): import ctypes try: - internal_renpy_call_is_embed_using = ctypes.CDLL( + luna_internal_renpy_call_is_embed_using = ctypes.CDLL( "LunaHook64" - ).internal_renpy_call_is_embed_using + ).luna_internal_renpy_call_is_embed_using except: - internal_renpy_call_is_embed_using = ctypes.CDLL( + luna_internal_renpy_call_is_embed_using = ctypes.CDLL( "LunaHook32" - ).internal_renpy_call_is_embed_using - internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool - internal_renpy_call_is_embed_using.restype = ctypes.c_bool + ).luna_internal_renpy_call_is_embed_using + luna_internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool + luna_internal_renpy_call_is_embed_using.restype = ctypes.c_bool - return internal_renpy_call_is_embed_using(0, False) + return luna_internal_renpy_call_is_embed_using(0, False) except: return False diff --git a/cpp/LunaHook/LunaHook/resource/renpy_hook_text.py b/cpp/LunaHook/LunaHook/resource/renpy_hook_text.py index 54053182..e7393c26 100644 --- a/cpp/LunaHook/LunaHook/resource/renpy_hook_text.py +++ b/cpp/LunaHook/LunaHook/resource/renpy_hook_text.py @@ -3,21 +3,21 @@ def callLunaHost(text, split): import ctypes try: - internal_renpy_call_host = ctypes.CDLL( + luna_internal_renpy_call_host = ctypes.CDLL( "LunaHook64" - ).internal_renpy_call_host + ).luna_internal_renpy_call_host except: - internal_renpy_call_host = ctypes.CDLL( + luna_internal_renpy_call_host = ctypes.CDLL( "LunaHook32" - ).internal_renpy_call_host - internal_renpy_call_host.argstype = ctypes.c_wchar_p, ctypes.c_int - internal_renpy_call_host.restype = ctypes.c_wchar_p + ).luna_internal_renpy_call_host + luna_internal_renpy_call_host.argstype = ctypes.c_wchar_p, ctypes.c_int + luna_internal_renpy_call_host.restype = ctypes.c_wchar_p try: _text = text.decode("utf8") except: _text = text - text = internal_renpy_call_host(_text, split) + text = luna_internal_renpy_call_host(_text, split) except: pass return text @@ -28,17 +28,17 @@ def callLunaIsUsingEmbed(split): import ctypes try: - internal_renpy_call_is_embed_using = ctypes.CDLL( + luna_internal_renpy_call_is_embed_using = ctypes.CDLL( "LunaHook64" - ).internal_renpy_call_is_embed_using + ).luna_internal_renpy_call_is_embed_using except: - internal_renpy_call_is_embed_using = ctypes.CDLL( + luna_internal_renpy_call_is_embed_using = ctypes.CDLL( "LunaHook32" - ).internal_renpy_call_is_embed_using - internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool - internal_renpy_call_is_embed_using.restype = ctypes.c_bool + ).luna_internal_renpy_call_is_embed_using + luna_internal_renpy_call_is_embed_using.argstype = ctypes.c_int, ctypes.c_bool + luna_internal_renpy_call_is_embed_using.restype = ctypes.c_bool - return internal_renpy_call_is_embed_using(split, True) + return luna_internal_renpy_call_is_embed_using(split, True) except: return False diff --git a/cpp/LunaHook/LunaHook/texthook.cc b/cpp/LunaHook/LunaHook/texthook.cc index d390916c..27aed600 100644 --- a/cpp/LunaHook/LunaHook/texthook.cc +++ b/cpp/LunaHook/LunaHook/texthook.cc @@ -396,24 +396,28 @@ void TextHook::Send(uintptr_t lpDataBase) { if (hp.type & EMBED_AFTER_NEW) { - auto _ = new char[max(lpCountsave, buff.size) + 10]; + auto size = max(lpCountsave, buff.size + 1); + auto _ = new char[size]; memcpy(_, buff.buff, buff.size); - for (int i = buff.size; i < max(lpCountsave, buff.size) + 10; i++) - _[i] = 0; + memset(_ + buff.size, 0, size - buff.size); *(uintptr_t *)plpdatain = (uintptr_t)_; } else if (hp.type & EMBED_AFTER_OVERWRITE) { memcpy((void *)lpDataIn, buff.buff, buff.size); - for (int i = buff.size; i < lpCountsave; i++) - ((BYTE *)(lpDataIn))[i] = 0; + auto zeros = 1; + if (hp.type & CODEC_UTF16) + zeros = 2; + else if (hp.type & CODEC_UTF32) + zeros = 4; + memset((char *)lpDataIn + buff.size, 0, max(lpCountsave, zeros)); } - else if (hp.hook_after) - hp.hook_after(stack, buff); + else if (hp.embed_fun) + hp.embed_fun(stack, buff); else if (hp.type & SPECIAL_JIT_STRING) { if (hp.jittype == JITTYPE::UNITY) - unity_ui_string_hook_after(argidx(stack, hp.argidx), buff); + unity_ui_string_embed_fun(argidx(stack, hp.argidx), buff); } } } diff --git a/cpp/LunaHook/LunaHost/CMakeLists.txt b/cpp/LunaHook/LunaHost/CMakeLists.txt index b71cd399..7d5626c1 100644 --- a/cpp/LunaHook/LunaHost/CMakeLists.txt +++ b/cpp/LunaHook/LunaHost/CMakeLists.txt @@ -16,7 +16,7 @@ add_library(host ) target_precompile_headers(host REUSE_FROM pch) target_include_directories(host PUBLIC .) - +target_link_libraries(host VERSION_DEF) add_library(LunaHostDll MODULE LunaHostDll.cpp ${versioninfohost}) target_precompile_headers(LunaHostDll REUSE_FROM pch) diff --git a/cpp/LunaHook/include/const.h b/cpp/LunaHook/include/const.h index ca913d3b..aedcbb27 100644 --- a/cpp/LunaHook/include/const.h +++ b/cpp/LunaHook/include/const.h @@ -1,7 +1,5 @@ #pragma once -#define LUNA_VERSION {VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_REVISION} - enum { STRING = 12, diff --git a/cpp/LunaHook/include/hookcode.cpp b/cpp/LunaHook/include/hookcode.cpp index 0573503e..ce70cb90 100644 --- a/cpp/LunaHook/include/hookcode.cpp +++ b/cpp/LunaHook/include/hookcode.cpp @@ -299,7 +299,7 @@ namespace { HCode += L"E"; - if (hp.hook_after) + if (hp.embed_fun) HCode += L'X'; else { diff --git a/cpp/LunaHook/include/types.h b/cpp/LunaHook/include/types.h index 999ae59d..53bf4cbe 100644 --- a/cpp/LunaHook/include/types.h +++ b/cpp/LunaHook/include/types.h @@ -113,9 +113,9 @@ struct HookParam ALIGNPTR(uint64_t __12, uintptr_t user_value); ALIGNPTR(uint64_t __2, void (*text_fun)(hook_stack *stack, HookParam *hp, TextBuffer *buffer, uintptr_t *split)) ALIGNPTR(uint64_t __3, void (*filter_fun)(TextBuffer *buffer, HookParam *hp)); // jichi 10/24/2014: Add filter function. Return false to skip the text - ALIGNPTR(uint64_t __7, void (*hook_after)(hook_stack *stack, TextBuffer buffer)); - uint64_t hook_font; - ALIGNPTR(uint64_t __9, const wchar_t *newlineseperator); + ALIGNPTR(uint64_t __7, void (*embed_fun)(hook_stack *stack, TextBuffer buffer)); + uint64_t embed_hook_font; + ALIGNPTR(uint64_t __9, const wchar_t *lineSeparator); char name[HOOK_NAME_SIZE]; wchar_t hookcode[HOOKCODE_LEN]; HookParam() diff --git a/cpp/version.cmake b/cpp/version.cmake index 13335144..871d8fcf 100644 --- a/cpp/version.cmake +++ b/cpp/version.cmake @@ -1,10 +1,14 @@ set(VERSION_MAJOR 6) -set(VERSION_MINOR 3) -set(VERSION_PATCH 4) +set(VERSION_MINOR 5) +set(VERSION_PATCH 0) set(VERSION_REVISION 0) -add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR}) -add_definitions(-DVERSION_MINOR=${VERSION_MINOR}) -add_definitions(-DVERSION_PATCH=${VERSION_PATCH}) -add_definitions(-DVERSION_REVISION=${VERSION_REVISION}) +set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}") +add_library(VERSION_DEF INTERFACE) +target_compile_definitions(VERSION_DEF INTERFACE + VERSION_MAJOR=${VERSION_MAJOR} + VERSION_MINOR=${VERSION_MINOR} + VERSION_PATCH=${VERSION_PATCH} + VERSION_REVISION=${VERSION_REVISION} + LUNA_VERSION=${LUNA_VERSION}) include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake) \ No newline at end of file diff --git a/py/LunaTranslator/LunaTranslator_main.py b/py/LunaTranslator/LunaTranslator_main.py index 62693ebd..cf11ab47 100644 --- a/py/LunaTranslator/LunaTranslator_main.py +++ b/py/LunaTranslator/LunaTranslator_main.py @@ -21,10 +21,15 @@ def overridepathexists(): def prepareqtenv(): import windows + from myutils.config import get_platform # win7 no vcredist2015 windows.addenvpath("./files/runtime/") - windows.LoadLibraryW("./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll") + if get_platform() != "xp": + windows.LoadLibraryW("./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll") + else: + windows.addenvpath("./files/runtime/Lib/site-packages/PyQt5") + windows.LoadLibraryW("./files/runtime/Lib/site-packages/PyQt5/Qt5Core.dll") from qtsymbols import QApplication, isqt5, Qt, QFont, QLocale @@ -32,10 +37,15 @@ def prepareqtenv(): if isqt5: # 中文字符下不能自动加载 - plgs = "./files/runtime/PyQt5/Qt5/plugins" + if get_platform() != "xp": + plgs = "./files/runtime/PyQt5/Qt5/plugins" + else: + plgs = "./files/runtime/Lib/site-packages/PyQt5/plugins" + if os.path.exists(plgs): QApplication.addLibraryPath(plgs) - QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling) + if get_platform() != "xp": + QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling) QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseHighDpiPixmaps) if os.path.exists("./files/runtime/PyQt5/Qt5/bin/Qt5WebEngineCore.dll"): # maybe use qwebengine @@ -46,10 +56,10 @@ def prepareqtenv(): QApplication.setAttribute( Qt.ApplicationAttribute.AA_DontCreateNativeWidgetSiblings ) - - QApplication.setHighDpiScaleFactorRoundingPolicy( - Qt.HighDpiScaleFactorRoundingPolicy.PassThrough - ) + if get_platform() != "xp": + QApplication.setHighDpiScaleFactorRoundingPolicy( + Qt.HighDpiScaleFactorRoundingPolicy.PassThrough + ) font = QFont() font.setStyleStrategy(QFont.StyleStrategy.PreferAntialias) font.setHintingPreference(QFont.HintingPreference.PreferFullHinting) diff --git a/py/LunaTranslator/gui/setting_cishu.py b/py/LunaTranslator/gui/setting_cishu.py index a8268a3c..4782fa71 100644 --- a/py/LunaTranslator/gui/setting_cishu.py +++ b/py/LunaTranslator/gui/setting_cishu.py @@ -1,7 +1,7 @@ import functools, os import gobject from myutils.utils import splitocrtypes -from myutils.config import globalconfig, _TR +from myutils.config import globalconfig, _TR, get_platform from gui.inputdialog import multicolorset, autoinitdialog from gui.inputdialog import autoinitdialog, autoinitdialog_items from gui.usefulwidget import ( @@ -96,6 +96,9 @@ def _checkmaybefailed(self, idx): def _createseletengeinecombo_1(self): webviews = ["MSHTML", "WebView2", "QWebEngine"] + + if get_platform() == "xp": + webviews = ["MSHTML"] self.seletengeinecombo_1 = getsimplecombobox( webviews, globalconfig, diff --git a/py/LunaTranslator/gui/setting_display.py b/py/LunaTranslator/gui/setting_display.py index db8ecb3c..f8560de5 100644 --- a/py/LunaTranslator/gui/setting_display.py +++ b/py/LunaTranslator/gui/setting_display.py @@ -5,18 +5,23 @@ from gui.setting_display_text import xianshigrid_style from gui.setting_display_ui import uisetting from gui.setting_display_scale import makescalew from gui.usefulwidget import makesubtab_lazy, makescrollgrid +from myutils.config import get_platform def setTabThree_lazy(self, basel): - + titles = ["文本设置", "界面设置", "工具按钮", "窗口缩放"] + funcs = [ + lambda l: makescrollgrid(xianshigrid_style(self), l), + functools.partial(uisetting, self), + functools.partial(createbuttonwidget, self), + functools.partial(makescalew, self), + ] + if get_platform() == "xp": + titles.pop(3) + funcs.pop(3) tab, do = makesubtab_lazy( - ["文本设置", "界面设置", "工具按钮", "窗口缩放"], - [ - lambda l: makescrollgrid(xianshigrid_style(self), l), - functools.partial(uisetting, self), - functools.partial(createbuttonwidget, self), - functools.partial(makescalew, self), - ], + titles, + funcs, delay=True, ) diff --git a/py/LunaTranslator/gui/setting_display_text.py b/py/LunaTranslator/gui/setting_display_text.py index 1634c433..5ba749cb 100644 --- a/py/LunaTranslator/gui/setting_display_text.py +++ b/py/LunaTranslator/gui/setting_display_text.py @@ -1,7 +1,7 @@ from qtsymbols import * import functools, platform import gobject, os, zipfile -from myutils.config import globalconfig, static_data, _TR +from myutils.config import globalconfig, static_data, _TR, get_platform from gui.inputdialog import autoinitdialog from myutils.wrapper import tryprint from myutils.utils import dynamiclink, translate_exits, copytree, getannotatedapiname @@ -296,6 +296,9 @@ def _createseletengeinecombo(self): visengine = ["Qt", "Webview2"] visengine_internal = ["textbrowser", "webview"] + if get_platform() == "xp": + visengine.pop(1) + visengine_internal.pop(1) self.seletengeinecombo = getsimplecombobox( visengine, globalconfig, diff --git a/py/LunaTranslator/gui/setting_proxy.py b/py/LunaTranslator/gui/setting_proxy.py index 93dbcbda..11f0293d 100644 --- a/py/LunaTranslator/gui/setting_proxy.py +++ b/py/LunaTranslator/gui/setting_proxy.py @@ -1,12 +1,11 @@ from qtsymbols import * import os, functools, re -from myutils.config import globalconfig +from myutils.config import globalconfig, get_platform from myutils.utils import splittranslatortypes, translate_exits from gui.usefulwidget import ( D_getsimpleswitch, makegrid, makesubtab_lazy, - LGroupBox, makescrollgrid, D_getsimplecombobox, ) @@ -128,28 +127,32 @@ def makeproxytab(): l=globalconfig["update"], item="update", ) - + titles = [ + "在线翻译", + "注册在线翻译", + "OCR", + "语音合成", + "辞书", + "元数据", + "离线翻译", + "自动更新", + ] + funcs = [ + functools.partial(makegridW, mianfei), + functools.partial(makegridW, shoufei), + functools.partial(makegridW, ocrs), + functools.partial(makegridW, readers), + functools.partial(makegridW, cishus), + functools.partial(makegridW, meta), + functools.partial(makegridW, lixians), + functools.partial(makegridW, github), + ] + if get_platform() == "xp": + titles.pop(2) + funcs.pop(2) tab, dotab = makesubtab_lazy( - [ - "在线翻译", - "注册在线翻译", - "OCR", - "语音合成", - "辞书", - "元数据", - "离线翻译", - "自动更新", - ], - [ - functools.partial(makegridW, mianfei), - functools.partial(makegridW, shoufei), - functools.partial(makegridW, ocrs), - functools.partial(makegridW, readers), - functools.partial(makegridW, cishus), - functools.partial(makegridW, meta), - functools.partial(makegridW, lixians), - functools.partial(makegridW, github), - ], + titles, + funcs, delay=True, ) dotab() @@ -157,42 +160,42 @@ def makeproxytab(): def setTab_proxy(self, l): - grids = [ - [ - ( - dict( - title="网络请求", - type="grid", - grid=[ - [ - "HTTP", - ( - D_getsimplecombobox( - ["winhttp", "libcurl"], - globalconfig, - "network", - static=True, - ), - 5, + grids1 = [ + ( + dict( + title="网络请求", + type="grid", + grid=[ + [ + "HTTP", + ( + D_getsimplecombobox( + ["winhttp", "libcurl"], + globalconfig, + "network", + static=True, ), - "", - "WebSocket", - ( - D_getsimplecombobox( - ["winhttp", "libcurl"], - globalconfig, - "network_websocket", - static=True, - ), - 5, + 5, + ), + "", + "WebSocket", + ( + D_getsimplecombobox( + ["winhttp", "libcurl"], + globalconfig, + "network_websocket", + static=True, ), - ], + 5, + ), ], - ), - 0, - "group", - ) - ], + ], + ), + 0, + "group", + ) + ] + grids = [ [ ( dict( @@ -239,4 +242,6 @@ def setTab_proxy(self, l): ) ], ] + if get_platform() != "xp": + grids.insert(0, grids1) makescrollgrid(grids, l) diff --git a/py/LunaTranslator/gui/setting_textinput.py b/py/LunaTranslator/gui/setting_textinput.py index 65f187bc..4bf4f88f 100644 --- a/py/LunaTranslator/gui/setting_textinput.py +++ b/py/LunaTranslator/gui/setting_textinput.py @@ -9,6 +9,7 @@ from myutils.config import ( get_launchpath, savehook_new_list, static_data, + get_platform, ) from traceback import print_exc @@ -280,6 +281,8 @@ def selectgameuid(self): button.button(QDialogButtonBox.StandardButton.Ok).setText(_TR("确定")) button.button(QDialogButtonBox.StandardButton.Cancel).setText(_TR("取消")) if dialog.exec(): + if not _internal: + return None return _internal[combo.currentIndex()] @@ -642,6 +645,8 @@ def setTabOne_lazy(self, basel: QVBoxLayout): ("ocr", "OCR"), ("copy", "剪贴板"), ] + if get_platform() == "xp": + _rank.pop(1) __ = [] for key, name in _rank: __.append(getsmalllabel(name)) @@ -681,15 +686,21 @@ def setTabOne_lazy(self, basel: QVBoxLayout): ] gridlayoutwidget, do = makegrid(tab1grids, delay=True) basel.addWidget(gridlayoutwidget) + titles = ["HOOK设置", "OCR设置", "剪贴板", "文本输出", "其他"] + funcs = [ + lambda l: setTabOne_lazy_h(self, l), + lambda l: getocrgrid_table(self, l), + lambda l: makescrollgrid(getTabclip(self), l), + lambda l: makescrollgrid(outputgrid(self), l), + lambda l: makescrollgrid(filetranslate(self), l), + ] + + if get_platform() == "xp": + titles.pop(1) + funcs.pop(1) tab, dotab = makesubtab_lazy( - ["HOOK设置", "OCR设置", "剪贴板", "文本输出", "其他"], - [ - lambda l: setTabOne_lazy_h(self, l), - lambda l: getocrgrid_table(self, l), - lambda l: makescrollgrid(getTabclip(self), l), - lambda l: makescrollgrid(outputgrid(self), l), - lambda l: makescrollgrid(filetranslate(self), l), - ], + titles, + funcs, delay=True, ) basel.addWidget(tab) diff --git a/py/LunaTranslator/hiraparse/mecab.py b/py/LunaTranslator/hiraparse/mecab.py index 33d61a88..3d01f38c 100644 --- a/py/LunaTranslator/hiraparse/mecab.py +++ b/py/LunaTranslator/hiraparse/mecab.py @@ -109,10 +109,13 @@ class mecab(basehira): # print(node.feature) if "-" in origorig: try: - hira_ = origorig.split("-")[1] - if isascii(hira): # 腰を引いて-->引く-他動詞 - hira = hira_ - origorig = origorig.split("-")[0] + maybe_english = origorig.split("-")[1] + if isascii(maybe_english): + # コンビニを --> コンビニ-convenience + hira = origorig = maybe_english + else: + # 腰を引いて --> 引く-他動詞 + origorig = origorig.split("-")[0] except: pass diff --git a/py/generate_xp_code.py b/py/generate_xp_code.py index 214c1ede..c8d142cf 100644 --- a/py/generate_xp_code.py +++ b/py/generate_xp_code.py @@ -3,24 +3,7 @@ import os, re def parsecode(code: str): # PyQt - code = code.replace( - "QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)", "" - ) - code = code.replace("QApplication.setHighDpiScaleFactorRoundingPolicy", "print") - code = code.replace("Qt.HighDpiScaleFactorRoundingPolicy.PassThrough", "") code = code.replace("self.screen().geometry().height()", "99999") - code = code.replace( - '"./files/runtime/PyQt5/Qt5/plugins"', - '"./files/runtime/Lib/site-packages/PyQt5/plugins"', - ) - code = code.replace( - "./files/runtime/PyQt5/Qt5/bin/Qt5Core.dll", - "./files/runtime/Lib/site-packages/PyQt5/Qt5Core.dll", - ) - code = code.replace( - ' windows.addenvpath("./files/runtime/")', - ' windows.addenvpath("./files/runtime/")\n windows.addenvpath("./files/runtime/Lib/site-packages/PyQt5")', - ) code = code.replace("self.parent().devicePixelRatioF()", "1") code = code.replace("self.devicePixelRatioF()", "1") code = re.sub(