From 2effab99c4221654e52fd3b8f8e9e322b3f488c4 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: Mon, 11 Nov 2024 23:11:55 +0800 Subject: [PATCH] winters --- cpp/LunaHook/LunaHook/CMakeLists.txt | 2 +- cpp/LunaHook/LunaHook/engine32/Winters.cpp | 33 ++++++++++++++++++++ cpp/LunaHook/LunaHook/engine32/Winters.h | 12 +++++++ cpp/LunaHook/LunaHook/enginecollection32.cpp | 2 ++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 cpp/LunaHook/LunaHook/engine32/Winters.cpp create mode 100644 cpp/LunaHook/LunaHook/engine32/Winters.h diff --git a/cpp/LunaHook/LunaHook/CMakeLists.txt b/cpp/LunaHook/LunaHook/CMakeLists.txt index 1a8ac978..3f69da64 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 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 pchooks 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 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 pchooks 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() diff --git a/cpp/LunaHook/LunaHook/engine32/Winters.cpp b/cpp/LunaHook/LunaHook/engine32/Winters.cpp new file mode 100644 index 00000000..a958cf18 --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/Winters.cpp @@ -0,0 +1,33 @@ +#include "Winters.h" + +bool Winters::attach_function() +{ + // こんな魔法少女…アタシはレミィ + // https://vndb.org/v11018 + const BYTE bytes[] = { + 0x4a, + 0x8b, 0xda, + 0xc1, 0xe3, 0x02, + 0x8d, 0x1c, 0x9b, + 0x8b, 0xcb, + 0x83, 0xc1, 0x11, + 0xba, 0x19, 0x00, 0x00, 0x00, + 0xe8, XX4}; + ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress); + if (!addr) + return false; + auto off = *(DWORD *)(addr + sizeof(bytes) - 4); + auto target = off + addr + sizeof(bytes); + HookParam hp; + hp.address = target; + hp.offset = get_stack(1); + hp.type = USING_STRING; + hp.filter_fun = [](TextBuffer *buffer, HookParam *) + { + static int idx = 0; + if ((idx++) % 2) + buffer->clear(); + }; + + return NewHook(hp, "Winters"); +} \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/Winters.h b/cpp/LunaHook/LunaHook/engine32/Winters.h new file mode 100644 index 00000000..f82589e7 --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/Winters.h @@ -0,0 +1,12 @@ + + +class Winters : public ENGINE +{ +public: + Winters() + { + check_by = CHECK_BY::FILE_ALL; + check_by_target = check_by_list{L"MSG.dat", L"SCR.ifx", L"VFN.dat", L"GRP.ifx"}; + }; + bool attach_function(); +}; \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/enginecollection32.cpp b/cpp/LunaHook/LunaHook/enginecollection32.cpp index 797b9791..741def4f 100644 --- a/cpp/LunaHook/LunaHook/enginecollection32.cpp +++ b/cpp/LunaHook/LunaHook/enginecollection32.cpp @@ -11,6 +11,7 @@ #include "engine32/LCScript.h" #include "engine32/Cage.h" #include "engine32/ONScripterru.h" +#include "engine32/Winters.h" #include "engine32/CoffeeMaker.h" #include "engine32/TACTICS.h" #include "engine32/splushwave.h" @@ -412,5 +413,6 @@ std::vector check_engines() new AksysGames, new AGE_System, new Cage, + new Winters }; } \ No newline at end of file