This commit is contained in:
恍兮惚兮 2024-09-02 08:23:44 +08:00
parent d7afd866fe
commit 34dcc3755b
4 changed files with 87 additions and 2 deletions

View File

@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(enginepath "engine64")
set(collector "enginecollection64.cpp")
else()
set(enginessrc 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 Unknown 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 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 Unknown 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,69 @@
#include "Onscripter.h"
namespace
{
// Monster Girl Quest Remastered
bool hook()
{
auto SDL_PushEvent = GetProcAddress(GetModuleHandle(0), "SDL_PushEvent");
if (!SDL_PushEvent)
return false;
BYTE bytes[] = {
0x8D, 0x45, 0xE8,
0x50,
0xC6, 0x45, 0xE8, 0x1D,
0xE8, XX4};
for (auto addr : Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress))
{
addr += sizeof(bytes) - 5;
auto check = *(DWORD *)(addr + 1) + addr + 5;
if (check != (DWORD)SDL_PushEvent)
continue;
HookParam hp;
hp.address = addr;
hp.offset = get_reg(regs::ebx);
hp.type = USING_CHAR | DATA_INDIRECT | NO_CONTEXT; // 快的和慢的分别一支。慢的快进会被截断
return NewHook(hp, "onscripter");
}
return false;
}
bool hook2()
{
BYTE bytes[] = {
//clang-format off
0x8b, 0xbe, XX2, 0x00, 0x00,
0x80, 0x3c, 0x07, 0x00,
0x8d, 0x1c, 0x07,
0x75, XX,
0x8b, 0xce,
0xe8, XX4,
//clang-format on
};
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
if (!addr)
return false;
HookParam hp;
hp.address = addr;
hp.offset = get_reg(regs::eax);
hp.type = USING_STRING | CODEC_UTF8;
hp.filter_fun = [](LPVOID data, size_t *size, HookParam *)
{
auto xx = std::string((char *)data, *size);
static std::string last;
if (xx == last)
return false;
last = xx;
strReplace(xx, "@", "");
strReplace(xx, "\\", "");
strReplace(xx, "_", "\n");
strReplace(xx, "/", "");
// # ( ) < 代码里但C了一会儿没遇到不管了先
return write_string_overwrite(data, size, xx);
};
return NewHook(hp, "onscripter");
}
}
bool Onscripter::attach_function()
{
return hook2() || hook();
}

View File

@ -0,0 +1,14 @@
class Onscripter : public ENGINE
{
public:
Onscripter()
{
check_by = CHECK_BY::FILE;
check_by_target = L"arc.nsa";
is_engine_certain = false;
};
bool attach_function();
};

View File

@ -103,6 +103,7 @@
#include "engine32/EME.h"
#include "engine32/RRE.h"
#include "engine32/Sceplay.h"
#include "engine32/Onscripter.h"
#include "engine32/Candy.h"
#include "engine32/AIL2.h"
#include "engine32/ApricoT.h"
@ -394,6 +395,7 @@ std::vector<ENGINE *> check_engines()
//
new DISCOVERY,
new RPGMakerRGSS300,
new Sceplay
new Sceplay,
new Onscripter,
};
}