From 4866e996d22eccb3a7b7f74792ecaa8bd7e36fb7 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: Sat, 7 Dec 2024 14:41:42 +0800 Subject: [PATCH] . --- cpp/LunaHook/LunaHook/CMakeLists.txt | 2 +- .../LunaHook/engine32/{AIL2.cpp => AIL.cpp} | 49 +++++++++++++++++-- cpp/LunaHook/LunaHook/engine32/AIL.h | 19 +++++++ cpp/LunaHook/LunaHook/engine32/AIL2.h | 13 ----- cpp/LunaHook/LunaHook/enginecollection32.cpp | 7 ++- cpp/version.cmake | 2 +- 6 files changed, 69 insertions(+), 23 deletions(-) rename cpp/LunaHook/LunaHook/engine32/{AIL2.cpp => AIL.cpp} (50%) create mode 100644 cpp/LunaHook/LunaHook/engine32/AIL.h delete mode 100644 cpp/LunaHook/LunaHook/engine32/AIL2.h diff --git a/cpp/LunaHook/LunaHook/CMakeLists.txt b/cpp/LunaHook/LunaHook/CMakeLists.txt index 845aad3c..17084b3b 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 T2U Moonstone 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(enginessrc T2U Moonstone 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 AIL 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/AIL2.cpp b/cpp/LunaHook/LunaHook/engine32/AIL.cpp similarity index 50% rename from cpp/LunaHook/LunaHook/engine32/AIL2.cpp rename to cpp/LunaHook/LunaHook/engine32/AIL.cpp index 53d0a6d9..69ccf9be 100644 --- a/cpp/LunaHook/LunaHook/engine32/AIL2.cpp +++ b/cpp/LunaHook/LunaHook/engine32/AIL.cpp @@ -1,4 +1,4 @@ -#include "AIL2.h" +#include "AIL.h" bool InsertAIL2Hook() { auto findalign = [](uintptr_t addr1) @@ -55,9 +55,50 @@ bool InsertAIL2Hook() return succ; } -bool AIL2::attach_function() +bool AILold() { - // アイル + // https://vndb.org/v6409 + // エルフィーナ~淫夜へと売られた王国で…~ + // 其实这个同一个函数里面也有 cmp al, 66h; 'f'这个pattern,不过不太一样。懒得分了就这样吧。 + BYTE bytes1[] = { + /* + .text:00431E87 mov edx, dword_4AD54C + .text:00431E8D test edx, edx + .text:00431E8F jnz loc_4326E0 ; jumptable 00431EB0 case 0 + .text:00431E95 mov edx, [esp+3Ch+lpString] + .text:00431E99 mov dl, [edi+edx] + .text:00431E9C movsx esi, dl + .text:00431E9F cmp esi, 40h ; switch 65 cases + .text:00431EA2 ja def_431EB0 ; jumptable 00431EB0 default case, cases 1-34,38-42,44,46-63 + .text:00431EA8 xor ebx, ebx + .text:00431EAA mov bl, ds:byte_43270C[esi] + .text:00431EB0 jmp ds:jpt_431EB0[ebx*4] ; switch jump + */ + 0x8b, 0x54, 0x24, XX, + 0x8a, 0x14, 0x17, + 0x0f, 0xbe, 0xf2, + 0x83, 0xfe, 0x40, + 0x0f, 0x87, XX4, + 0x33, 0xdb, + 0x8a, 0x9e, XX4, + 0xff, 0x24, 0x9d, XX4}; + auto addr1 = MemDbg::findBytes(bytes1, sizeof(bytes1), processStartAddress, processStopAddress); + if (!addr1) + return false; + addr1 = MemDbg::findEnclosingAlignedFunction(addr1); + if (!addr1) + return false; + HookParam hp; + hp.address = addr1; + hp.offset = get_stack(3); + hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_DYNA_SJIS; + hp.embed_hook_font = F_TextOutA; - return InsertAIL2Hook(); + return NewHook(hp, "AIL"); +} + +bool AIL::attach_function() +{ + + return InsertAIL2Hook() || AILold(); } \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/AIL.h b/cpp/LunaHook/LunaHook/engine32/AIL.h new file mode 100644 index 00000000..cf5800cc --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/AIL.h @@ -0,0 +1,19 @@ + + +class AIL : public ENGINE +{ +public: + AIL() + { + + check_by = CHECK_BY::CUSTOM; + check_by_target = []() + { + auto _ = {L"*.wa", L"Gall*.da", L"Pall*.da", L"vall*.da", L"sall.sn", L"help/*.ht"}; + auto old = std::all_of(_.begin(), _.end(), Util::CheckFile); + auto _2 = Util::CheckFile(L"Gall*.dat"); + return old | _2; + }; + }; + bool attach_function(); +}; \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/AIL2.h b/cpp/LunaHook/LunaHook/engine32/AIL2.h deleted file mode 100644 index 846794e9..00000000 --- a/cpp/LunaHook/LunaHook/engine32/AIL2.h +++ /dev/null @@ -1,13 +0,0 @@ - - -class AIL2 : public ENGINE -{ -public: - AIL2() - { - - check_by = CHECK_BY::FILE; - check_by_target = L"Gall*.dat"; - }; - bool attach_function(); -}; \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/enginecollection32.cpp b/cpp/LunaHook/LunaHook/enginecollection32.cpp index 4ebb2246..9cdedea2 100644 --- a/cpp/LunaHook/LunaHook/enginecollection32.cpp +++ b/cpp/LunaHook/LunaHook/enginecollection32.cpp @@ -114,7 +114,7 @@ #include "engine32/Sceplay.h" #include "engine32/Onscripter.h" #include "engine32/Candy.h" -#include "engine32/AIL2.h" +#include "engine32/AIL.h" #include "engine32/ApricoT.h" #include "engine32/Triangle.h" #include "engine32/GASTRO.h" @@ -253,7 +253,7 @@ std::vector check_engines() new RRE, new Candy, new WillowSoft, - new AIL2, + new AIL, new ApricoT, new Triangle2, new Triangle, @@ -418,6 +418,5 @@ std::vector check_engines() new Winters, new Aromarie, new Moonstone, - new T2U, - }; + new T2U}; } \ No newline at end of file diff --git a/cpp/version.cmake b/cpp/version.cmake index cf5cafdf..4283d0ea 100644 --- a/cpp/version.cmake +++ b/cpp/version.cmake @@ -1,7 +1,7 @@ set(VERSION_MAJOR 6) set(VERSION_MINOR 10) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION_REVISION 0) set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}") add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)