mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 23:53:54 +08:00
.
This commit is contained in:
parent
c5cc681021
commit
e99c7529ea
@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(enginepath "engine64")
|
||||
set(collector "enginecollection64.cpp")
|
||||
else()
|
||||
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 jukujojidai 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 AbogadoPowers 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 jukujojidai 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()
|
||||
|
34
cpp/LunaHook/LunaHook/engine32/AbogadoPowers.cpp
Normal file
34
cpp/LunaHook/LunaHook/engine32/AbogadoPowers.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
#include "AbogadoPowers.h"
|
||||
|
||||
bool AbogadoPowers::attach_function()
|
||||
{
|
||||
// https://vndb.org/v509
|
||||
// D+VINE[LUV]
|
||||
const BYTE bytes[] = {
|
||||
0xa1, XX4,
|
||||
0x33, 0xc9,
|
||||
0x8a, 0x08,
|
||||
0x85, 0xc9,
|
||||
0x0f, 0x84, XX4,
|
||||
0xe8, XX4,
|
||||
0x85, 0xc0};
|
||||
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
|
||||
if (!addr)
|
||||
return false;
|
||||
HookParam hp;
|
||||
hp.address = addr;
|
||||
hp.type = USING_STRING;
|
||||
hp.user_value = *(DWORD *)(addr + 1);
|
||||
hp.text_fun = [](hook_context *context, HookParam *hp, TextBuffer *buffer, uintptr_t *split)
|
||||
{
|
||||
buffer->from(*(char **)hp->user_value, 2);
|
||||
};
|
||||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
if (buffer->buff[0] == '_')
|
||||
return buffer->clear();
|
||||
if (buffer->buff[0] == 0)
|
||||
return buffer->clear();
|
||||
};
|
||||
return NewHook(hp, "AbogadoPowers");
|
||||
}
|
18
cpp/LunaHook/LunaHook/engine32/AbogadoPowers.h
Normal file
18
cpp/LunaHook/LunaHook/engine32/AbogadoPowers.h
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
class AbogadoPowers : public ENGINE
|
||||
{
|
||||
public:
|
||||
AbogadoPowers()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = []()
|
||||
{
|
||||
auto _ = {L"*.dsk", L"*.pal", L"*.pft", L"*.fnt"};
|
||||
auto checkfile = std::all_of(_.begin(), _.end(), Util::CheckFile);
|
||||
return checkfile && Util::SearchResourceString(L"AbogadoPowers / Scarecrow");
|
||||
};
|
||||
};
|
||||
bool attach_function();
|
||||
};
|
@ -1,52 +1,58 @@
|
||||
#include"Lightvn.h"
|
||||
|
||||
//https://vndb.org/r?f=fwLight_evn-
|
||||
|
||||
#include "Lightvn.h"
|
||||
|
||||
// https://vndb.org/r?f=fwLight_evn-
|
||||
|
||||
void SpecialHookLightvnA(hook_context *context, HookParam *hp, TextBuffer *buffer, uintptr_t *split)
|
||||
{
|
||||
//[Parser::ReadScriptBreak] curline:'"「次は[水縹]<みはなだ>駅、水縹駅――お出口は左側です」'
|
||||
//[Parser::ReadScriptBreak] curline:'"「次は[水縹]<みはなだ>駅、水縹駅――お出口は左側です」'
|
||||
|
||||
//[PARSETOKENS] line:.始発でここまで来ているのは俺くらいなものだろう。
|
||||
//(scenario:T) (script:00.txt, lineNo:30)
|
||||
//(scenario:T) (script:00.txt, lineNo:30)
|
||||
//[PARSETOKENS] line:"電車には俺のほかに数人乗っている程度。\c
|
||||
//(scenario:F) (script:00.txt, lineNo:29)
|
||||
std::string s=(char*)context->stack[1];
|
||||
//std::regex _1("\\[Parser::ReadScriptBreak\\] curline:'[\"\\.]([\\s\\S]*?)'([\\s\\S]*?)");//对于多行显示不全
|
||||
//std::regex _2("\\[PARSETOKENS\\] line:([\\s\\S]*?)\\(scenario:([\\s\\S]*?)");
|
||||
//(scenario:F) (script:00.txt, lineNo:29)
|
||||
std::string s = (char *)context->stack[1];
|
||||
// std::regex _1("\\[Parser::ReadScriptBreak\\] curline:'[\"\\.]([\\s\\S]*?)'([\\s\\S]*?)");//对于多行显示不全
|
||||
// std::regex _2("\\[PARSETOKENS\\] line:([\\s\\S]*?)\\(scenario:([\\s\\S]*?)");
|
||||
std::regex _2("\\[PARSETOKENS\\] line:[-\"\\.]+([\\s\\S]*?)\\(scenario:([\\s\\S]*?)");
|
||||
std::regex _3("\\[PARSETOKENS\\] line:([\\s\\S]*?)backlogName = '([\\s\\S]*?)'([\\s\\S]*?)");
|
||||
std::smatch match; std::string _;
|
||||
if (std::regex_match(s, match, _2)) {
|
||||
_=std::string(match[1]);
|
||||
std::smatch match;
|
||||
std::string _;
|
||||
if (std::regex_match(s, match, _2))
|
||||
{
|
||||
_ = std::string(match[1]);
|
||||
_ = std::regex_replace(_, std::regex("\\[(.*?)\\]<(.*?)>"), "$1");
|
||||
strReplace(_,"\\c","");
|
||||
strReplace(_,"\\w","");
|
||||
*split=1;
|
||||
}
|
||||
else if (std::regex_match(s, match, _3)) {
|
||||
_=std::string(match[2]);
|
||||
*split=2;
|
||||
}
|
||||
strReplace(_, "\\c", "");
|
||||
strReplace(_, "\\w", "");
|
||||
*split = 1;
|
||||
}
|
||||
else if (std::regex_match(s, match, _3))
|
||||
{
|
||||
_ = std::string(match[2]);
|
||||
*split = 2;
|
||||
}
|
||||
buffer->from(_);
|
||||
}
|
||||
|
||||
void SpecialHookLightvnW(hook_context *context, HookParam *hp, TextBuffer *buffer, uintptr_t *split)
|
||||
{
|
||||
std::wstring s((wchar_t*)context->stack[1]);
|
||||
{
|
||||
std::wstring s((wchar_t *)context->stack[1]);
|
||||
std::wregex _2(L"\\[PARSETOKENS\\] line:[-\"\\.]+([\\s\\S]*?)\\(scenario:([\\s\\S]*?)");
|
||||
std::wregex _3(L"\\[PARSETOKENS\\] line:([\\s\\S]*?)backlogName = '([\\s\\S]*?)'([\\s\\S]*?)");
|
||||
std::wsmatch match; std::wstring _;
|
||||
if (std::regex_match(s, match, _2)) {
|
||||
_=std::wstring(match[1]);
|
||||
std::wsmatch match;
|
||||
std::wstring _;
|
||||
if (std::regex_match(s, match, _2))
|
||||
{
|
||||
_ = std::wstring(match[1]);
|
||||
_ = std::regex_replace(_, std::wregex(L"\\[(.*?)\\]<(.*?)>"), L"$1");
|
||||
strReplace(_,L"\\c",L"");
|
||||
strReplace(_,L"\\w",L"");
|
||||
*split=1;
|
||||
}
|
||||
else if (std::regex_match(s, match, _3)) {
|
||||
_=std::wstring(match[2]);
|
||||
*split=2;
|
||||
}
|
||||
strReplace(_, L"\\c", L"");
|
||||
strReplace(_, L"\\w", L"");
|
||||
*split = 1;
|
||||
}
|
||||
else if (std::regex_match(s, match, _3))
|
||||
{
|
||||
_ = std::wstring(match[2]);
|
||||
*split = 2;
|
||||
}
|
||||
buffer->from(_);
|
||||
}
|
||||
bool InsertLightvnHook()
|
||||
@ -63,21 +69,84 @@ bool InsertLightvnHook()
|
||||
NewHook(hp, "Light.vn");
|
||||
}*/
|
||||
VirtualProtect(IsDebuggerPresent, 2, PAGE_EXECUTE_READWRITE, DUMMY);
|
||||
*(uint16_t*)IsDebuggerPresent = 0xc340; // asm for inc eax ret
|
||||
*(uint16_t *)IsDebuggerPresent = 0xc340; // asm for inc eax ret
|
||||
HookParam hp;
|
||||
hp.address = (uintptr_t)OutputDebugStringA;
|
||||
hp.type = CODEC_UTF8 | USING_STRING;
|
||||
hp.offset=stackoffset(1);
|
||||
hp.offset = stackoffset(1);
|
||||
hp.text_fun = SpecialHookLightvnA;
|
||||
auto succ=NewHook(hp, "OutputDebugStringA");
|
||||
auto succ = NewHook(hp, "OutputDebugStringA");
|
||||
hp.address = (uintptr_t)OutputDebugStringW;
|
||||
hp.type = CODEC_UTF16 | USING_STRING;
|
||||
hp.text_fun = SpecialHookLightvnW;
|
||||
succ|=NewHook(hp, "OutputDebugStringW");
|
||||
succ |= NewHook(hp, "OutputDebugStringW");
|
||||
return succ;
|
||||
}
|
||||
namespace
|
||||
{
|
||||
bool _1()
|
||||
{
|
||||
auto [minAddress, maxAddress] = Util::QueryModuleLimits(GetModuleHandle(L"Engine.dll"));
|
||||
const BYTE BYTES[] = {
|
||||
0x55, 0x8b, 0xec,
|
||||
0x83, 0xec, XX,
|
||||
0x8b, XX, 0x10,
|
||||
0x89, XX, XX,
|
||||
0x8b, XX, 0x0c,
|
||||
0x89, XX, XX,
|
||||
0x8b, XX, 0x08,
|
||||
0x89, XX, XX,
|
||||
0xc7, 0x45, XX, 0x00, 0x00, 0x00, 0x00,
|
||||
0x83, 0x7d, XX, 0x00,
|
||||
0x74, XX,
|
||||
0x8b, 0x45, XX,
|
||||
0x66, 0x8b, 0x08,
|
||||
0x66, 0x89, 0x4d, XX,
|
||||
0x8b, XX, XX,
|
||||
0x66, XX, XX,
|
||||
0x66, XX, XX, XX,
|
||||
0x66, XX, XX, XX,
|
||||
0x66, XX, XX, XX};
|
||||
auto addr = MemDbg::findBytes(BYTES, sizeof(BYTES), minAddress, maxAddress);
|
||||
if (!addr)
|
||||
return false;
|
||||
auto addrs = findxref_reverse_checkcallop(addr, minAddress, maxAddress, 0xe8);
|
||||
if (addrs.size() != 3)
|
||||
return false;
|
||||
addr = addrs[0];
|
||||
addr = findfuncstart(addr);
|
||||
if (!addr)
|
||||
return false;
|
||||
HookParam hp;
|
||||
hp.address = addr;
|
||||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
static std::wstring last;
|
||||
|
||||
bool Lightvn::attach_function() {
|
||||
|
||||
return InsertLightvnHook();
|
||||
}
|
||||
auto s = buffer->strW();
|
||||
if (startWith(s, L"\"-"))
|
||||
return buffer->clear();
|
||||
if (!(startWith(s, L"\"") || startWith(s, L".") || startWith(s, L"-\".")))
|
||||
return buffer->clear();
|
||||
|
||||
if (startWith(s, L"\"") || startWith(s, L"."))
|
||||
s = s.substr(1);
|
||||
else if (startWith(s, L"-\"."))
|
||||
s = s.substr(3);
|
||||
if (s == L"イン" || s == L"拡大" || s == L"アウト" || s == L"インアウト" || startWith(s, L"イン ") || startWith(s, L"拡大 ") || startWith(s, L"インアウト ") || startWith(s, L"アウト "))
|
||||
return buffer->clear();
|
||||
|
||||
if (s == last)
|
||||
return buffer->clear();
|
||||
last = s;
|
||||
buffer->from(s);
|
||||
};
|
||||
hp.offset = stackoffset(1);
|
||||
hp.type = CODEC_UTF16 | USING_STRING;
|
||||
return NewHook(hp, "Light.VN");
|
||||
}
|
||||
}
|
||||
bool Lightvn::attach_function()
|
||||
{
|
||||
return InsertLightvnHook() | _1();
|
||||
}
|
@ -9,6 +9,7 @@
|
||||
#include "engine32/LCScript.h"
|
||||
#include "engine32/Cage.h"
|
||||
#include "engine32/ONScripterru.h"
|
||||
#include "engine32/AbogadoPowers.h"
|
||||
#include "engine32/Winters.h"
|
||||
#include "engine32/CoffeeMaker.h"
|
||||
#include "engine32/TACTICS.h"
|
||||
@ -422,5 +423,6 @@ std::vector<ENGINE *> check_engines()
|
||||
new T2U,
|
||||
new antique,
|
||||
new BunBun,
|
||||
new DAC};
|
||||
new DAC,
|
||||
new AbogadoPowers};
|
||||
}
|
@ -133,6 +133,11 @@ namespace ppsspp
|
||||
{
|
||||
CharFilter(buffer, '\n');
|
||||
}
|
||||
void NPJH50899(TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
CharFilter(buffer, '\n');
|
||||
StringFilter(buffer, "\x81\x40", 2);
|
||||
}
|
||||
void ULJM06147(TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
CharFilter(buffer, L'R');
|
||||
@ -339,6 +344,20 @@ namespace ppsspp
|
||||
s = std::regex_replace(s, std::regex(R"((#[A-Za-z]+\[(\d*[.,])?\d+\])+)"), "");
|
||||
buffer->from(s);
|
||||
}
|
||||
void ULJM05867_1(TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
auto s = buffer->viewA();
|
||||
if (s.find("#n") == s.npos)
|
||||
return buffer->clear();
|
||||
ULJM05943F(buffer, hp);
|
||||
}
|
||||
void ULJM05867_2(TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
auto s = buffer->viewA();
|
||||
if (s.find("#n") != s.npos)
|
||||
return buffer->clear();
|
||||
ULJM05943F(buffer, hp);
|
||||
}
|
||||
void ULJM06289(TextBuffer *buffer, HookParam *hp)
|
||||
{
|
||||
StringFilter(buffer, "\x81\x40", 2);
|
||||
@ -1008,6 +1027,9 @@ namespace ppsspp
|
||||
{0x888A358, {0, 0, 0, 0, ULJM05943F, "ULJM06131"}}, // NAME+TEXT
|
||||
{0x88DB214, {0, 0, 0, 0, ULJM05943F, "ULJM06131"}}, // TEXT
|
||||
{0x889E970, {0, 0, 0, 0, ULJM05943F, "ULJM06131"}}, // NAME
|
||||
// S.Y.K ~蓮咲伝~ Portable
|
||||
{0x88FB080, {0, 0, 0, 0, ULJM05867_1, "ULJM05867"}}, // TEXT
|
||||
{0x88FB0B8, {0, 0, 0, 0, ULJM05867_2, "ULJM05867"}}, // NAME
|
||||
// 源狼 GENROH
|
||||
{0x8940DA8, {0, 1, 0, 0, ULJM06145, "ULJM06145"}}, // TEXT
|
||||
// 十鬼の絆
|
||||
@ -1195,12 +1217,18 @@ namespace ppsspp
|
||||
{0x887493C, {0, 0, 0, 0, ULJM06032, "ULJM06291"}},
|
||||
// 里見八犬伝 八珠之記
|
||||
{0x887FF84, {0, 1, 0, 0, 0, "NPJH50858"}},
|
||||
// 里見八犬伝~村雨丸之記~
|
||||
{0x88750C0, {0, 1, 0, 0, NPJH50899, "NPJH50899"}},
|
||||
// 里見八犬伝~浜路姫之記~
|
||||
{0x886C750, {0, 1, 0, 0, NPJH50899, "NPJH50885"}},
|
||||
// 白華の檻~緋色の欠片4~
|
||||
{0x88FE8C0, {0, 0, 0, 0, ULJM05823_2, "ULJM06167"}},
|
||||
{0x894672C, {0, 4, 0, 0, ULJM06167, "ULJM06167"}},
|
||||
// 白華の檻 ~緋色の欠片4~ 四季の詩
|
||||
{0x8851EA0, {0, 0, 0, 0, ULJM06266, "ULJM06314"}},
|
||||
{0x88E33E0, {0, 0, 0, 0, ULJM05943F, "ULJM06314"}},
|
||||
// 蒼黒の楔 緋色の欠片3 明日への扉
|
||||
{0x894C93C, {0, 1, 0, 0, ULJM06289, "ULJM06072"}},
|
||||
// 真・翡翠の雫 緋色の欠片2 ポータブル
|
||||
{0x887CEAC, {0, 0, 0, 0, ULJM06289, "ULJM05725"}},
|
||||
{0x8876794, {0, 0, 0, 0, ULJM05725, "ULJM05725"}},
|
||||
@ -1265,6 +1293,8 @@ namespace ppsspp
|
||||
// Princess Arthur
|
||||
{0x8841D10, {0, 0xE, 0, 0, ULJM06258_2, "ULJM06258"}}, // name+text,显示完后
|
||||
{0x88A844C, {0, 1, 0, 0, ULJM06258, "ULJM06258"}}, // text
|
||||
// アルコバレーノ!ポータブル
|
||||
{0x88AFECC, {0, 4, 0, 0, ULJM05943F, "ULJM05609"}},
|
||||
};
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
|
||||
set(VERSION_MAJOR 6)
|
||||
set(VERSION_MINOR 11)
|
||||
set(VERSION_PATCH 9)
|
||||
set(VERSION_PATCH 10)
|
||||
set(VERSION_REVISION 0)
|
||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user