This commit is contained in:
恍兮惚兮 2024-09-11 10:43:02 +08:00
parent 6ff92740b7
commit b13a4240ab
2 changed files with 89 additions and 7 deletions

View File

@ -163,7 +163,55 @@ bool TACTICSattach_function2()
}; };
return NewHook(hp, "TACTICS_H"); return NewHook(hp, "TACTICS_H");
} }
namespace
{
// https://vndb.org/v2274
//[010119][Tactics] Cheerio! ~ちぇりお~ (bin+cue)
bool h3()
{
/*
if ( a5 != 33088 )
{
v6 = a5 - 33088;
if ( a5 - 33088 < 0 || v6 > 597 )
{
v6 = 598;
sub_417F5C(a1, a5, 598);
}
*/
BYTE sig[] = {
// clang-format off
0x3d,0x40,0x81,0x00,0x00,
0x0f,0x84,XX4,
0x8b,0xf0,
0x81,0xee,0x40,0x81,0x00,0x00,
0x85,0xf6,
0x7c,0x08,
0x81,0xfe,0x55,0x02,0x00,0x00,
0x7e,XX,
0xbe,0x56,0x02,0x00,0x00
// clang-format on
};
auto addr = MemDbg::findBytes(sig, sizeof(sig), processStartAddress, processStopAddress);
if (!addr)
return false;
addr = findfuncstart(addr, 0x20); // v1.0不对齐
if (!addr)
return false;
HookParam hp;
hp.address = addr;
hp.type = USING_CHAR | CODEC_ANSI_BE | NO_CONTEXT;
hp.offset = get_stack(5);
hp.filter_fun = [](void *data, size_t *len, HookParam *hp)
{
static int idx = 0;
return 0 == ((idx++) % 2);
};
return NewHook(hp, "TACTICS_2");
}
}
bool TACTICS::attach_function() bool TACTICS::attach_function()
{ {
return TACTICSattach_function1() | TACTICSattach_function2(); return (TACTICSattach_function1() | TACTICSattach_function2()) || h3();
} }

View File

@ -27,14 +27,48 @@ FILESUBTYPE 0x0
} }
} }
*/
/*
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEFLAGSMASK 0x3F
FILEFLAGS 0x0
FILEOS VOS_UNKNOWN | VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0
{
BLOCK "StringFileInfo"
{
BLOCK "041103A4"
{
VALUE "CompanyName", "Tactics"
VALUE "FileDescription", "Cheerio! ver1.1"
VALUE "FileVersion", "1.1.0.0"
VALUE "InternalName", "Tactics Game System"
VALUE "LegalCopyright", "(c)Tactics 2000"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "CHEERIO.EXE"
VALUE "ProductName", "Cheerio! ver1.1"
VALUE "ProductVersion", "1.1.0.0"
VALUE "Comments", ""
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x411, 932
}
}
*/ */
class TACTICS : public ENGINE class TACTICS : public ENGINE
{ {
public: public:
TACTICS() TACTICS()
{ {
check_by = CHECK_BY::RESOURCE_STR; check_by = CHECK_BY::CUSTOM;
check_by_target = L"タクティクス"; check_by_target = []()
}; { return Util::SearchResourceString(L"タクティクス") || Util::SearchResourceString(L"Tactics"); };
bool attach_function(); };
bool attach_function();
}; };