This commit is contained in:
恍兮惚兮 2024-10-30 11:13:55 +08:00
parent 7876390246
commit d3a6a81def
4 changed files with 95 additions and 1 deletions

View File

@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(enginepath "engine64")
set(collector "enginecollection64.cpp")
else()
set(enginessrc 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 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()

View File

@ -0,0 +1,78 @@
#include "Cage.h"
bool Cage::attach_function()
{
// https://vndb.org/v8381
// 夢姿 ~ゆめのすがた~
/*
size_t __cdecl _mbslen(const unsigned __int8 *String)
{
const unsigned __int8 *v2; // eax
size_t i; // esi
if ( !dword_476AFC )
return strlen((const char *)String);
_lock(25);
v2 = String;
for ( i = 0; *v2; ++i )
{
if ( (byte_476C01[*v2] & 4) != 0 && !*++v2 )
break;
++v2;
}
_unlock(25);
return i;
}
*/
/*
.text:00451B0C mov eax, [esp+8+String]
.text:00451B10 pop ecx
.text:00451B11 xor esi, esi
.text:00451B13
.text:00451B13 loc_451B13: ; CODE XREF: __mbslen+3Dj
.text:00451B13 mov cl, [eax]
.text:00451B15 test cl, cl
.text:00451B17 jz short loc_451B2F
.text:00451B19 movzx ecx, cl
.text:00451B1C test byte_476C01[ecx], 4
.text:00451B23 jz short loc_451B2B
.text:00451B25 inc eax
.text:00451B26 cmp byte ptr [eax], 0
.text:00451B29 jz short loc_451B2F
.text:00451B2B
.text:00451B2B loc_451B2B: ; CODE XREF: __mbslen+33j
.text:00451B2B inc esi
.text:00451B2C inc eax
.text:00451B2D jmp short loc_451B13
*/
BYTE check[] = {
//clang-format off
0x8B, 0x44, 0x24, 0x0C,
0x59,
0x33, 0xF6,
0x8A, 0x08,
0x84, 0xC9,
0x74, 0x16,
0x0F, 0xB6, 0xC9,
0xF6, 0x81, XX4, 0x04,
0x74, 0x06,
0x40,
0x80, 0x38, 0x00,
0x74, 0x04,
0x46,
0x40,
0xEB, 0xE4
//clang-format on
};
auto addrx = MemDbg::findBytes(check, sizeof(check), processStartAddress, processStopAddress);
if (!addrx)
return false;
addrx = MemDbg::findEnclosingAlignedFunction(addrx);
if (!addrx)
return 0;
HookParam hp;
hp.address = addrx;
hp.type = USING_STRING;
hp.offset = get_stack(1);
return NewHook(hp, "Cage");
}

14
LunaHook/engine32/Cage.h Normal file
View File

@ -0,0 +1,14 @@
class Cage : public ENGINE
{
public:
Cage()
{
// https://vndb.org/v8381
// 夢姿 ~ゆめのすがた~
check_by = CHECK_BY::FILE_ALL;
check_by_target = check_by_list{L"script.msb", L"data*.ym"};
};
bool attach_function();
};

View File

@ -9,6 +9,7 @@
#include "engine32/Tarte.h"
#include "engine32/sakanagl.h"
#include "engine32/LCScript.h"
#include "engine32/Cage.h"
#include "engine32/ONScripterru.h"
#include "engine32/CoffeeMaker.h"
#include "engine32/TACTICS.h"
@ -410,5 +411,6 @@ std::vector<ENGINE *> check_engines()
new Aisystem6,
new AksysGames,
new AGE_System,
new Cage,
};
}