This commit is contained in:
恍兮惚兮 2024-09-07 21:34:41 +08:00
parent 100ed89542
commit 06f134e87a
5 changed files with 213 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 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(enginessrc 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 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,169 @@
#include "TACTICS.h"
// 鈴がうたう日
// https://vndb.org/v8528
/*
__int16 sub_40488C()
{
UINT v0; // ebx
if ( !word_4ABF8E )
{
word_4ABF8E = 1;
word_4ABF88 = strlen(&Str) + 1;
word_4ABF8A = 0;
word_4ABF8C = 0;
dword_43ACE4 = 0;
}
LABEL_35:
while ( word_4ABF8E < word_4ABF88 )
{
if ( IsDBCSLeadByteEx(0, *(&Str + word_4ABF8E)) )
{
v0 = (unsigned __int8)byte_4ABB89[word_4ABF8E] + ((unsigned __int8)*(&Str + word_4ABF8E) << 8);
word_4ABF8E += 2;
}
else
{
v0 = *(&Str + word_4ABF8E++);
}
switch ( v0 )
{
case 0u:
if ( !dword_43ACE4 )
sub_401334(v0);
return 3;
case 1u:
word_4ABF8A = word_4ABF8C;
word_4ABF90 = word_438956 + 19 * word_4ABF8C;
word_4ABF92 += 28;
goto LABEL_35;
case 2u:
sub_4012B4(v0);
sub_4150CC(&unk_48966C, 50);
word_4ABF90 = word_438956;
word_4ABF92 = 343;
goto LABEL_35;
case 3u:
goto LABEL_35;
case 4u:
dword_43ACE4 = 1;
goto LABEL_35;
case 5u:
sub_401334(v0);
dword_43ACE4 = 1;
goto LABEL_35;
case 0x11u:
strcpy(byte_4ABD88, &Str + word_4ABF8E);
strcat(&Str, byte_4ABD88);
word_4ABF88 = strlen(&Str) + 1;
goto LABEL_35;
default:
if ( v0 == 33141 || v0 == 33156 )
word_4ABF8C = word_4ABF8A + 1;
if ( v0 == 33142 || v0 == 33156 )
{
word_4ABF8C = 0;
dword_43ACDC = 0;
}
if ( v0 == 33155 )
v0 = 33129;
if ( v0 == 33156 )
v0 = 33130;
if ( word_438958 >= ++word_4ABF8A )
goto LABEL_34;
if ( (unsigned __int16)v0 > 0x816Au )
{
if ( (unsigned __int16)v0 != 33142 && (unsigned __int16)v0 != 33144 )
{
LABEL_33:
word_4ABF8A = word_4ABF8C + 1;
word_4ABF90 = word_438956 + 19 * word_4ABF8C;
word_4ABF92 += 28;
}
}
else if ( (unsigned __int16)v0 != 33130
&& (unsigned __int16)v0 != 41
&& (unsigned int)(unsigned __int16)v0 - 33089 >= 2 )
{
goto LABEL_33;
}
LABEL_34:
sub_4155DC((int)&unk_4BC804, dword_47D52C, word_4ABF90, word_4ABF92, v0, 1);
sub_4155DC((int)&unk_4BC804, dword_48967C, word_4ABF90 - 45, word_4ABF92 - 322, v0, 1);
word_4ABF90 += 19;
break;
}
}
return 0;
}
*/
bool TACTICSattach_function1()
{
BYTE sig[] = {
0x0f, 0xbf, 0x05, XX4,
0X33, 0XD2,
0X8A, 0x98, XX4,
0x80, 0xe3, 0xff,
0x8a, 0x80, XX4,
0x81, 0xe3, 0xff, 0x00, 0x00, 0x00,
0x24, 0xff,
0xc1, 0xe3, 0x08,
0x8a, 0xd0,
0x03, 0xda,
0x66, 0x83, 0x05, XX4, 0x02,
0xeb, 0x15,
0x0f, 0xbf, 0x0d, XX4,
0x0f, 0xbe, 0x99, XX4,
0x66, 0xff, 0x05, XX4};
auto addr = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress);
if (!addr)
return false;
addr = addr + 7 + 2 + 6 + 3 + 2;
HookParam hp;
hp.address = *(DWORD *)addr;
hp.type = USING_STRING | DIRECT_READ;
hp.filter_fun = [](void *data, size_t *len, HookParam *hp)
{
CharFilter((char *)data, len, 1);
CharFilter((char *)data, len, 2);
CharFilter((char *)data, len, 3);
CharFilter((char *)data, len, 4);
CharFilter((char *)data, len, 5);
CharFilter((char *)data, len, 0x11);
return true;
};
return NewHook(hp, "TACTICS_R");
}
bool TACTICSattach_function2()
{
BYTE sig[] = {
// clang-format off
0x2d,0x40,0x81,0x00,0x00,
0x89,0x83,XX,0x00,0x00,0x00,
0x3d,0x57,0x02,0x00,0x00,
0x0f,0x82,XX4,
0xbf,0x57,0x02,0x00,0x00,
// clang-format on
};
auto addr = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress);
if (!addr)
return false;
HookParam hp;
hp.address = addr;
hp.type = USING_CHAR | CODEC_ANSI_BE;
hp.offset = get_reg(regs::eax);
hp.filter_fun = [](void *data, size_t *len, HookParam *hp)
{
static int idx = 0;
return 0 == ((idx++) % 2);
};
return NewHook(hp, "TACTICS_H");
}
bool TACTICS::attach_function()
{
return TACTICSattach_function1() | TACTICSattach_function2();
}

View File

@ -0,0 +1,40 @@
/*
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3F
FILEFLAGS 0x0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0
{
BLOCK "StringFileInfo"
{
BLOCK "041104b0"
{
VALUE "CompanyName", "タクティクス"
VALUE "FileDescription", "すずがうたう日"
VALUE "FileVersion", "1.00"
VALUE "InternalName", "SUZUUTA"
VALUE "LegalCopyright", "Copyright (C) 1999"
VALUE "OriginalFilename", "SUZU.EXEC"
VALUE "ProductName", "SuzuGaUtauHi"
VALUE "ProductVersion", "1.00"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x411, 1200
}
}
*/
class TACTICS : public ENGINE
{
public:
TACTICS()
{
check_by = CHECK_BY::RESOURCE_STR;
check_by_target = L"タクティクス";
};
bool attach_function();
};

View File

@ -11,6 +11,7 @@
#include "engine32/LCScript.h"
#include "engine32/ONScripterru.h"
#include "engine32/CoffeeMaker.h"
#include "engine32/TACTICS.h"
#include "engine32/splushwave.h"
#include "engine32/FrontWing.h"
#include "engine32/GSX.h"
@ -397,5 +398,6 @@ std::vector<ENGINE *> check_engines()
new RPGMakerRGSS300,
new Sceplay,
new Onscripter,
new TACTICS,
};
}

View File

@ -489,6 +489,7 @@ void TextHook::Read()
if (hp.filter_fun && !hp.filter_fun(pbData, &dataLen, &hp) || dataLen <= 0)
continue;
TextOutput({GetCurrentProcessId(), address, 0, 0}, hp, buffer, dataLen);
dataLen = min(currentLen, TEXT_BUFFER_SIZE);
memcpy(pbData, location, dataLen);
}
}