diff --git a/cpp/LunaHook/LunaHook/CMakeLists.txt b/cpp/LunaHook/LunaHook/CMakeLists.txt index 7279ba80..02e0544a 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 BunBun antique 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(enginessrc DAC BunBun antique 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/DAC.cpp b/cpp/LunaHook/LunaHook/engine32/DAC.cpp new file mode 100644 index 00000000..8ab53425 --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/DAC.cpp @@ -0,0 +1,46 @@ +#include "DAC.h" + +bool DAC::attach_function() +{ // https://vndb.org/v11673 + const uint8_t bytes[] = { + 0x80, 0x3f, 0x60, + 0x75, XX, + 0x80, 0x7f, 0x01, 0x23, + 0x75, XX, + 0x6a, 0x60, + 0x6a, 0x60, + 0x57, + 0xe8, XX4}; + ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress); + if (!addr) + return false; + addr = MemDbg::findEnclosingAlignedFunction(addr); + if (!addr) + return false; + HookParam hp; + hp.address = 0x431040; + hp.offset = stackoffset(2); + hp.type = USING_STRING; + hp.user_value = (DWORD) new std::map; + hp.text_fun = [](hook_context *context, HookParam *hp, TextBuffer *buffer, uintptr_t *split) + { + auto mp = ((std::map *)hp->user_value); + if (mp->find(context->retaddr) == mp->end()) + mp->insert({context->retaddr, ""}); + auto &&thisthread = mp->at(context->retaddr); + + std::string s = (char *)context->stack[2]; + s = strSplit(s, "\n")[0]; + if (endWith(thisthread, s)) + ; + else + { + thisthread = s; + strReplace(s, "`#`{$$lines}", ""); + strReplace(s, "\n", ""); + strReplace(s, "\r", ""); + buffer->from(s); + } + }; + return NewHook(hp, "DAC"); +} \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/engine32/DAC.h b/cpp/LunaHook/LunaHook/engine32/DAC.h new file mode 100644 index 00000000..1f2ff46c --- /dev/null +++ b/cpp/LunaHook/LunaHook/engine32/DAC.h @@ -0,0 +1,15 @@ + + +class DAC : public ENGINE +{ +public: + DAC() + { + check_by = CHECK_BY::CUSTOM; + check_by_target = []() + { + return Util::CheckFile(L"*.dpk") && Util::SearchResourceString(L"DAC"); + }; + }; + bool attach_function(); +}; \ No newline at end of file diff --git a/cpp/LunaHook/LunaHook/enginecollection32.cpp b/cpp/LunaHook/LunaHook/enginecollection32.cpp index 591e82df..83527a4e 100644 --- a/cpp/LunaHook/LunaHook/enginecollection32.cpp +++ b/cpp/LunaHook/LunaHook/enginecollection32.cpp @@ -182,6 +182,7 @@ #include "engine32/Ciel.h" #include "engine32/CisLugI.h" #include "engine32/A98SYS.h" +#include "engine32/DAC.h" #include "engine32/ACTGS.h" #include "engine32/GuruGuruSMF4.h" #include "NoEngine.h" @@ -422,5 +423,6 @@ std::vector check_engines() new Moonstone, new T2U, new antique, - new BunBun}; + new BunBun, + new DAC}; } \ No newline at end of file